lightspeed.nvim
lightspeed.nvim copied to clipboard
Limit f/F/t/T scope to current line for macros and `:normal`
This should definitely be an option at least, even for 2-character search maybe. I wonder what would be the best solution interface-wise. Should we add an opts flag, something like limit_scope_to_current_line_for_macros? Or a prefix key that switches off multiline search on demand? Any ideas/preferences?
Also, is there any hack out there that makes it possible to detect whether we are currently executing a normal command, and not actually typing it live (like we can check macro playback with reg_executing)?
So let me get this straight, you want to limit the scope (if enabled) of f/F/t/T only when recording macros? Because if so, that sounds very inconsistent. Some keys working differently sometimes. To me that just sounds confusing and something I would neither expect nor want.
A global switch to limit it to the current line all the time tho sounds like something I'd use. So just the cool highlighting of letters, although I would ideally prefer a separate plugin for that in order to provide minimalism and modularity.
I would pref an option over a prefix. I find prefixes a bit awkward because they're another key combo to remember and maybe avoid conflicts.
I also generally want my macros to be pessimistic, they can easily over step their intentions.
Fantastic plugin. Really top tier.
I would pref an option over a prefix.
Yeah, me too.
I also generally want my macros to be pessimistic, they can easily over step their intentions.
What do you mean?
Fantastic plugin. Really top tier.
What do you mean?
Obviously, the cleanest solution is exposing a limit_ft_scope_to_current_line option (that would take effect unconditionally). I also agree with @B4rc1 that keys behaving differently in different contexts is confusing, and might not be desirable even as an option.
But I'm still curious, having the aforementioned option exposed, if one would like to have this feature, how could we trigger it only for macro recording/execution? (And the same question goes for :normal.) (This new PR probably addresses the "recording" part for macros.)
If we'd have a workaround that we can put into the readme or the wiki, I would add this option right now... But otherwise, a different API might make that much easier, so I'm a bit hesitant to do it.