-
Notifications
You must be signed in to change notification settings - Fork 1.2k
micro: Handle +/text search text from args #3767
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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.
I think NewBufferFromFileWithCommand
is a weird API to have because it's coupled to how the CLI works. It also requires changing all the call sites. Do you think it would be feasible to keep NewBufferFromFileAtLoc
/NewBuffer
as-is and handle moving the cursor to a match separately?
That's possible, but it's not that different from the current API as a whole, it would be equivalent to simply adding searchText parameter (as start location was only used for CLI already) And if I split open & match i'd be weird to handle the save cursor option and furthermore the onBufferOpen would run before finding matches, and now you'd have start position (either from +lin:col for filename), onBufferOpen and then match, it would be very confusing to me... Feel free to propose something, but this seemed the "sanest" model to implement to me |
That was my first though too, but after a closer look, it looks like quite a sane generalization of
Potentially we might use this concept of "command" not just in the CLI but also in some other cases at runtime, like it is used in vim (and vi, ed, sed...). |
d850c9a
to
71aa1ec
Compare
This is a feature found in vim and commonly used by Linux kernel test robots to give context about warnings and/or failures. e.g. vim +/imem_size +623 drivers/net/ipa/ipa_mem.c The order in which the commands appear in the args determines in which order the "goto line:column" and search will be executed.
71aa1ec
to
6c4fdf7
Compare
This is a feature found in vim and commonly used
by Linux kernel test robots to give context about
warnings and/or failures.
e.g. vim +/imem_size +623 drivers/net/ipa/ipa_mem.c
The order in which the commands appear in the args
determines the order in which the "goto line:column"
and search text will be executed.