calebmeyer / vim-mode-plus-macros

Adds macros for vim mode plus
12 stars 2 forks source link

Macro doesnt stop at failed actions like failed search #4

Open CyberMango opened 6 years ago

CyberMango commented 6 years ago

situation: you have a macro that searches for bar and replaces it with foo. basically clicks: /barcefoo you use it on a file that doesnt have the word foo in it.

Expected (pure-vim behavior): the macro stops after the seach fails.

Current behavior: the macro fails the search but continues till its end (clicks cefoo)

A failed search in atom does this small fail sound, so i assume some event is triggered, so i guess this is possible to implement.

calebmeyer commented 6 years ago

Search is a hard problem. I'm working on it in the fix-search branch, but it's not easy to capture the characters you're typing while searching. I'll keep this issue up to date with what I find out.

calebmeyer commented 6 years ago

Okay, I've looked into this some more. It appears that the search command is returning a Promise, but it always gets resolved, and always with the value [undefined] (an array containing a single element, undefined).

I'm not sure of a non-hacky way to do this, at this point. @t9md might know of a better solution, or at least what would need to be done to support this.