Sign in Join

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

Mailing lists / lazarus / 2020-07

Lazarus code editor, how to show invisible tabs?

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

I have encountered a strange problem in Lazarus (2.0.8 on Raspbian Buster linux).

I have a fair number of source files open in tabs. The file names could be rather long too.
So then the tabs displaying file names do not fit sidewise on the screen so the list of tabs is truncated left and right.

If I have edited a file to the right that has brought the leftmost tab out of the visible area of the tabs I can no longer get back to the leftmost side of the editor where my main project files should live....
The leftmost VISIBLE tab is the most "leftish" file I can reach.

I have noted that the left arrow "button" in the tabs section is not clickable since the mouse pointer always changes to the resize double arrow when I move to the location of the left arrow... Not even selecting the leftmost tab changes this behaviour with the left arrow button being unclickable.

But if I *resize* the code editor with the mouse (and bring it back to where it was originally), THEN the left arrow button becomes clickable (turns dark)!

At this time I can click it ONCE ONLY(!) to scroll the file tabs one tab over...

Then I have to repeat the sequence of resize followed by clicking the arrow again.

The right arrow button on the other side does not work in this strange way, it is always switching selected tab towards the right side..

Is this by design or is there a setting somewhere to disable this strange behaviour for the left arrow button?

In the Delphi 2007 editor there is a down arrow to the right side which if clicked displays a list of files open in the editor and by selecting the wanted file that tab is immediately brougt into focus. Can Lazarus be configured to display such an editor file list too? If so how?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund
Bo Berglund wrote 8 lines
Is this by design or is there a setting somewhere to disable this strange behaviour for the left arrow button? In the Delphi 2007 editor there is a down arrow to the right side which if clicked displays a list of files open in the editor and by selecting the wanted file that tab is immediately brougt into focus. Can Lazarus be configured to display such an editor file list too? If so how?

In fact if I use the Windows version of Lazarus 2.0.8 there are 2 arrow buttons on the top right hand side of code editor wich work satisfactorily for the purpose of scrolling the tabs. Can that not also be enabled in Linux, please?

Bo Berglund Developer in Sweden

Reply by email

Martin Frb
to Bo Berglund: I have encountered a strange problem in Lazarus (2.0.8 on Raspbian Buster linux). I have…
Bo Berglund wrote 5 lines
the most "leftish" file I can reach. I have noted that the left arrow "button" in the tabs section is not clickable since the mouse pointer always changes to the resize double arrow when I move to the location of the left arrow...

Sounds like a bug.

Show quoted text 7 lines
In the Delphi 2007 editor there is a down arrow to the right side which if clicked displays a list of files open in the editor and by selecting the wanted file that tab is immediately brougt into focus. Can Lazarus be configured to display such an editor file list too? If so how?

If you right click any tab, the context menu has entries for each file. They are grouped by package.
There also is a "recent" sub menu.

If the popup on tabs does not work for you for some reasons, go to Tools

Options > Editor > mouse

And assign to any mouse button (with any shift/ctrl/alt) the "context menu (tab)". This will work with the mouse over the text.

Reply by email

Bo Berglund
to Martin Frb
Martin Frb wrote 9 lines
If you right click any tab, the context menu has entries for each file. They are grouped by package. There also is a "recent" sub menu. If the popup on tabs does not work for you for some reasons, go to Tools > Options > Editor > mouse And assign to any mouse button (with any shift/ctrl/alt) the "context menu (tab)". This will work with the mouse over the text.

Thanks, I did not know about this...
Different approach but with more options! :)
Solved my problem, but I still wonder about the left arrow button...

When talking about project files, I wonder what is the advantage of adding the files into the project over just having them reside in the project source directory?
I have noted that whenever I start a new unit in the IDE File menu this file gets added to the project along with the lpr file.

All other files I have retrieved from subversion and brought into the source dir are not, but seems to work fine anyway. Except now with this rightclick on the tab they are now located under "Other tabs" instead of "Tabs for project"...

And are "project files" going to be listed in the lpi or lps file? Because they are not in the lpr file...

Which of these should go into SVN control?
<project>.lpi is what I have there now.
I think one is just transactional data and the other holds settings and such.

Bo Berglund Developer in Sweden

Reply by email

Martin Frb
to Bo Berglund
Bo Berglund wrote 5 lines
When talking about project files, I wonder what is the advantage of adding the files into the project over just having them reside in the project source directory? I have noted that whenever I start a new unit in the IDE File menu this file gets added to the project along with the lpr file.

The compiler always searches the whole directory/ies, when encounter a unit in uses.

The IDE, I don't know what it uses, and when, and whatfor.

And are "project files" going to be listed in the lpi or lps file? Because they are not in the lpr file...

They will go into:  lpi  Lazarus Project Info

"lps" / Project Session is optional. And stores info such as which files are open in which tab, how are they scrolled/folded, where is the cursor ......
lps can be embedded in lpi, can be in its on file, or not exist at all

Which of these should go into SVN control? <project>.lpi is what I have there now.

*.lpr ( that is actually a normal source, but generated by the IDE) *.lpi
.res / .ico (if you did nothing special it can be regenerated, but otherwise)

Not in version control is usually .lps (because if there are several people working on the project, they have each there own session). You can even tell the IDE to store lps files in the primary-conf-path, instead of the project folder.

Reply by email

Mattias Gaertner
to Bo Berglund: On Thu, 30 Jul 2020 18:24:29 +0200, Martin Frb via lazarus Thanks, I did not know about…
Show quoted text 6 lines
[...] When talking about project files, I wonder what is the advantage of adding the files into the project over just having them reside in the project source directory? I have noted that whenever I start a new unit in the IDE File menu this file gets added to the project along with the lpr file.

Well, some people put multiple projects into one folder, which quickly can get messy. With the project units you and the IDE know which files actually belong to the project.

There are several places in the IDE, where it makes a difference. For example checking for duplicates and when moving an unit to another folder the IDE can adjust the project's unit search path.

Mattias

Reply by email

Bo Berglund
to Mattias Gaertner
Mattias Gaertner wrote 7 lines
Well, some people put multiple projects into one folder, which quickly can get messy. With the project units you and the IDE know which files actually belong to the project. There are several places in the IDE, where it makes a difference. For example checking for duplicates and when moving an unit to another folder the IDE can adjust the project's unit search path.

I found that when I added all of the files in my folder to the project then the quick compile failed in a unit that had been ifdef:ed out so it is not used in any of the other units.
The reason for the ifdef:s is that its functionality is an optional add-on and heavily Windows-centric. But it is part of the project I am porting from Delphi/Windows to FPC/Linux. It is to be handled when all else works.

So Lazarus quick compiled it anyway.
When I removed it from the project again the quick compile succeeded.

So it seems like a unit that is part of the project is always checked during compile even if it is not actually part of the project due to ifdef:s...

Bo Berglund Developer in Sweden

Reply by email