On 2015-03-10, Bram Moolenaar wrote:
> 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.
What is the modern alternative to 0 Ctrl-D then?
Regards,
Gary
--
--
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.