Skip to content
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

Bug: undo after ClangFormat does undo twice, erasing previous changes #98

Open
aravind2612krishna opened this issue Apr 14, 2020 · 9 comments

Comments

@aravind2612krishna
Copy link

Neovim, windows.
To reproduce :
In the simple file below, try changing Hello to something else, then selecting the lines and doing a clang format.
Then, doing an Undo undoes the Hello change as well.
clangformatbug

@Kypert
Copy link

Kypert commented Apr 16, 2020

I think I have a local fix for this, can prepare a PR tomorrow. Would it be possible for you to try it out?

@aravind2612krishna
Copy link
Author

Least I can do. Thanks

@Kypert
Copy link

Kypert commented Apr 17, 2020 via email

Kypert added a commit to Kypert/vim-clang-format that referenced this issue Apr 18, 2020
Kind of hard to follow the history of this, but currently (NVIM
v0.5.0-427-g1f56f9a4b) it seems like this undojoin makes some unexpected
behaviour for the user. Unable to tell what-else is unlocked by
removing it, so let's try without it for a while.
@Kypert
Copy link

Kypert commented Apr 18, 2020

@aravind2612krishna, while I still have issues in the test, it works for my normal vim/nvim instance. At your convenience, it would be valuable it you could try it out and see if the fix is also valid in your setup.

Kypert added a commit to Kypert/vim-clang-format that referenced this issue Apr 18, 2020
Kind of hard to follow the history of this, but currently (NVIM
v0.5.0-427-g1f56f9a4b) it seems like this undojoin makes some unexpected
behaviour for the user. Unable to tell what-else is unlocked by
removing it, so let's try without it for a while.
@aravind2612krishna
Copy link
Author

I tried with the plugin from 'Kypert/vim-clang-format', but similar behavior persists.

@Kypert
Copy link

Kypert commented Apr 20, 2020

Interesting, just to make sure, did you use the fix branch:

Plug 'Kypert/vim-clang-format', { 'branch' : 'fix/issues/98' }

@aravind2612krishna
Copy link
Author

Apologies. It does work in that branch, I just tried.

@guyben13
Copy link

guyben13 commented Jul 3, 2020

Do you know why the undojoin is there?

benls pushed a commit to benls/vim-clang-format that referenced this issue Feb 28, 2021
Kind of hard to follow the history of this, but currently (NVIM
v0.5.0-427-g1f56f9a4b) it seems like this undojoin makes some unexpected
behaviour for the user. Unable to tell what-else is unlocked by
removing it, so let's try without it for a while.
xi-lef added a commit to xi-lef/vim-clang-format that referenced this issue Mar 3, 2022
@csmartdalton
Copy link

Can this PR be accepted? I have this same issue with undos

bejado pushed a commit to bejado/vim-clang-format that referenced this issue Apr 17, 2024
Kind of hard to follow the history of this, but currently (NVIM
v0.5.0-427-g1f56f9a4b) it seems like this undojoin makes some unexpected
behaviour for the user. Unable to tell what-else is unlocked by
removing it, so let's try without it for a while.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants