icecoder/ICEcoder

Request: Setting to disable smooth scrolling on find / go to line and live find

raymondsalas opened this issue ยท 8 comments

Hi @mattpass ! If it can be considered, I am hoping ICEcoder to have a setting to disable smooth scrolling when using "find". This is because I am dealing with thousands of lines per file and often times, when I use find, it takes a few seconds before it reaches the matching result. I was thinking that other users working in single-file codebases that are oftentimes thousands in lines may also find this useful.

Addendum: As for live find, I am also hoping to have the option to disable it as well since when dealing with thousands of lines and trying to search a keyword that contains a very common substring in the file, the code editor jumps back and forth.

Example:
I have thousands of variables named "$comma", then I also have another variable with thousands of occurrences named "$command", but I am trying to type "$command_exec". In the process of typing "$command_exec" in the find box, the code editor jumps back and forth.

This, together with smooth scrolling, makes a very dizzying experience :P

@raymondsalas I can see the benefit in both of those requests.

I've not seen ICEcoder scroll slowly when a file has many lines tho. Have been testing with a file that's 10,000 lines long, 315k bytes (takes probably 0.75 secs, on a fairly average laptop - same as on a small file). What size files do you have, more than 10,000 and say 1mb?

Even so, requests definitely worth doing. I'm adding a checkbox so it doesn't jump to next find result on typing into find box (it still gives you realtime results counts), and a "range" input from 1 to 20 (1 = instant, 20 = slow and default set to what it is right now, 5). That means people can not just turn it off (by setting to 1, but tweak it a little slower or faster if they wish).

Screenshot from 2021-04-10 09-59-07

Hope to get this finished by tomorrow.

Thanks for considering it @mattpass and for quickly acting on it. Haven't reached 10,000 lines yet. 7,000+ lines are my greatest so far. Maybe it's my GPU that's unable to handle the redraws since I'm also running a virtual machine web server (not sure if this is the reason tho). As a temporary and dirty fix on my end, in icecoder.js, I edited the setintervals with scrollto to 0 then set the scrollonline to the tgtline which makes it immediately jump to the tgtline instantly. It really helped my searches to be faster. Just thought others might also encounter my problem ๐Ÿ˜… Yeah, the range input is a great idea! So others can determine the scroll speed they want.

It makes sense I guess if you have a VM being used, could be the reason it takes longer than 0.75secs to scroll.

Commits pushed to provide these 2 feature requests now, pull latest commits latest to see them. Setting the scroll speed range to "instant" does have pretty much the same effect as your dirty fix - a single interval step rather than multiple.

If all seems fine to you re these 2 options please feel free to close issue. ๐Ÿ‘๐Ÿผ

@mattpass settings work great! I just noticed something tho. Not sure if this is by design or a bug. When you use the find next keyboard shortcut, it quickly displays "Highlighted result X of X results" then in a split second, revert back to "X results". But if you use the >> button, "Highlighted result X of X results" message stays.

Changing codes inside block if (false === selectNext) of findReplace (icecoder.js) to:
if (this.findResult - 1 > 0) {
results.innerHTML = "Highlighted result " + (this.findResult - 1) + " of " + this.results.length + " results";
} else {
results.innerHTML = this.results.length + " results";
}

seems to work for me?

@raymondsalas your fix did work fine, but I discovered the "find" action was actually happening 3 times on pressing CTRL+F (when you have CTRL + F key down, on releasing the F key and CTRL key). So I've spent a little time to rejig some key handling to stop that happening and also fix the flashing results messaging you mentioned.

Will close this issue, please reopen if something still not right, but should be fixed now.