1. Herbert Breunung
  2. Kephra

Commits

Herbert Breunung  committed 26b29b9

switching tabbars works

  • Participants
  • Parent commits 0af3d4a
  • Branches sp1

Comments (0)

Files changed (1)

File lib/Kephra/App/Bar/Document.pm

View file
 our @ISA = 'Wx::AuiNotebook';
 our $_ref;
 
-use Scalar::Util qw(blessed);
+use Scalar::Util qw(blessed looks_like_number);
 
 Kephra::API::Command::register({
  'docbar-select-left'     =>{sub=>'$docbar->select_page_left',     label=>'Previous Tab',  keys=>'ctrl+pageup'},
 	my $position = int $pop eq $pop ? $pop : $self->GetPageIndex($pop);
 	return unless $self->valid_page_pos( $position );
 	# if just selecting the currrent, only tab drives focus nuts
-	$position == $self->GetSelection
-		? Kephra::API::focus( $self->GetPage($position) )
-		: $self->SetSelection( $position );
+	$self->SetSelection( $position ) unless $position == $self->GetSelection;
+	my $page = $self->GetPage($position);
+	my $doc = Kehra::API::Docs::find($page);
+	Kephra::API::focus ( defined $doc ? $doc->editor->{$self} : $page );
 }