Author Topic: paste-special  (Read 474 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1222
  • Hero Points: 89
  • Text
paste-special
« on: April 20, 2017, 11:11:32 pm »
An option when pasting to convert LINE to CHAR (see my previous post about Line Insert Style).

jporkkahtc

  • Senior Community Member
  • Posts: 1222
  • Hero Points: 89
  • Text
Re: paste-special - Multiple Cursors
« Reply #1 on: April 27, 2017, 06:13:50 pm »
paste-special would also be really useful with multiple cursors.

Currently, if I copy two lines of text, then create two cursors and paste, both lines of text get pasted at both cursors -- pasting a total of 4 lines.

This is rarely what I want.
Instead I should be able to tell Slick to paste one line of text at each cursor - even if the number of lines don't match exactly.

jporkkahtc

  • Senior Community Member
  • Posts: 1222
  • Hero Points: 89
  • Text
Re: paste-special - Block
« Reply #2 on: April 27, 2017, 06:26:42 pm »
Paste-special for a block selection would allow be to paste a block selection as if it was a normal multiline selection.

Currently paste of a block will overlap existing text instead of inserting the right number of lines.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3664
  • Hero Points: 238
Re: paste-special
« Reply #3 on: May 24, 2017, 01:04:34 pm »
I like the paste special concept. Just need to come up with the right features. You've listed some good possibilities. I've definitely had times where I've wanted a block selection pasted as lines. The multiple cursors example is useful. Not sure about how to handle a mismatch between the number of cursors and number of lines in the clipboard. Seems to me they should match.

jporkkahtc

  • Senior Community Member
  • Posts: 1222
  • Hero Points: 89
  • Text
Re: paste-special
« Reply #4 on: May 24, 2017, 10:16:18 pm »
In general, I think pasting with multiple cursors is far too fussy and has very weird behavior in the edge cases.
For example, given this template to paste into:
Something *array =
{
    {"", },
    {"", },
    {"", },
    {"", },
    {"", },
    {"", },
    {"", },
};

Normally what I would do when creating a block of code like that is guess that I need about 5 lines, then I add a few extra just to be sure.
Then, I'd go select the text to paste I will be punished harshly for getting it wrong.
For example, I use a multiple cursors to select text from 3 lines, and paste into 4 lines, I get:
Something *array =
{
    {"activate_bookmarks
activate_exceptions
activate_files_files", },
    {"activate_bookmarks
activate_exceptions
activate_files_files", },
    {"activate_bookmarks
activate_exceptions
activate_files_files", },
    {"activate_bookmarks
activate_exceptions
activate_files_files", },
    {"", },
    {"", },
    {"", },
};


When, what I'd really be happy with is:
Something *array =
{
    {"activate_bookmarks", },
    {"activate_exceptions", },
    {"activate_files_files", },
    {"", },
    {"", },
    {"", },
    {"", },
};


I don't understand the logic of multiplying the paste in these multiple cursor cases -- I've never once found a use for this - its strictly annoying.

Vertical block selection to multiple cursors seems to always be wrong. For example, I copy a 3x20 block, then attempt to paste into 3 cursors, and I get:
Something *array =
{
    {"activate_bookmarks  ", },
    {"activate_bookmarks  activate_exceptions ", },
    {"activate_bookmarks  activate_exceptions activate_files_files", },
    {"activate_exceptions activate_files_files", },
    {"activate_files_files", },
    {"", },
    {"", },
};

This is really bizarre.

Summary
  • vertical block selection to single cursor: Works fine - but PasteSpecial would make it better.
  • vertical block selection to multiple cursors: Weird multiplication results - not useful. IMO, a bug.
  • multiple cursors selection to multiple cursors: Only works correctly when the source and dest have the same number of cursors.
  • multiple cursors selection to vertical block: Pastes the first line of text onto each line of the selection. Seems like it should paste just the same as if the clipboard was a vertical block selection.
  • vertical block selection to vertical block: Works well, except in the case where the source has more lines that the destination. In this case, it would be useful to only paste as many lines of text as there are selected in the destination.




Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3664
  • Hero Points: 238
Re: paste-special
« Reply #5 on: July 16, 2017, 12:35:12 am »
An option when pasting to convert LINE to CHAR (see my previous post about Line Insert Style).

Do you really want to paste a LINE selection as a CHAR selection or do just want the line insert style temporarily changed for a single paste.

jporkkahtc

  • Senior Community Member
  • Posts: 1222
  • Hero Points: 89
  • Text
Re: paste-special
« Reply #6 on: July 16, 2017, 10:03:02 pm »
Well, what do you see as the difference between those two options?
The latter I suppose -- basically to control if the insertion is before or after the current line.
See: https://community.slickedit.com/index.php/topic,15229.0.html

I think "Paste line as char" would fit better in a list of options in a PasteSpecial type of dialog, and would be more flexible I think.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3664
  • Hero Points: 238
Re: paste-special
« Reply #7 on: July 17, 2017, 02:34:01 am »
It does make more sense for a paste special command or dialog.