Philippe Vaucher wrote: > I added TextDelete and TextYank events. > > This necessity appeared because of the small delete register getting > in our way in order to implement a proper killring. There exists a > plugin that tries to address it (YankRing.vim) but then other things > break down, like macros with counts, not to mention the plugin is > heavy. > > This issue was raised on irc by the-isz and myself after we realised > we couldn't have a nice flow about editing some file like this: > > delete a word (dw), remove some trailing spaces (xxx), go to end of > line ($), paste word (arg, dw didn't put word in registers 1-9, need > to undo, put word in explicit register, etc) > > With this patch, we can now make a very simple "YankRing" plugin which > only stores Yanked/Deleted texts by listening on those events, without > interfering with all the vim commands like the original YankRing > plugin does. > > You can test it with: > > autocmd TextDeleted * echom 'Deleted: ' . @" > autocmd TextYanked * echom 'Yanked: ' . @" > > Tell me what you think.
I think they should be called TextDeletePost and TextYankPost to be consistent. Try doing something weird in the autocommand, such as "help" and then deleting something. You probably need to disallow lots of things to avoid breaking stuff (and perhaps even crashing Vim). Don't you need to let the commands know what register text was yanked into? -- hundred-and-one symptoms of being an internet addict: 99. The hum of a cooling fan and the click of keys is comforting to you. /// 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
