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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not move right when char is not valid for rule #357
Conversation
tests/nvim-autopairs_spec.lua
Outdated
end, | ||
key = [[(]], | ||
before = [[$|$]], | ||
after = [[$(|)$]] |
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.
This test does not pass, the (
does not pair but I don't understand why..
Adding some debugs, it seems the can_pair
call of (
returns false
in this case, but looking at the code I don't understand why 馃
@windwp any insight?
Fail || autopairs test do not move right on non-end-pair char
./tests/test_utils.lua:67:
text error: do not move right on non-end-pair char
Expected objects to be the same.
Passed in:
(string) '$($'
Expected:
(string) '$()$'
stack traceback:
./tests/test_utils.lua:67: in function 'compare_text'
./tests/test_utils.lua:156: in function <./tests/test_utils.lua:95>
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.
$
is include on default value ignored_next_char
so that test case will not work.
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.
That finally explains it, thanks! I used another symbol for that test.
0f3e6bd
to
37383a1
Compare
37383a1
to
8cda6c0
Compare
I rebased this PR for a clean merge if you want. |
Ok thanks 馃憤 |
The issue was that when checking if we should move right, the current char was never checked to be valid for the current rule.
Fixes #331
I didn't manage to run the tests locally, this is why I made many commits & used the CI to test 馃憖
Only 1 test is failing, and I don't understand why, see the comment below