Skip to content

Conversation

KillTheMule
Copy link
Contributor

Attempt to fix #7244.

@glacambre
Copy link
Member

It seems to fix the issue for :s/{\n but unfortunately the following still locks for me:

echo -ne '{\n\n{' | build/bin/nvim -u NORC -c "set inccommand=nosplit | set gdefault" -
:%s/

@KillTheMule
Copy link
Contributor Author

Yeah, you're right, thanks for testing. I can reproduce, but things look a bit weird... I can actually type :%s/{\n until the lockup occurs. Then, if I press <C-C>, then replace the brackets with the letter a, no lockup occurs. If I then replace the letter a by the letterb, the lockup occurs again, only that I can just type :%s/ until the lockup. Undoing get me no lockup, but going back to the bracket makes it appear again...

Weird stuff! Might be connected to the order in which I'm doing things...

@KillTheMule
Copy link
Contributor Author

KillTheMule commented Sep 8, 2017

How did you come to the conclusion that the lines you added were needed? I took a quick look using gdb and it seems that neovim gets stuck in nfa_regmax (src/nvim/regexp_nfa.c:5027). But I know nothing about the code so I might be very wrong here.

(Note: Got a post notification via email, I can't see your answer here, so I'm quoting it).

When I ran your case through gdb, it was stuck in this loop: https://github.com/KillTheMule/neovim/blob/e72bb7ba6303c7b56e508c99056de66d706d19b4/src/nvim/ex_cmds.c#L3419. This also makes sense because the loop contains a breakcheck, that's why we can interrupt with <C-c>. Then I ran a nonblocking case through the debugger and noticed a different behavior here, which really fit well: Final newline in the match, no second delimiter, and this code isn't run in the "no second delimiter" case, so I just added it and tried, and voila :) I did not fully understand it, in particular wrt gdefault, but wanted to get it out to you to try fast. Too fast, indeed ;)

I'll dive in again tonight or so.

@KillTheMule
Copy link
Contributor Author

Closed in favor of #7231.

@KillTheMule KillTheMule closed this Sep 9, 2017
@jszakmeister jszakmeister removed the WIP label Sep 9, 2017
KillTheMule added a commit to KillTheMule/neovim that referenced this pull request Sep 9, 2017
@KillTheMule KillTheMule deleted the icm-fixlock branch September 10, 2017 07:37
KillTheMule added a commit to KillTheMule/neovim that referenced this pull request Sep 10, 2017
KillTheMule added a commit to KillTheMule/neovim that referenced this pull request Sep 11, 2017
KillTheMule added a commit to KillTheMule/neovim that referenced this pull request Sep 12, 2017
justinmk pushed a commit to justinmk/neovim that referenced this pull request Sep 12, 2017
nateozem pushed a commit to nateozem/neovim that referenced this pull request Oct 5, 2017
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

Successfully merging this pull request may close these issues.

Neovim locks up on substitute when set inccommand=nosplit and set gdefault
4 participants