-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Cap highlighter execution time #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(OT: Congratulations on filing a perfect square.) I think you raise two separate issues:
I think a timeout is a good idea. It's also pretty trivial to implement (declare I also have another idea: we already cache the "previous" value of In the workfow This "common prefix" idea would break down if somebody has a zle widget that changes any state z-sy-h cares about (for example, |
Fned doesn't call highlighting because of the disable of vared you once pointed me to? ( |
As for your proposition, it arose to me that a gradual
processing of `$BUFFER` could be implemented? 300 ms after each
keypress (BTW I thought that the earlier 300 ms I gave is rather too
small value as general limit) and extending of region_highlight
– might be interesting for non-vared situations.
I think it would be very annoying to have a 300ms delay after every keypress.
For vared and large functions I think the 300 ms should be used every
e.g. 1 second, so sched had to be used, and complexity and robustness
of all this is difficult to predict.
I don't understand the phrase "sched had to be used".
However I think it would be nice to see how
large function in vared gradually gains color, and that too could be
configurable and disabled via zstyle (I think zstyle is nice to
introduce, "base" config can still be in parameters).
See #362 about zstyles.
|
I mean zsh/sched module. Used it with zsh-morpho, verified to some extend that it's robust (stuff like TRAPALARM can cause lot of mess) |
I mean zsh/sched module. Used it with zsh-morpho, verified to some extend that it's robust (stuff like TRAPALARM can cause lot of mess)
I see. As I said in my last comment, I believe a regular 300ms delay would result in bad UX.
|
How often does this problem occurs? I'm trying to estimate how urgent/important this issue is. |
I couldn't reproduce it, but for sure I saw it happening. Could someone give a report about NFS? If there is a problem then this should be treated as important, it's then like Cygwin – not a main platform, maybe not that common as Linux boxes (let's assume this for a moment), but failing at it wouldn't make ZSYH look good (thanks to m0viefreak's patches I gues that one is solved). |
I tried So, summary so far:
|
I have an additional idea that may help with this discussion. For (1), it's easy for me to reproduce on sshfs where I get the bad UX of keystrokes not appearing until some time after I type them. EDIT: I realize this is not the same as large directories. Apologies if this confuses the point of (1). For (2), instead of a cap on execution time, I recommend an async deferment where processing does not occur until I stop typing. I don't mean to imply 300ms of synchronous wait-for-each-keystroke, but a moving window that prevents highlighting from attempting to process until there's some very short break in typing. This would deal with laggy situations. A more advanced implementation could even automatically tune that delay to match the processing time of the syntax highlighter - if it takes 1ms to run, then you can run it every 1ms. If it takes 200ms, the window should be 200ms. |
A execution time cap would save me right now. Whenever I type I disabled other plugins and customizations and managed to nail it down to this one. The /afs folder is mounted by OpenAFS and is only connected to 3 servers (therefore 3 subfolders, I replaced the default enormous list). It's a slow filesystem/connector/thing and I can't make it any faster no matter how much I fiddle with the options. |
@addobandre Your best bet is probably to patch |
I saw at friend's computer that zsyh caused ~0.8s delay after each key press when PWD was directory with 89000 files IIRC. Tested this on my machine and the lag is like 100 ms, though. However, what about NFS and cases where someone has even more files. I thought about a betterment: use float SECONDS to establish limit (300ms? zstyle?) on how long
region_highlight
should be generated. If the limit isn't kept then clear the table and stop generation of its entries. This would be triggered also for e.g. pasting long and/or sophisticated code.The text was updated successfully, but these errors were encountered: