-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Highlighter highlights all lines inside folded regions #4687
Comments
@annikovk could you please provide a minimal code so we can easier reproduce this issue? Thank you |
The problem is: in case there are thousands of such nodes collapsed, ace editor freezes. |
@andrewnester have you been able to reproduce that? |
@annikovk haven't looked at reproducing it yet, will update once we know the details, but it looks like it should be clear to reproduce |
@annikovk you mentioned
How does unfolding help in this case? These selected word elements are still there, right? |
I am trying to eliminate the freeze. And the freeze happens in case there are thousands of selected words inside the folded region, which is inside visible area of the editor unfolding helps to move selected elements out of visible region, so they are removed from DOM Let me know if it is needed to describe that in more details with screenshots. |
Okay, got it! I’ll try to work on PR for this |
@annikovk could you please check if your issue is solved here? https://raw.githack.com/andrewnester/ace/bug/4687/kitchen-sink.html |
Yes, 100% working as in my dreams. Thank you! |
We just merged the PR and released new 1.5.2 version containing the fix |
I have serveral big folded regions (several thousand lines) stay one after another:
![image](https://user-images.githubusercontent.com/12910542/166903198-43021e16-8793-45a7-ac62-27fe8c968657.png)
Once I search something, highlighter is invoked to highlight all of the found strings: https://github.com/ajaxorg/ace/blob/master/lib/ace/ext/searchbox.js#L266
During the highlighting process, it takes editor's visible rows, and draws single line markers for every found range within visible rows.
So, the problem is the fact that Ace thinks that rows inside folded regions are visible and tries to add markers for all of them:
This causes UI freezes during the search: JetBrains/IntelliJ-Log-Analyzer#11
The only workaround I found is to unfold all regions, which is not acceptable.
The text was updated successfully, but these errors were encountered: