madskristensen / Tweakster

A Visual Studio extension
Apache License 2.0
241 stars 23 forks source link

Feature Request: Don't copy line when there is no selection #5

Closed ghost closed 4 years ago

ghost commented 4 years ago

The option to not copy the current line if there is no selection is incorrectly described as only blocking the copying of empty lines. That would describe the option VS already has. This error is in all descriptions of the feature I found (Github readme, extension gallery, settings page).

The implementation itself is what we requested in the developer community ticket, a big thank you for that!

madskristensen commented 4 years ago

I'm not sure I follow. The description says

When the caret is placed on an empty line and you hit Copy or Ctrl+C then the empty lines isn't copied to the clipboard like it normally would.

It is only blocking empty lines from being copied with there is no selection. If the line has content, that content is copied to the clipboard.

ghost commented 4 years ago

Sorry, I made a double mistake: When I tested your extension I hadn't correctly deactivated a different extension that blocks copying without selection. And when I looked at your code I got the logic wrong and thought the command would be cancelled if view.Selection.IsEmpty == true.

So I have to correct the point of this ticket: The descriptions are accurate, but the functionality is not what was requested in the DevCommunity topic where you advertised this extension. What you implemented is in fact already present in-box under editor -> (insert language) -> general (modulo me guessing the english category names).

madskristensen commented 4 years ago

D'oh! You're right. I need to add that exact behavior. I missed that somehow

ghost commented 4 years ago

Thanks, almost perfect, it's just that post 1 applies now: The description of the feature in readme.md and on the extension gallery talks about empty lines instead of empty selections ;-)

madskristensen commented 4 years ago

It should talk about both under two separate headlines. See this: Don't copy empty lines and Don't copy when there's no selection

ghost commented 4 years ago

And under Don't copy when there's no selection it says "When the caret is placed on an empty line and you hit Copy or Ctrl+C then the empty lines isn't copied to the clipboard like it normally would."

madskristensen commented 4 years ago

Wow, I don't know how I missed that. Thanks again!