Ticket #85 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

fix a bug (open many window for 1 file)

Reported by: fayland Owned by:
Priority: major Milestone:
Component: editor Version: 0.14
Keywords: Cc:

Description

lib/Padre/Wx/MainWindow.pm

@@ -735,6 +735,16 @@

# current file otherwise open a new buffer and open the file there.
sub setup_editor {

my ($self, $file) = @_;

+
+ # before open it, please check if it's already opened.
+ # if yes, just focus that tab instead create a new one
+ my @pages = $self->pages;
+ foreach my $i ( 0 .. $#pages ) {
+ if ( $pages[$i]->{Document}->filename eq $file ) {
+ $self->on_nth_pane($i);
+ return;
+ }
+ }

local $self->{_no_refresh} = 1;


it works fine in my machine. mainly it prevents to open another tab for one opened file.

if you need a patch again your subversion or even I write it myself in your trunk, please ask me.

thanks.

Change History

comment:1 Changed 5 years ago by szabgab

i think this was already added in SVN trunk, please check that.

comment:2 Changed 5 years ago by fayland

  • Status changed from new to closed
  • Resolution set to fixed

oh, thanks. I'm a bit outdated

Note: See TracTickets for help on using tickets.