This is handy to repeat the command to cut/copy a word. Using the Select Word keybinding first is too awkward.
If this is OK I'll update the docs. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3391
-- Commit Summary --
* Make cut/copy keybinding select word if no selection
-- File Changes --
M src/keybindings.c (19)
-- Patch Links --
https://github.com/geany/geany/pull/3391.patch https://github.com/geany/geany/pull/3391.diff
If the user misses the v and hits the c (side by side on common keyboards) they lose what is in the clipboard, which may be a disaster if they had cut not copied that content. At the very least its a hassle to recover and requires the user remembers exactly what they had in the clipboard.
See #197 especially https://github.com/geany/geany/pull/197#issuecomment-31388209 and others.
But it certainly copy word could be made available, and even bound by default to some other keybinding.
If the user misses the v and hits the c (side by side on common keyboards) they lose what is in the clipboard,
Actually they don't, this only selects the current word.
which may be a disaster if they had cut not copied that content.
Much worse is if you mean to press Ctrl-T and you press Ctrl-R (or Ctrl-W for Ctrl-E, or Ctrl-Q for Ctrl-W) when you don't have changes but the file on disk is reverted and you wanted a document's content for something else.
But it certainly copy word could be made available, and even bound by default to some other keybinding.
I don't think there are any obvious nice bindings left. The nice thing about this is you can use it to select a word even if you don't want to cut or copy it, using a handy combination. Alt-Shift-W needs 2 hands.
So ^C once if nothing is selected selects the current word? And to "copy current word", hit ^C twice?
I don't know, this sounds awfully confusing if the user doesn't actually know how this behaves, and I don't personally see the huge benefit it gives.
this only selects the current word.
Ok, it only selects, agree your op said that, but I misunderstood due to the strength of the preconception that ctrl-c copies. Shows what the power of that expectation is.
Agree with @ntrel that there are other adjacent keybindings with risks, but ctrl-c/v is likely _the_ most common.
Agree with @b4n that the suggested behaviour is confusing.
A quick survey of what the editors/IDEs I have here (Linux) do on ctrl-c without any selection:
- Vscode: copies line ... eeek!!! bet this is where the idea for all the requests comes from - Eclipse: does nothing - Gedit: does nothing - Xed: does nothing - Scite: does nothing - this github window: does nothing - emacs: does nothing, well actually without selection its a command prefix, but its copy with a selection, ahhh emacs ;-P
Adding unusual behaviour to common actions is a user trap, even if its safe behaviour (just select) its likely to be confusing. And selecting it looks like the word was copied, but its not.
Whilst the select word keybinding is awkward (its three key left hand only), if you use it enough for it to be a significant hindrance to your workflow you can re-define it to another binding in preferences. And of course select word is double click too.
Better not tinker with the behaviour of one of the most common user actions.
@ntrel pushed 1 commit.
62f9eb5f5369b3c7d550e1465026224a818058f3 Only select word on copy (which copies to X clipboard)
I find this also confusing behaviour and don't think we should do this.
@ntrel, what about adding a new keybinding which provides the desired behaviour instead? I'd say leave the new keybinding unset but then users can rebind it to Ctrl-C if they like. And all other users won't be confused.
what about adding a new keybinding which provides the desired behaviour instead? I'd say leave the new keybinding unset but then users can rebind it to Ctrl-C if they like
OK, good idea. I can make cut/copy word keybindings that just cut/copy the selection when there is a selection.
Closed #3391.
github-comments@lists.geany.org