On Oct 17, 10:07 am, Ben Fritz <[email protected]> wrote:
>
> I can verify this using Vim 7.2.79 (latest from the package manager on
> Ubuntu Jaunty). I'll check in the latest patched version I have on
> Windows sometime later.
>
> The really interesting thing is, if you uncomment the :w but not
> the :q, you can see that the original buffer gets modified as
> expected, but the written file only modifies the first line, as shown.
>
> A slightly more intuitive script does the same:
> 1
> let @c = ':s/\(.*\)/\11/|a^Mhello^M.^M|+|@c'
> @c
> w! new.txt- Hide quoted text -
>
One last iteration to allow copy and paste, used to verify the
behavior in gvim 7.2.264 on MS Windows:
1
let @c = ":s/\\(.*\\)/\\11/|a\<CR>hello\<CR>.\<CR>|+|@c"
@c
w! new.txt
Sourcing this script in gvim -N -u NONE with buffer contents:
a
b
c
d
Results in a buffer:
a1
hello
b1
hello
c1
hello
d1
hello
But results in a file new.txt with contents:
a1
hello
b
c
d
I'm completely stumped. Somehow the :w! command seems to occur before
the recursive call of the @c macro.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---