Recent

Author Topic: Cannot see unit text - editor pane blank  (Read 723 times)

lorenzo

  • New Member
  • *
  • Posts: 19
Cannot see unit text - editor pane blank
« on: November 26, 2025, 09:05:22 am »
I sometimes select a tab in the Lazarus IDE to view the code of a unit but (maybe 10% of the time) just see a blank.

If I close Lazarus and relaunch it, I will find the text of that unit now visible.  So I have a workround but it is tedious, and also puzzling: I have spent ages leafing through Project Options trying to cure it, and have searched in this forum.

I am running Lazarus 4.4 (FPC 3.2.2) from x86_64-win64-win32/win64 under Windows 11 (up to date).

I'd appreciate your thoughts.

cdbc

  • Hero Member
  • *****
  • Posts: 2506
    • http://www.cdbc.dk
Re: Cannot see unit text - editor pane blank
« Reply #1 on: November 26, 2025, 09:11:37 am »
Hi
When it happened to me, once in a blue moon -> I just rolled the mousewheel and the text was visible...
I guess it's since they decided to do "Gremlins 3"  :D ;D :P 8)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11901
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot see unit text - editor pane blank
« Reply #2 on: November 26, 2025, 10:34:22 am »
No idea, but you could try to get a log, so we can see if the IDE outputted something of interest.

Start lazarus with  --debug-log=c:\somewhere\logfile.txt

OR rebuild the IDE with -WC then it will have an extra console window, and logoutput is visible there.




As minimal diagnosis, try
- scrolling
- resizing the window
- focus / unfocus
- change tabs again

If the file is expected to be longer than a page, is the scrollbar correctly set?




Do you use
- Anchordocking
- Docked form editor
- Minimap
?


lorenzo

  • New Member
  • *
  • Posts: 19
Re: Cannot see unit text - editor pane blank
« Reply #3 on: November 26, 2025, 12:22:22 pm »
Thank you, Benny - I'll try scrolling.
Martin - I'll try the -WC rebuild - thank you.  As to minimap etc I don't know the correct name: I selected the 'modern style' option, all (well, most of) the
panes fused into a single view.

Thaddy

  • Hero Member
  • *****
  • Posts: 18483
  • Here stood a man who saw the Elbe and jumped it.
Re: Cannot see unit text - editor pane blank
« Reply #4 on: November 26, 2025, 12:55:07 pm »
It seems repeatable when the mouse is outside of the window and there is otherwise no user input at all.
It does not happen all the time, The slightest input of any kind makes the content appear.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11901
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot see unit text - editor pane blank
« Reply #5 on: November 26, 2025, 01:21:08 pm »
It seems repeatable when the mouse is outside of the window and there is otherwise no user input at all.
It does not happen all the time, The slightest input of any kind makes the content appear.

How did you change tabs then?

If the mouse is outside the window, then it can't have clicked the tab. So key-combo for
- tab left/right
- go to declaration
- ?

Or did "outside the window" just mean: Outside the SynEdit (not top parent) window?

---
@lorenzo: How did you change tabs, if it happens?

Thaddy

  • Hero Member
  • *****
  • Posts: 18483
  • Here stood a man who saw the Elbe and jumped it.
Re: Cannot see unit text - editor pane blank
« Reply #6 on: November 26, 2025, 02:05:53 pm »
I stayed away from the keyboard and just pressed F9.
As I wrote, it is quite difficult to replicate, but it is repeatable, not 100% repeatable, maybe 10-15%.
It relates to where the cursor is when the program starts if that helps...
It also relates to the program being run under Lazarus, not stand-alone.
Looks like one of the editor windows captured the cursor?

A simple form + button + memo-with-content is sufficient to try and replicate it under Linux GTK2 and on Windows11 too. So it must be something in Lazarus IDE and does not depend on platform it seems.
(It is a real brain breaker, can't see why and it is not consistent, and it is the IDE window, not the program window, the program needs to run though)
« Last Edit: November 26, 2025, 02:22:30 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11901
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot see unit text - editor pane blank
« Reply #7 on: November 26, 2025, 02:27:11 pm »
I stayed away from the keyboard and just pressed F9.

But in a way that switched to a different tab, as by the original post?
I sometimes select a tab in the Lazarus IDE

So, either a compile error switching tab? or a breakpoint or exception?

Sorry to be picky, but I work a lot with the IDE, and never had it. So there must be some detail, some workflow that I myself never do.

lorenzo

  • New Member
  • *
  • Posts: 19
Re: Cannot see unit text - editor pane blank
« Reply #8 on: November 26, 2025, 02:44:45 pm »
Wow - this is more intricate than I expected.  I just assumed I had failed to select a correct option somewhere.

@Martin_fr  I've made a screen shot.  I left-mouse-click on a tab such as the one circled in red.

It hasn't happend to me again since my original post.
Thank you all for your time and expertise.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11901
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot see unit text - editor pane blank
« Reply #9 on: November 26, 2025, 03:05:34 pm »
Wow - this is more intricate than I expected.  I just assumed I had failed to select a correct option somewhere.

No, this isn't an option, there is no option to "hide" the content of the editor. This would be a bug.

Well, come to think of it, there is one possibility.
  Tools > Options > Editor > General: "Scroll past end of file".
If then the editor (for some reason) was scrolled to the very bottom, then you would
- only see ONE SINGLE line of the file.
- And that line would be at the very top of the editor.
- And if that line was empty, then there would only be the line number for it
  - Which could be just a small dot, depending on gutter and caret settings

You would note that the vertical scroll bar has to be at the very be at the very bottom.



Otherwise, I assume
 
but (maybe 10% of the time) just see a blank.
means
- the area for the text has the normal text background color (white / or black if you choose a dark theme)
- the gutter (on the left side) has it's normal color (e.g. grey)
  - but does not show anything on it, no line numbers (not even small dots)
- the overview gutter (right side / if enabled in options) is present, but empty
- the scroll bar is present (if the file would require it).

If it happens please take note of
- Does the file has enough lines that it would need scrolling?
- Does it happen to units that have a form? (only those with form, only those without, or both)
- What does the status bar (at the bottom) show?

And in any case, please attach your editor options. editoroptions.xml from "primary config path" (see menu view > ide internals > about ide)

lorenzo

  • New Member
  • *
  • Posts: 19
Re: Cannot see unit text - editor pane blank
« Reply #10 on: November 26, 2025, 03:35:08 pm »
@Martin_fr

editoroptions.xml attached.

The 'blank' is usual/expected colours with a complete absence of content.  I cannot remember the thumb on the scroll-bar but will note it next time it happens.  I will also note whether the unit has a form or not (mine mostly do).

L.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11901
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot see unit text - editor pane blank
« Reply #11 on: November 26, 2025, 05:15:23 pm »
OK, EditorOptions are fine, nothing in there that differs much from defaults.

n7800

  • Hero Member
  • *****
  • Posts: 583
  • Lazarus IDE contributor
    • GitLab profile
Re: Cannot see unit text - editor pane blank
« Reply #12 on: November 26, 2025, 08:43:34 pm »
Could this be related to DockedFormEditor package? I see it's being used in the topic author's screenshot.

@cdbc, @Thaddy, do you have it installed?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11901
  • Debugger - SynEdit - and more
    • wiki
Re: Cannot see unit text - editor pane blank
« Reply #13 on: November 26, 2025, 08:51:09 pm »
@lorenzo

If you compile(d) with -WC (or if you use a logfile) could you also compile with -gl please? (Tools > Configure build Lazarus: In "Custom Options" add -gl )

It is possible that somehow something unexpected is triggered during some "lock". Something like
Code: Pascal  [Select][+][-]
  1. Editor.BeginUpdate // do not paint
  2. Editor.Paint;
  3. Editor.EndUpdate;

Obviously not that directly, but by different part of the code. There is a very complex set of events and callbacks.

If that happens, then it is possible that SynEdit may be printing a stacktrace. (If you use -gl then that error will "pause" your IDE for 1 or 2 seconds, as it is slow, but only when the error starts).

-gl adds unit names and line numbers to the trace (if there is one).

lorenzo

  • New Member
  • *
  • Posts: 19
Re: Cannot see unit text - editor pane blank
« Reply #14 on: November 27, 2025, 07:33:00 am »
Thank you for your continued interest @Martin-fr.  I have recompiled the IDE with -WC and -gl.  I have spent a while re-opening old projects and viewing each of the unit tabs.  To my surprise and frustration I have not seen the blank behaviour again since I started this thread. 

I'll remain on the alert for something worth telling you about, but, like Captain Oates, I may be some time.


 

TinyPortal © 2005-2018