Hi Axel!

On Fr, 01 Apr 2016, Axel Bender wrote:

> Docs
> ----
> "The global commands work by first scanning through the [range] lines and
> marking each line where a match occurs (for a multi-line pattern, only the
> start of the match matters).
> In a second scan the [cmd] is executed for each marked line with its line
> number prepended."
> 
> Fact
> ----
> Andy Wokula:
> The docs lie, the line number is not prepended.

True. How about this patch:

diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index e2c4c2f..01db5a6 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -72,13 +72,12 @@ examples.
 The global commands work by first scanning through the [range] lines and
 marking each line where a match occurs (for a multi-line pattern, only the
 start of the match matters).
-In a second scan the [cmd] is executed for each marked line with its line
-number prepended.  For ":v" and ":g!" the command is executed for each not
-marked line.  If a line is deleted its mark disappears.
-The default for [range] is the whole buffer (1,$).  Use "CTRL-C" to interrupt
-the command.  If an error message is given for a line, the command for that
-line is aborted and the global command continues with the next marked or
-unmarked line.
+In a second scan the [cmd] is executed for each marked line. For ":v" and
+":g!" the command is executed for each not marked line.  If a line is deleted
+its mark disappears. The default for [range] is the whole buffer (1,$).  Use
+"CTRL-C" to interrupt the command.  If an error message is given for a line,
+the command for that line is aborted and the global command continues with the
+next marked or unmarked line.

 To repeat a non-Ex command, you can use the ":normal" command: >
        :g/pat/normal {commands}


> DrChip:
> Perhaps you wanted to use :g/some pattern/.w! >> some_file.txt? 
> 
> Which are true, given that ":g/…/.w…" works.

There is no problem here. :w when given no address, always writes the 
whole buffer.


Best,
Christian
-- 
Die Tatsache, daß ein Gläubiger glücklicher ist als ein Zweifler ist
damit vergleichbar, daß ein Betrunkener glücklicher ist als ein
Nüchterner.
                -- George Bernard Shaw

-- 
-- 
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 the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui