On Jun 23, 10:25 pm, Ben Fritz <[email protected]> wrote:
> On Jun 23, 7:32 am,StarWing<[email protected]> wrote:
>
>
>
> > in a word, can I detect user undo buffer into a diffevent status?
>
> > it must can detect these case:
> > 1. press u
> > 2. press U
> > 3. press :undo<CR>
> > 4. function! My_undo()
> >         " some code...
> >         undo
> >         " some code...
> >     endfunction
> >     and press :call My_undo() or <C-R>=My_undo()<CR> or any other way
> > to call My_undo()
>
> > 5. function My_undo()
> >         " some code...
> >         norm u
> >         " or
> >         norm U
> >         " some code....
> >     endfunction
> >     as above...
>
> I'm pretty sure Vim has no built-in way to detect this. But why do you
> think you need to do this? What are you trying to accomplish? There
> may be a different way to reach your end goal.

I want to complete a snippet plugin. that works like SnipMate. but I
want it act as cca.vim (you can search these two plugin on vim.org).
it means, I want to detect all changes in user buffer. if user did
some thing that changed the snippets, I will drop the current snippet
complete.
e.g.
user input:
for<tab>
and it changes to:
for (i| = 0; i < len; ++i)
{
    /* code here... */
}

| meas cursor. and user press <tab> the cursor jump to "0".
but, if user press <esc>u, i will drop the snippet complete. makes key
<tab> works in a normal way.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to