-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented paste action #115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Left a few minor comments. Also, you'll prob want to add the new delimiter insertion behaviour that I tacked onto the "move" PR so that you can say eg "paste after arg air" or "paste after line air" and it will do the right thing
const lines = text.trim().split("\n"); | ||
|
||
const getText = | ||
targets.length === lines.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we decided to match VSCode behaviour and check that number of lines is divisible by number of targets and if so split clipboard into blocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what line 37 does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That checks equality, not divisibility, no? What am I missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is how vscode paste work. It only splits the clipboard if they are the same amount/length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! Try it out. Copy 4 lines, then make 2 cursors and paste. It will split up the 4 lines into 2 blocks of 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not on windows at least. I tried it multiple times before I made the implementation and I tried it once again now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha wait really? That's really odd that that would differ on platforms. I'll try it one more time today; maybe I messed something up in my testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Really strange if it differs.
Also, I don't think this code matches vscode's paste behaviour wrt trimming. But maybe let's file that as a follow-up issue. When we add tests for this action we can test that it matches VSCode on various edge cases |
What about the trimming is not correct? There is no trimming when broadcasting the clipboard. You mean that we should remove the trim before split? That is an easy fix. |
…dev#115) * Added identity modifier. Added head tail modifier to csv * Update src/modifiers/identity.py Co-authored-by: Pokey Rule <pokey.rule@gmail.com> * Update src/modifiers/modifiers.py Co-authored-by: Pokey Rule <pokey.rule@gmail.com> * Changed identifier on head tail * Update src/modifiers/identity.py Co-authored-by: Pokey Rule <pokey.rule@gmail.com>
Issue #36