-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Substitute global flag (like Vim's gdefault
)
#1909
Conversation
Seems like there are relevant tests failing? If the tests are too annoying to work properly, I am mostly fine (ehh) with removing the failing tests. The logic is very simple and I'm almost certain it'll work. Also, I just realized know why the tests are failing. The tests are set up to use neovim integration for the Ex-commands. That's another thing to consider about this PR, it'll only affect non-neovim integration users. |
@Chillee - the tests that are failing are actually the very tests that I've added for this feature. To my fault, I did test with the neovim flag set to false. Let me see install neovim and see if I can make it work with true. |
@philipmat Do the tests run fine locally? To be clear:
|
The tests work for I need to find a way to pass this configuration flag to Neovim so that tests with If you see more value in having this flag in right now, I'd be happy to take the offending tests out; however, if it's all the same to you I'd rather have the tests and make them work right. Although, it just occurred to me that due to |
Yeah the testutils part is what I was talking about. Ex mode without neovim integration is in somewhat of a "maintenance" mode, where it's unlikely that we'll add features to it that can be covered by neovim. |
Looks good to me! Could you add a note to the configuration that it only works when not using the neovim integration for Ex-commands? Thanks! |
Ah nice. Looks good to me! |
"vim.substituteGlobalFlag"
gdefault
setting./g
flag in a substitute command replaces all occurrences in the line.Without this argument, replacement occurs only for the first occurrence in each line.
"vim.substituteGlobalFlag"
istrue
, the 'g' is default on.This means that all matches in a line are substituted instead of one.
When a 'g' flag is given to a ":substitute" command, this will toggle the substitution
of all or one match.