Ticket #1447: 0004-Fix-recreation-of-files-deleted-by-process-outside-o.patch

File 0004-Fix-recreation-of-files-deleted-by-process-outside-o.patch, 1.0 KB (added by mj41, 21 months ago)
  • Padre/lib/Padre/Wx/Main.pm

    From 4978fe7753206a4e4bcd4e7ea6df61e57d01929a Mon Sep 17 00:00:00 2001
    From: Michal Jurosz <mj@mj41.cz>
    Date: Sat, 11 Aug 2012 21:23:49 +0200
    Subject: [PATCH 4/4] Fix recreation of files deleted by process outside of
     Padre.
    
    ---
     Padre/lib/Padre/Wx/Main.pm |   10 +++++++++-
     1 files changed, 9 insertions(+), 1 deletions(-)
    
    diff --git a/Padre/lib/Padre/Wx/Main.pm b/Padre/lib/Padre/Wx/Main.pm
    index fb68314..36c1bf2 100644
    a b sub reload_editor { 
    45844584    my $self     = shift; 
    45854585    my $editor   = shift || $self->current->editor or return 0; 
    45864586    my $document = $editor->document or return 0; 
    4587     my $lock     = $editor->lock_update; 
     4587 
     4588    # If file doesn't exist close the tab 
     4589    unless ( -e $document->{filename} ) { 
     4590        my $id = $self->editor_of_file( $document->{filename} ); 
     4591        $self->delete($id); 
     4592        return 1; 
     4593    } 
     4594 
     4595    my $lock = $editor->lock_update; 
    45884596 
    45894597    # Capture where we are in the document 
    45904598    my $line = $editor->LineFromPosition( $editor->GetCurrentPos );