-
Notifications
You must be signed in to change notification settings - Fork 26
vim: fix highlighting #72
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
Conversation
|
Acknowledging I see your PR! Will take a look tomorrow |
danobi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no vimscript expert (or even beginner), but I tested this and it looks correct. Nice to be able to simplify the region specific logic.
Just one nit.
vim/ftplugin/prr.vim
Outdated
|
|
||
| let b:undo_ftplugin = 'setl fdm&' | ||
| " Adapted from https://github.com/sgeb/vim-diff-fold | ||
| function! DiffFoldLevel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be able to make this script local, right?
| function! DiffFoldLevel() | |
| function! s:DiffFoldLevel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
danobi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I was running into some highlighting issues as shown in this demo.
I was able to fix it by replacing
foldmethod=syntaxwithfoldmethod=exprwhich allowed me to remove thesyn regiondefinitions in the syntax file.The fold function is adapted from vim-diff-fold
I took the liberty to make some
syn matcha bit more restrictive and also changed the highlight groups forprrAddedandprrRemovedto the standard diff groups which feels more natural when going through diffs.Happy to discuss any modifications or improvement.
And thanks for this cool tool 😃