Thursday, September 20, 2012

Re: Yellow box at the end of each line

On Thursday, September 20, 2012 12:00:47 PM UTC-5, Ben Fritz wrote:
> As for the ^M characters getting inserted, I don't know what would cause that. I wonder if maybe the same vim.command in python is having problems with the hex values in the replacement string. I THINK that command is basically causing Vim to do s/$/^M^M/ which SHOULD work, but it's better written as s/$/\r\r/ which would not have any literal byte values in it. I don't know python, but I imagine this would accomplish the latter:
>
> vim.command('s/$/\\r\\r/') # insert two lines
>
> Then you can turn off highlight after the new command:
>
> vim.command('nohls') # suppress search highlight
>

I did try sourcing this file in Windows gvim 7.3.661:

python << EOF
import vim
vim.command('s/$/\x0D\x0D/')
EOF


I did NOT get any ^M characters inserted into my text, but I DID get search highlight turned on. So possibly the only change needed is the 'nohls' command, or even better a save/restore of the last search.

--
You received this message from the "vim_use" 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

No comments:

Post a Comment