Forum > IDE/CodeTools

Faster responding Code Explorer

(1/3) > >>

KodeZwerg:
Code Explorer refresh rate increase, may that be included or would it damage systems?

File to patch: \Lazarus\IDE\CodeExplorer.pas
What to patch: procedure TCodeExplorerView.IdleTimer1Timer(Sender: TObject);

Before:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TCodeExplorerView.IdleTimer1Timer(Sender: TObject);begin  if not (cevCheckOnIdle in FFlags) then exit;
After:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TCodeExplorerView.IdleTimer1Timer(Sender: TObject);begin  if (IdleTimer1 <> nil) then    IdleTimer1.Interval := 100;  if not (cevCheckOnIdle in FFlags) then exit;
My current version I tested it with (Windows 10/64bit):
Lazarus 2.2.4 (rev lazarus_2_2_4) FPC 3.2.2 x86_64-win64-win32/win64

Thaddy:
Introducing an arbitrary interval may indeed affect other systems than yours. Stay away from timers, even idletimers.
Maybe you can come up with a better solution? It is always valid to speed up things a bit.

KodeZwerg:
Thanks for your honest reply!

KodeZwerg:
After a long seek and hunt game, and your text @Thaddy, I probably found a solution but since everything is written very hard for me to find out what it connected with what and how it works together, here is my suggestion that should work for all and respects any OS.

My problem is just to find a way that it works smooth together without breaking something, maybe someone with more experience can help and guide me?

What I found out so far:
The file "lazarus\ide\frames\codeexplorer_update_options.pas" & "codeexplorer_update_options.lfm" hold the stuff thats displayed in configuration to react on changes.
The file "lazarus\ide\lazarusidestrconsts.pas" has the visible names
The file "lazarus\ide\codeexplopts.pas" is somehow the ruler for that screen
and finally "\Lazarus\IDE\CodeExplorer.pas" is the master

My suggestion/Idea would be to place a trackbar like I show exemplary on that image

Martin_fr:
On the initial idea, with a faster timer: It runs codetools, so there is potentially a lot of computing, and while many systems are fast enough, that is not the only issue. For examples users on a Laptop will experience the extra drain on the battery...

First of all, there are several updates triggers. For which do you wish the increased speed.

1) When you are typing inside a block of code?
2) When you switch tabs
3) Other focus events
....

2 (and 3) can maybe bypass the timer, and directly use an "OnIdle" or even an ASync event.

As for 1, well that could be further cut down.
E.g. maybe it can cheaply (though probably not trivial) be detected, if the caret just moved to a diff procedure, which could trigger an update.

I don't know if any other edit or user-input really needs faster updates....

Navigation

[0] Message Index

[#] Next page

Go to full version