On 11/03/11 9:42 AM, John Beckett wrote:
Ben Schmidt wrote:
It's annoying that it should get copied from Firefox at all,
though. I wonder if that's a problem we can address on the
Wiki, as it's going to cause a lot of users really confusing
problems if when they copy+paste code it has a bunch of
invisible things causing errors!
I think we are talking about this tip:
http://vim.wikia.com/wiki/Refresh_Firefox_%28preserving_scroll%29_on_Vim_save,_using_MozRepl
Right.
There is only one character in the wikitext of that tip that is
not printable ASCII, and that is an en dash (not in the "Code
from .vimrc" section).
I don't think the problem is anything to do with the wiki.
I think it's debatable.
The wiki software must be adding it. I wonder why. The source of the
served page shows:
<pre> autocmd BufWriteCmd *.html,*.css,*.gtpl :call Refresh_firefox()
function! Refresh_firefox()
if &modified
write
silent !echo 'vimYo = content.window.pageYOffset;
\ vimXo = content.window.pageXOffset;
\ BrowserReload();
\ content.window.scrollTo(vimXo,vimYo);
\ repl.quit();' |
\ nc localhost 4242 2>&1 > /dev/null
endif
endfunction
</pre>
Notice that normal spaces are used everywhere except where the OP
encountered problems. His version of Firefox copied the non-breaking
space as a non-breaking space, not a regular space, which isn't all that
unexpected. I mean, it's pretty good if a program copies and pastes
what's actually there, isn't it?
When I copy that trailing space I get hex 20 (a space, not a
nonbreaking space).
My version of Firefox does this too, it seems.
Quite possibly nothing we can do, I guess. The is necessary for
trailing spaces when they occur, so they can't really be avoided. Would
just be nice if browsers translated them to spaces consistently on
different platforms, etc..
Ben.
--
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