On 27-Jul-07 12:27, [EMAIL PROTECTED] wrote:
> Hello, vim developers!
>
> I've just discovered a weird thing with the version 7.1.33. I have the
> following line in a text:
>
> unsigned char key[] = { 06a9214036b8a15b512e03d534120006 };
>
> Then I tried to split that long hexadecimal number into chars, I visually
> selected it (/06ve), executed the command:
>
> :'<,'>s/\(\x\x\)/0x\1, /g
>
> But the substitution touched not only the visual range but the whole line:
>
> unsign0xed, char key[] = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b,
> 0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06, };
>
> What happened? Does this works as intended?
>
> -- Anatoli Sakhnik.
VIM script 'vis.vim'
(http://vim.sourceforge.net/scripts/script.php?script_id=1195) provides
"Extended Visual Mode Commands, Substitutes, and Searches"; with that script,
you would use :B <cmd>, as in
:'<,'>B s/\(\x\x\)/0x\1, /g
to achieve your desired result.
-- regards, ingo
/^-- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ --
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---