> 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 -- Br...@Moolenaar.net -- 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 ///
> No because every delete/yank use the " register even if a register was
> explicitely specified. As a matter of completeness maybe it'd be nice
> to know which register was intended yes but it's the first time I
> fiddle with vim's source (with some pain) so I'm not too sure how much
> work is involved in creating one of those v:somevar.
No, you forgot about deleting to black hole register.
Original message:
That should be in the documentation then.
--
hundred-and-one symptoms of being an internet addict:
100. The most exciting sporting events you noticed during summer 1996
was Netscape vs. Microsoft.
> > I think they should be called TextDeletePost and TextYankPost to be
> > consistent.
>
> Ok, I can do that.
>
> > 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).
>
> I'm not sure I want to support the crazy guys, there's probably lots
> of ways to create problems with other events too if that's your goal.
> Anyway, what do you have in mind? The current patch is very simple and
> I kinda like it to be that way, but if there are obvious stuffs I can
> disable/disallow I'll do it.
Using textlock probably works.
The problem is that there will always be people that install an
autocommand (or use a plugin that has this autocommand without them
knowning) and then run into trouble because of unexpected things.
It's better to protect the user from destroying his text.
Crashing Vim is obviously worse.
> > Don't you need to let the commands know what register text was yanked
> > into?
>
> No because every delete/yank use the " register even if a register was
> explicitely specified. As a matter of completeness maybe it'd be nice
> to know which register was intended yes but it's the first time I
> fiddle with vim's source (with some pain) so I'm not too sure how much
> work is involved in creating one of those v:somevar.
OK, we can add it later when really needed.
--
hundred-and-one symptoms of being an internet addict:
101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.
> So, Bram is that ok? Do you want the patch on another medium? Are
> there issues I didn't address?
I need to have a closer look. Bugs usually have a higher priority than
new features.
--
hundred-and-one symptoms of being an internet addict:
131. You challenge authority and society by portnuking people
> Bram: this is just a message to bump this issue, to avoid that you
> forget about it.
It's in the todo list. That list is very long, and bug fixes have
priority. Might take a while.
--
hundred-and-one symptoms of being an internet addict:
271. You collect hilarious signatures from all 250 mailing lists you
are subscribed to.
How long is that list? It's been more than 6 months now :/
Philippe
:help todo
Regards,
J�rgen
--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)
Excerpt from J�rgen Kr�mer:
-- <snip> --
>>> It's in the todo list. That list is very long, and bug fixes have
>>> priority. Might take a while.
>>
>> How long is that list? It's been more than 6 months now :/
>
> :help todo
Which might be out of date. The latest version is always available at:
https://vim.googlecode.com/hg/runtime/doc/todo.txt
> Regards,
> J�rgen
>
--
Regards,
Thilo
4096R/0xC70B1A8F
721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F
Thanks.
Philippe
Do you maybe have a yankring-like plugin that makes use of the feature?
That could help people try it out in real-world scenarios.
Jan
--
-[ OpenPGP key ID: 00A0FD5F ]-
Technological progress has merely provided us with more efficient means for
going backwards.
-- Aldous Huxley
Yes there is, see https://github.com/the-isz/MinYankRing.vim/tree/events
Philippe
I don't se the patch # to put a conditional check in for it.
Could someone let me know.
Thanks.
--
David Fishburn
> --
> 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
> I will also add this to the YankRing plugin (script #1234).
>
> I don't se the patch # to put a conditional check in for it.
It hasn't been applied yet, but you shouldn't check by patch # anyway.
exists() can detect whether an autocommand for a particular event is
supported. Use:
exists('##TextDeleted')
and
exists('##TextYanked')
--
Best,
Ben
Perfect thanks Ben.
--
David Fishburn
Bump :)
Philippe
https://github.com/Silex/vim/commit/de53ab72c89affa8ba77536ed8920751c037d127
Honestly, I'm disapointed. It's been a while I don't use vim anymore but I think vim deserves a more reactive development model than the current one.
Bram: I think you clearly need to nominate additional people to apply patches.
...
I don't personally feel the need for one, but I know many people would like a "yank ring" style of plugin or other sort of clipboard management which this patch would enable.