Recent

Author Topic: [Solved] trun off IDE auto open tabs  (Read 5224 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12205
  • Debugger - SynEdit - and more
    • wiki
Re: trun off tabs
« Reply #15 on: August 23, 2025, 10:21:00 pm »
Martin
"Then just open packages such as "LCL", "LCL Base""
could I compile with Shit+Ctrl+F9 when i don't want Debug and then Shift+F9 when I do
You can create build modes, and then have different settings for debug, and for non-debug.

But then you need to control the setting for packages via the "project options" > "Additions and overrides". There is a wiki page for that (but I don't have the link at hand).



"close all pages to the right" =>
i have done this but I think the ide track the tabs in some sort of loop because it add at different places each time sometime at the beginning or in the meddle and sometimes on the right. They are never in the same spot twice

Afaik the IDE opens the new tab, next to the current (so between the current, and whatever was after the current).

In the menu "Windows" is the "Manage Source editors" => that allows you to select and close editors.... Not sure if it is useful for you.


What I can do

  • Full Member
  • ***
  • Posts: 193
Re: trun off tabs
« Reply #16 on: August 23, 2025, 10:29:52 pm »
Quote
Is it possible your code is generating a fault that happens within the WinControl.Inc file? If so, the debugger is most likely jumping there.

 Just an assumption.

Jamie
I don't know Jamie, All I can say is from what experience I've had with Lazarus is once in a while. The best I can tell is when I call something from a form. Like in this case KeyPreview and when I step through I'm sure its hitting the next line of something in a form or some other package. Most of the time F8 jumps to the next line without jumping out of my code. I don't think this is an error I was just hopping that there was some switch that just locks the IDE so no other units or packages pop up. I cause some serious damage one time so I am constantly fighting the IDE and closing tabs. I beginning to see  that this is one of those cool features that sometimes just gets in my way. I just expect the F8 to jump to the next line of my code all the time but its OK I have lived with it this long and it sort of becoming just one of those things. Hey THANKS to everyone who has helped your service is greatly appreciated.

What I can do

  • Full Member
  • ***
  • Posts: 193
Re: trun off tabs
« Reply #17 on: August 23, 2025, 10:40:21 pm »
Quote
In the menu "Windows" is the "Manage Source editors" => that allows you to select and close editors.... Not sure if it is useful for you.
Martin,
Thank you that is interesting I just don't know if it will solve my issue and I'm not even sure it's Lazarus and not me. I was curious if others have this issue and was hoping for one of those "Oh, sure click here". I am seeing this is just one of those things, sometimes good, sometimes bad.
Thank you for your help, I do appreciate it. 

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12205
  • Debugger - SynEdit - and more
    • wiki
Re: trun off tabs
« Reply #18 on: August 23, 2025, 10:41:41 pm »
I have a DPoint on my KeyPreview where I capture the F1 key; but when I step through with F8 it open winscontrol.inc and takes off from there.

Ok, in that case you likely did a "STEP OUT".

That is, you stepped to the end of your code (or an "exit;"). And then the next line of code is in the caller, which will be in the LCL (and may be in wincontrol.inc).
In that case, even compiling the LCL without debug info, will not help. If there is no debug info, the debugger would instead open the assembler window.

When you reach the end of a procedure, then any stepping will step out.



If you are at the end of "TForm.Button1Clicked" and you don't want to step out, then all you can do is "run".

It is not possible to "step to the next event". That is, if you don't know what will be called next (maybe Button2, Button3, or maybe PanelResize, or.....) then there is no way to go there => the only way is to set a breakpoint in each of them.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12205
  • Debugger - SynEdit - and more
    • wiki
Re: trun off tabs
« Reply #19 on: August 23, 2025, 10:43:28 pm »
I am seeing this is just one of those things, sometimes good, sometimes bad.

I just use the "middle mouse button" to click all the tabs that I want to close.

I have debug info for all of those units, and a few of them open up over time. And when they are to many then I close them one by one.

What I can do

  • Full Member
  • ***
  • Posts: 193
Re: trun off tabs
« Reply #20 on: August 23, 2025, 11:42:49 pm »
I think Jamie nailed by testing the value that was sent to the call and it is incompatible, boom it fires what ever. So I am at the point of testing every value on the send side then on the receiver side checking class type and variable values. be right back....

What I can do

  • Full Member
  • ***
  • Posts: 193
Re: trun off tabs
« Reply #21 on: August 23, 2025, 11:55:14 pm »
wp
Quote
I installed the "packagetabs" package ("Install" > "Install/Uninstall packages" > select "packagetabs" in the right list > click "Install selection", then "Rebuild IDE"). If you move the tabs to the left ("Tools" > "Options" > "Editor" > "Pages and Windows" > "Notebook Tabs" > "Source Notebook Tabs Position") there is much more space for tabs since the tab height is rather small. And I like that the tabs are grouped by packages to which their unit belongs, and there is scrollbar when the tab list is too long for the height of the editor form.
I took some time and made all backup and copies then installed that package and I love it yes it works with my situation sort of like a middle man. I get all the trace through different code that are now in groups. Yes i can work with that.
High five, thumbs up, and a huge thanks to the entire Lazarus Community

WhatICanDo

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12205
  • Debugger - SynEdit - and more
    • wiki
Re: trun off tabs
« Reply #22 on: August 23, 2025, 11:57:49 pm »
OK, just a few extra remarks on the debugger site.

1) Make sure your code is compiled with -O1 or -O-
That is either with optimization level 1, or optimization off. Any other optimization level can get weird results.

Packages only need that if you want to debug them (if you only accidentally get into them, then it does not matter what optimization they have).

2) Switch of smart linking.
I haven't seen recent issues with this, but there used to be...

3) Use "FpDebug" if possible.
- If you are on either Linux, or Windows
- If you have an Intel or AMD CPU
then go to menu: Tools > options > Debugger > backend
and make sure the selection on the TOP says something ... FpDebug ...

If you use another OS or CPU: https://wiki.freepascal.org/Debugger_Setup#Choosing_the_correct_debugger_backend

What I can do

  • Full Member
  • ***
  • Posts: 193
Re: trun off tabs
« Reply #23 on: August 24, 2025, 12:36:31 am »
Jamie here is what happened on step through

FormKeyUp (sender,key,shift)
 sender= Str:=ActiveControl.Name;
 key= 112
 shift= []

process and then clear Key:=0;
F8 steps each line perfect all data are correct
no messages
obsorb the key (F1) with KEY:=0
then on the line "end;" then next jump is "end;" at this routine
Code: Pascal  [Select][+][-]
  1. //Self = Fprm1
  2. //key= 0
  3. //Shift= []
  4. procedure TWinControl.KeyUp(var Key: Word; Shift : TShiftState);
  5. begin
  6.   if Assigned(FOnKeyUp) then FOnKeyUp(Self, Key, Shift);
  7. end;

F8 from here just keeps going deeper and finally hits a stack loop.
but it does come back eventually without error for now.
I am going with that. Accept this as a normal operation. My tabs are organized and I can work with that. You made a good point so I walked every line and test values and all was good. This type of iDE tab actions is not an error it just needed some organizing (wp 8-)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12205
  • Debugger - SynEdit - and more
    • wiki
Re: trun off tabs
« Reply #24 on: August 24, 2025, 12:46:53 am »
then on the line "end;" then next jump is "end;" at this routine

Yes, this is normal.

The "TWinControl.KeyUp" is the routine that called your code. So when you are at the end of your procedure, you go there (or you go into the assembler window, if there is no debug info for the caller).

This is after all the next code that the CPU will execute. (It does not matter if you wrote it, or it came with Lazarus).



As I said before, at this point there is no other step possible. You can press run instead.

If you want to stop the next time any of your code is called (any KeyDown, Button, or whatever other event you have) then you need breakpoints. Many breakpoints, one for each such event)

What I can do

  • Full Member
  • ***
  • Posts: 193
Re: [Solved] trun off IDE auto open tabs
« Reply #25 on: August 24, 2025, 06:48:04 pm »
Thanks Martin_fr
But I use DPoints as much as I can that way only one break point in one location and I get to choose
[OK] continue compiling
[Cancel] stop compiling and hit break point
[abort] turn off popups
this is top line in every call
I love it and what it taught me was when events trigger and in what order and this was a BIG eye opener. Like TSringGrid fires during From.create and everyone know the DB seams to fires like everything at once. So I use them both and it has made a huge difference in my Debugging.
« Last Edit: August 24, 2025, 06:56:43 pm by What I can do »

 

TinyPortal © 2005-2018