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 with open parenthesis #32

Open
kevinlawler opened this issue Jun 24, 2022 · 2 comments
Open

Bug with open parenthesis #32

kevinlawler opened this issue Jun 24, 2022 · 2 comments

Comments

@kevinlawler
Copy link
Contributor

kevinlawler commented Jun 24, 2022

Given a string (true with the cursor over the ( using swapit to increment yields the bugged falsetrue instead of the expected value, which I suppose is (false to match the behavior of (0 and (1.

keywords: parentheses

@kevinlawler kevinlawler changed the title Bug with open parentheses Bug with open parenthesis Jun 24, 2022
@mjbrownie
Copy link
Owner

mjbrownie commented Jun 30, 2022

@kevinlawler Thank's. It's happening here. Fixing the behavior seems like a simple nudge if the characters are off.. but there might be side effects. seems to be ok for mid word (eg fal|se ) .

plugin/swapit.vim:336 - 350 web

            else

                "if the letter the cursor is not the first letter of the cur_word,
                " move forward to the start of the word. (see #32)
                if getline(".")[col(".") -1] != a:cur_word[0]
                    exec 'norm f' . a:cur_word[0]
                endif

                if next_word =~ '\W'
                    let in_visual = 1
                    exec 'norm! m' . temp_mark . 'viw""pg`[vg`]' . (&selection ==# 'exclusive' ? 'l' : '')
                else
                    exec 'norm! m' . temp_mark . 'viw""pg`' . temp_mark
                endif
            endif

@kevinlawler
Copy link
Contributor Author

seems fixed for me

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

2 participants