0

I'm trying to debug eskk.vim. It has a asym_filter function. The function is invoked on each keypress when in a certain mode. The mode is entered by pressing C-j in Insert mode.

So, I set a breakpoint at the beginning (:breakadd here), enter Insert mode (a), press C-j, the debugger appears, I press c<Enter>, then I'm back in my buffer. From this point on no matter what I do, it doesn't stop at the breakpoint. Although I know it's set, and that that function gets executed. Am I missing something? Is the function in any way special?

UPD I noticed that it stops at a different place:

where I set a breakpoint (line 2051) -> where it stops (line 2167)
set (line 2078) -> stops (line 2167)
line 382 -> line 489
expectations (line 408) -> real life (line 489)

But still not sure if it stops more than once. I've gathered that info by restarting vim. nvim to be precise.

5
  • If the debugger appears, you may be running the « continue » command, which could affect what you’re seeing. – D. Ben Knoble Jul 29 '20 at 18:37
  • @D.BenKnoble I understand that it doesn't redraw the screen while I'm stepping through code. But after I run c, the script finishes, and the screen redraws. More importantly, I've just found out that for some reason it stops at a different place, see the updated question. – x-yuri Jul 29 '20 at 19:05
  • Continue restarts execution and doesn't stop until another breakpoint is hit or execution ends. I don't see any mention of next or step. Have you used those? They both run one command before returning to the debugger. (The difference is the former steps over function calls and the latter steps into them). Might be easier to get your bearings versus continue. – B Layer Jul 29 '20 at 22:49
  • @BLayer First, it stops at different places, as you can see from my question. That might be the reason it stops only once. Second, I didn't use next or step then, because I just wanted to confirm that it works as expected, stops after every keystroke. – x-yuri Jul 30 '20 at 0:36
  • @x-yuri The page was opened before the part beginning with "UPD" (update?) and didn't auto-refresh for some reason, i.e. I was missing some data points. Either way, it's just a suggestion. – B Layer Jul 30 '20 at 5:24
0

I haven't found the explanation, but I have a workaround. tpope's scriptease plugin has a Breakadd here analogue, which works as expected. But before that you've got to :Runtime %. The reason is explained here.

Which makes me think that vim failing to set breakpoints properly has something to do with the script being supposed to be autoloaded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.