-
Notifications
You must be signed in to change notification settings - Fork 249
Add short highlight when text is yanked #653
Conversation
|
I love this. Personally I'd like the highlight to be briefer. Might be worth making it a configurable setting? That would also offer and obvious way to turn it off.
Also I notice that highlighting multiple-line selections can look weird: If there's a way to make all of these boxes, so it's clear exactly what got yanked, I think this feature would be phenomenal. |
|
Also, I have a similar testing issue in #723. (Well, I'm switching tabs so our tests are different, but being unable to figure out how to write UI tests is the same.) Hoping @maxbrunsfeld has some time to offer a hint or two on the right way to do it. |
|
@t9md did you mention on slack that you were having similar issues with quick-highlight? Any chance this is an an easy fix? |
|
@bronson This is not same issue I talked on slack. |
|
My package clip-history do similar decoration to highlight pasted area. See gif anime of clip-history to check how its like. |
|
I myself dont want to include these type of fancy feature to vim-mode core. |
|
@t9md: That seems like a good idea. I always found it really handy in Sublime Text's vim mode. |
|
@t9md I had the same thought as you when I first looked at this patch. I only merged it just to be complete. I sure didn't want it. ... but I've grown to really like it. Maybe I'm losing my edge. For example, I immediately see that I should have typed In general, I agree that vim-mode should only include core vim stuff. But this is 3 lines of code... As long as it's turned off by default, I like the idea of including it. A hook would be much better of course. |
|
I removed this patch from vim-mode-next... A hook is the right way to do this. |
|
I like this kind of immediate feedback decoration( I always try to implement this user assisting decoration in my packages).
So I think we should open new Issue to discuss what type of hook(or event) is required. |
|
And, to completely hijack this PR, I hope whoever investigates adding highlight hooks keeps #432 (highlighting find-previous and find-next jumps) in mind too. |
|
I like this feature too, and I'd be ok with adding it similarly to how it's currently implemented (as opposed to adding some kind of hook) but just without the css change. That way, users and theme authors could customize the look of the highlight just by tweaking CSS. We should also make the hard-coded timeout short so that the duration can be customized via css transitions. There is some code in Atom core for doing things like this, but it is not yet documented. It's called 'flashing' a decoration. See this code in If anyone is interested in taking this further, I would suggest trying this: for selection in @editor.getSelections()
selection.setBufferRange(selection.getBufferRange(), flash: true)You could also try flashing a custom decoration: marker = @editor.markBufferRange(range)
decoration = @editor.decorateMarker(marker, type: 'highlight', class: 'yank-highlight')
decoration.flash('yank-flash', 50)Then maybe tweaking the CSS to get the flash looking nice. |
Experimentally implemented for Yank, ToggleCase, Camelize, Dasherize, UnderScore, ..
|
As stated in the README, this package is no longer maintained and is deprecated. We recommend that people use the vim-mode-plus package instead. Because of this, we are archiving this repository and closing all issues and pull requests. Thanks very much for your support and contributions! |

When text gets yanked, a short highlight appears as a small visual aid. Inspired by the Vintageous package from Sublime Text.
The only problem is that I could not figure out how to write specs for this feature. The specs in this example repo all seem to be using the Atom WorkspaceView, but the operators-spec.coffee seems to be using another way to initialise the editor. I also got quite some deprecation warnings while running the package specs.
So this feature should work, but there are no specs yet.