Gary Johnson wrote:
> When I type 0 (zero) followed by Ctrl-D on a line that's indented by
> more than one 'shiftwidth', I expect all the indentation of the
> current line to be deleted and the 0 deleted, as described in ":help
> i_0_CTRL-D". However, if a CursorHoldI autocommand is defined and
> 'updatetime' elapses between the typing of the 0 and the typing of
> the Ctrl-D, then the current line is shifted only one 'shiftwidth'
> to the left and the 0 is not deleted.
>
> ":help CursorHoldI" says it behaves "Just like CursorHold, but in
> Insert mode." ":help CursorHold" says "It is not triggered when
> waiting for a command argument to be typed, or a movement after an
> operator."
>
> I think Vim is treating the 0 as an ordinary inserted character and
> not as a pending operation and is letting the CursorHoldI command be
> processed instead of waiting to see what follows the 0.
>
> I think this is a bug.
>
> I am running Vim 7.4.640 in an xterm on a Fedora 17 system.
> 'updatetime' is set to 500. Here is my CursorHoldI autocommand.
>
> " Highlight the line having the 'a' mark. This is to help understand and
> " debug the Align plugin.
> "
> autocmd CursorHoldI,CursorHold *
> \ let b:aline_new = line("'a")
> \ | if !exists("b:aline_old") || b:aline_new != b:aline_old
> \ | if exists("b:amatch_id")
> \ | call matchdelete(b:amatch_id)
> \ | unlet b:amatch_id
> \ | endif
> \ | if b:aline_new != 0
> \ | let b:amatch_id = matchadd("CursorLine",
> "\\%".b:aline_new."l.*", 1)
> \ | endif
> \ | let b:aline_old = b:aline_new
> \ | endif
I'll add this in the todo list.
Using 0 CTRL-D is a bit weird, a leftover from old times. Since we
don't know if CTRL-D is going to be typed or not we can't avoid
triggering CursorHoldI. Perhaps there is a solution anyway.
--
[clop clop]
GUARD #1: Halt! Who goes there?
ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle of
Camelot. King of the Britons, defeator of the Saxons, sovereign of
all England!
GUARD #1: Pull the other one!
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.