Source

Kephra / lib / Kephra / File.pm

Diff from to

lib/Kephra/File.pm

 sub new  {
 	my $docbar = Kephra::API::docbar();
 	my $doc = Kephra::Document->new();
-	$_->add_page( $doc->panel->{$_}, 'rightmost', $doc->title, 0 ) for Kephra::API::all_docbars();;
+	$_->add_page( $doc->panel->{$_}, 'rightmost', $doc->title, 0 ) for Kephra::API::all_docbars();
 	Kephra::API::focus( $doc->editor->{$docbar} );
 	Kephra::API::main_window()->refresh_title();
 }
 		my $ed = Kephra::API::editor();
 		if ($ed->GetLength) {
 			$doc = Kephra::Document->new($file);
+			$doc->editor->{$_}->unmount_events() for Kephra::API::all_docbars();
 			$_->add_page( $doc->panel->{$_},'right', $doc->file_name, 1) for Kephra::API::all_docbars();
 			my $content_ref = $doc->editor->{$db}->GetDocPointer();
-			$doc->editor->{$_}->SetDocPointer( $content_ref ) for Kephra::API::passive_docbars()
+			$doc->editor->{$_}->SetDocPointer( $content_ref ) for Kephra::API::passive_docbars();
 		}
 		# reuse it if current doc is empty
 		else {
 		Kephra::File::Local::read( $doc, $file );
 		$ed = Kephra::API::editor();
 		$ed->EmptyUndoBuffer;
-		#$ed->mount_events();
+		$doc->editor->{$_}->mount_events() for Kephra::API::all_docbars();
 		Kephra::API::main_window()->refresh_title();
 	}
 }