-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Support diff highlight with original file format syntax scheme #961
Comments
Actually, I tried the approach of applying the syntax line by line in the blame view, but it was incredibly slow and I had to abandon that. |
Have you tried to do it only for the content vissable? I think sublimes has an API for checking the viewport. Or is it slow on small files as well |
It is ok for small files, but it is an O(n) operation. |
And did you look at the option for only doing it for the current virwport? |
No. I am not sure if sublime has an event listener on change of viewport. |
We might be able to get the syntax for the whole file then, by using the "open, get syntax and close quickly" method. To avoid continuous flicker, we can also "cache" the syntax for each opened file, as described here: https://forum.sublimetext.com/t/get-syntax-associated-with-file-extension/26348/11 |
There's also a discussion on a relevant feature request in sublimehq/sublime_text#2312, and a workaround provided by sublime_lib here. |
@randy3k How did you apply the syntax line-by-line? Applying foreground regions token by token? Which tokenizer did you use? |
I used |
Do you still have that branch? Maybe we can hack around it? |
I have discarded that unfortunately. |
This might be dupe, if so I appologize; I saw the discussion being had a number of times, but never as a proper feature request, so here we go.
In Github the diff with highlight is displayed very nicely, and I'd like to have it in sublime.
I know this can be done, but not sure how cleanly the code will remain after. The plugin sublime-compare-side-by-side does this by applying "highlight" to files that have been added to the view with the original/default syntax scheme. I understand that with side-by-side diff it is easier to keep syntax, and in "patch view" case we might need to apply the syntax line by line (by checking the original file's syntax for the row) + apply the diff highlight.
Related tickets, discussions:
#666
8c1313b#r121255619
The text was updated successfully, but these errors were encountered: