четверг, 6 сентября 2012 г., 4:13:50 UTC+4 пользователь David Barnett написал:
> I noticed that if Vim is in Hit-enter mode when a command gets run in the
> background via vim.command(), vim officially stays in Hit-enter mode
> ("vim.eval('mode()')" continues to return 'r'), but the Hit-enter display
> disappears. A similar problem occurs if you're using the "list" wildmode when
> vim.command() runs. Saw this in vim 7.3.429.
>
> This causes a bug in the abominade IDE
> (http://code.google.com/p/abominade/issues/detail?id=18). Is there any
> workaround?
I don't know a workaround, but you have invalid uses there in a number of
places:
1. In open_file, save_as_current_buffer, close_buffer
path = path.replace(' ', r'\ ').replace('"', r'\"')
vim.command('silent confirm e %s' % path)
read about fnameescape. First line does not do all required replaces.
2. In insert_at_cursor, append_at_cursor, insert_at_linestart,
append_at_lineend, goto_line, cut_current_word, replace_current_word,
select_current_word, copy, cut, paste:
vim.command("normal i%s" % text)
. Use "normal!" and care about control characters (if it is
insert*/append*). In insert*/append* it is faster to use "vim.current.buffer"
(though less convenient).
3. In echo:
vim.command('echo "%s"' % s)
does not care about <<">> and "\" inside strings. Depending on the kind of
messages you can use just "print s" or escaping.
4. In get_cwd: just use "os.getcwd()".
5. In cd: use "os.chdir()".
6. You forgot "augroup END" and have a bunch of useless "silent" and
"VimCommsDBus" strings (after "augroup" all events by default go to the new
group. It is "define group if it does not exist" + "make this group default",
not just the first).
^ is for data/a8.vim file.
--
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