-
Notifications
You must be signed in to change notification settings - Fork 20
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
Compatibility with folding #28
Comments
Hi! I'm glad you like it and thanks for the report. I need a bit more information, or perhaps a way to reproduce the problem, because that raises questions for me:
|
Hi @whiteinge , thanks for the reply. I have moved away my ~/.vim directory and tried with a clean vim as distributed in Ubuntu 23.04 (2:9.0.1000-4ubuntu3.3). I can reproduce the effect with the following small file
I load the file, set its filetype to C, and then
It looks like vim saw the
It looks like a bug in vim to me, since it is inconsistent in what it sees or doesn't see. |
If `foldmethod=syntax` it somehow affects the contents the deletes will operate on. No idea why. Running `diffthis` will set `foldmethod=diff` so if we do that before making the edits we should avoid the problem. Closes #28
Thanks, those steps are great and I can reproduce it now. Very strange result -- I've never seen folds affect an operation like that. You may be right about it being a bug. Will you give the PR above a try? In my testing it side-steps the bug by overriding any |
yes, it seems to be working |
Thank you for this really useful plugin. However, I am getting confusing results when folding is enabled. I think that the
:g
commands don't look inside the folds, so they may delete unintended lines when the diff markers somehow end up inside a fold. I have solved the issue by addingsilent execute "normal! zR"
andsilent execute "normal! zM"
around the delete commands, but I am no vimscript expert by any means and I guess there should be a better way.The text was updated successfully, but these errors were encountered: