-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
fix: correct logic for switching alt delimiters #536
base: master
Are you sure you want to change the base?
Conversation
carlostobon
commented
Aug 22, 2024
- Fixed a problem where toggling delimiters was not working due to copy statement.
- Confirmed that toggling works correctly across different buffers.
- Fixed a problem where toggling delimiters was not working due to copy statement. - Confirmed that toggling works correctly across different buffers.
This is a direct revert of fea637c from #531 by @svalaskevicius. There must me something one or both of you are not testing because it can't be right both ways. What versions of VIM are you using to test with? |
Yeah it's essentially a revert of. Running archlinux with binary from the pkg manager and current version VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Aug 11 2024 20:40:17). Im probably doing something wrong but certainly that line is causing the bug. |
It looks like a pretty safe bet that @svalaskevicius is running NeoVIM based on his dotfiles: https://github.com/svalaskevicius/dotfiles/blob/master/.config/nvim/conf/plugins.vim#L25 That might have something to do with why you're coming to opposite conclusions. I don't think we should just revert either way or even just gate it on VIM vs. NeoVIM, there is probably an actually right way to do this that works properly in both environments. That's what we should go for. |
Completely agree with you. Thanks for your time. |
(Personally I'd prefer to keep this open to track the known problem until we find a fix, the "closed" label doesn't encourage participation or responses which we kind of need here to sort this out.) |
Sounds perfect! |
Confirming commit 3f860f2 breaks alternate delims in the latest Neovim nightly as of writing, however it is working fine in Vim 9.1. I agree with @alerque, as this is a Vim library, it may not be appropriate to revert the change due to behaviour in Neovim, albeit a nuisance. I'll try find some time to investigate a solution for #531 that works for both Vim and Neovim. |
I am incorrect, it looks like 3f860f2 breaks alternate delims in Vim too. Just re-tested on Vim 9.1.650 with react typescript, minimal config for reproduction below: nmap <leader>/ <Plug>NERDCommenterToggle
vmap <leader>/ <Plug>NERDCommenterToggle
let g:NERDSpaceDelims = 1
let g:NERDDefaultAlign = 'left'
let g:NERDCommentEmptyLines = 1
let g:NERDCustomDelimiters = {
\ 'typescript': { 'left': '//', 'leftAlt': '/**', 'rightAlt': '*/' },
\ 'typescriptreact': { 'left': '//', 'leftAlt': '{/*', 'rightAlt': '*/}' },
\ 'javascript': { 'left': '//', 'leftAlt': '{/*', 'rightAlt': '*/}' },
\ 'kotlin': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }
\ } Reverting 3f860f2 fixes the issue, this commit should be merged. |
+1 on merging this PR, the toggling of alternative delimiters stopped working for me as well. Would be really nice to have this fix ASAP :) |
I like my comments in C/C++ to be This gets a +1 to merge from me. I'm running Vim 8.0.1763 on Linux. |