0
Completed

Changes view: add option to prefer selecting whole word on double click (don't stop on underscore separator)

Hyper Sonic 2 years ago updated 9 months ago 5

In the code/diff view, I noticed that double click selects only a sub-word, stopping at underscore separator.

I often copy paste class and method names into my commit message from the diff view, so it would be convenient to copy full symbol names such as "_can_start_attack" instead of just a subword, on double-click. For now, I must manually highlight the full word.

For retrocompatibility, an option could be added to preserve the old behaviour (subword select on double-click), or switch to full word highlight.

The option could be placed in the global preferences and/or, for quick access, in the small Hamburger menu of the code/diff view.

GOOD, I'M SATISFIED
Satisfaction mark by Hyper Sonic 2 years ago

Related, there could be an option to navigate per full word instead of subword when using Ctrl+Left/Right in text fields such as the Commit message area

Wow, I'm using 22.1.4 now and it seems that double-click selects whole word!

I don't see an option to revert to partial world selection, but it's not issue for me personally as I only exclusively care about copying full symbols.

Can you confirm the behavior change is official? Then you can close the ticket.

EDIT: I also upgraded to Ubuntu 22.04 in the meantime. It's possible it affected selection if SmartGit is relying on OS-level text handling.

Completed

For the file compare control SmartGit considers letters, digits and _ as word character.

Reading https://smartgit.userecho.com/communities/1/topics/1562-word-navigation-ctrlleftright-do-not-stop-before-and-after-every-space I found out that the Preferences > Low-level properties > styledtext.useOwnWordBoundaryDetection = false will use the system default boundary detection, and not only affect ctrl+left/right navigation but also double click selection.

Therefore keeping it true will select snake_case_words indeed, but if you set it to false in order to avoid stopping at the left and right of every space during ctrl+left/right navigation, you will also detect boundaries at underscores, breaking highlight on double-click at underscores (at least in Ubuntu 22.04 x SmartGit 23.1.2).

So I'm still looking for an ideal solution.