I like this idea very much, it saves me from recording a macro that applies a change and does :cnfile and repeating it multiple times.
There's also qargs [1] which adds the command `:Qargs` to populate the arglist with the quickfix list. Afterwards you can use `:argdo` to emulate `:cdo`.
+1 for the patch
First thing I tried was populating the quickfix list using :Ggrep (a wrapper for git-grep supplied by the fugitive.vim plugin). Then I made a change to every line in the quickfix list:
:cdo normal A -- it works!
Then I updated each of the files listed in the quickfix list:
:cfdo update
Both commands worked as expected.
I did notice one oddity: after running :cdo, the syntax highlighting is disabled for each file listed in the quickfix list with the exception of the last file, which has syntax highlighting enabled. The documentation says that disabling syntax highlighting gives a performance boost, which is good to know. My guess is that syntax highlighting is supposed to be re-enabled after running :cdo, but there's some bug that causes it to be re-enabled only for the last file in the list. I have observed similar behaviour when using the :argdo command, so perhaps this bug (if it is a bug) is out of scope for this particular patch.
These are my initial observations. I'll keep on using my build with the cdo.diff patch and report back with any further findings.
Thanks,
Drew
I ported the patch to Neovim [1], where CI discovered that it causes test10 to fail. I tested against Vim 7.4.764, and test10 fails there as well (see [2]).
Cheers,
Florian
[1] https://github.com/neovim/neovim/pull/2927
[2] https://travis-ci.org/fwalch/vim-ci/builds/68879635
2015-7-25(Sat) 2:50:00 UTC+9 yega...@gmail.com:
I confirmed this patch.
I found unexpected behaviors.
Case#1
How to reproduce:
1. cd to vim src dir.
$ cd (Vim clone dir)/vim/src
2. Start Vim. (including this patch version Vim)
$ vim -N -u NONE
3. Grep word "cmdidx" from source and header using vimgrep.
:vimgrep "\<cmdidx\>" **/*.[ch]
4. Open quickfix window.
:copen
5. Do :cdo command. (Intentionally forget the '| update')
:cdo s/\<cmdidx\>/ex_&/g
Expect behavior:
- E37 occurs once.
Actual behavior:
- E37 occurs continuously.
--------
Case#2
How to reproduce:
1~4. (Same abobe.)
5. Do :cdo command. (Intentionally forget the ":w\<CR>")
:exec "cdo norm!iex_\<Esc>"
Expect behavior:
- E37 occurs once.
Actual behavior:
- E37 occurs continuously.
And, When press Ctrl-C after the '-- More --' display, buffer.c was modified unexpectedly.
[original buffer.c:4901]
if (eap->cmdidx == CMD_unhide || eap->cmdidx == CMD_sunhide)
[modified buffer.c:4901]
if (eap->exexexexexexexexexexexexexexexexexexexexexexexex___________________
_____cmdidx == CMD_unhide || eap->cmdidx == CMD_sunhide)
--------
This is my opnion.
When the search pattern exists more in a row, I think :cdo/:ldo confuse to use.
and the processing time tends to be long.
Thanks.
--
Best regards,
Hirohito Higashi (a.k.a h_east)
2015-7-25(Sat) 12:27:56 UTC+9 yega...@gmail.com:
> Hi Hirohito,
>
> On Fri, Jul 24, 2015 at 3:42 PM, h_east wrote:
> > Hi Yegappan, Bram and List
> >
> >> >> >
> >> >> > Thanks for testing the patch. I will send out an updated patch in a few days.
> >> >> > Hopefully this time it will get included. This has been outstanding for more
> >> >> > than two years.
> >> >> >
> >> >>
> >> >> The updated patch (against vim 7.4.796) is attached.
> >> >
> >> > Thanks. So now it's ready to include, right?
> >> >
> >>
> >> Yes. Of course :-)
> >
> > I confirmed this patch.
> >
> > I found unexpected behaviors.
> >
>
> Thanks for testing the patch and sending the bug report. I am attaching
> an updated patch that fixes the two problems. Let me know if you see any
> issues with this attached patch.
I confirmed that reported problem have been fixed.
Thank you for quickly fixes.
I think it is better to discuss.
> > This is my opnion.
> > When the search pattern exists more in a row, I think :cdo/:ldo confuse to use.
> > and the processing time tends to be long.
Do you understand that the results of the following two commands are different, When the search pattern exists more in a row?
(1) :cdo s/\<cmdidx\>/ex_&/g | update
(2) :exec "cdo norm!iex_\<Esc>:w\<CR>"
The (1) is processed all search pattern.
But, The (2) is processed first search pattern in a row.
':cdo' is not necessary, When use only :substitute.
When we use the ':cfdo' command such as ':cdo', Speed is also faster.
:cfdo %s/\<cmdidx\>/ex_&/g | update
So I propose to including patch only ':cfdo' and ':lfdo'.
How do you think?
--
Best regards,
Hirohito Higashi (a.k.a h_east)
>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/dfyt-G6SMec/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php