Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-04

Editor tabs and opening new files

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hello,

I'm using Lazarus v1.7 (quite recent) compile with LCL-GTK2. Is there an option in the IDE to open a new file (eg: 'File -> Open' and a file from any directory) always as the last tab in the editor window?

The current behaviour is to open the new file just after the current tab. I don't want that if possible. I use tab ordering extensively, as I work with lots of open files.

Regards,
Graeme

Reply by email

Bart
to Graeme Geldenhuys
Graeme Geldenhuys wrote
I'm using Lazarus v1.7 (quite recent) compile with LCL-GTK2. Is there an option in the IDE to open a new file (eg: 'File -> Open' and a file from any directory) always as the last tab in the editor window?

That would indeed be a nice option.

Bart

Reply by email

Graeme Geldenhuys
to Bart
Bart wrote
That would indeed be a nice option.

In the mean time I made a small patch that adds that behaviour.

NOTE:
It?s not a configurable setting, just a hard-coded changes of behaviour.

=====================================
diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp
index d39b3a6..81a1ea8 100644
--- a/ide/sourceeditor.pp
+++ b/ide/sourceeditor.pp
@@ -7154,7 +7154,8 @@ begin
     if NewPageNum >= 0 then
       PageNum := NewPageNum
     else
-      Pagenum := PageIndex+1;
+//      Pagenum := PageIndex+1;
+      Pagenum := PageCount; // graemeg: add new file to end of tabs list
     Pagenum := Max(0,Min(PageNum, PageCount));
     if ATabCaption = '' then
       ATabCaption := Manager.FindUniquePageName('', nil);
=====================================

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email