triple-click to select quoted string #1364

Closed
opened 2023-05-31 13:30:55 +00:00 by anarcat · 1 comment
Contributor

There are different conventions on what "double-click" means out there. Typically, it means "select word". But what about triple-click? Currently, in foot, it selects a whole line.

But in some other programs (for example rxvt does this), triple-click selects the content of a quoted string, and to select the whole line you click another time (so "quadruple click").

For example, given the above paragraph, if I put my mouse on the word "quadruple" and:

  • double-click: selects the word quadruple
  • triple-click: selects the string quadruple click
  • quadruple-click: selects the line (e.g. including )., but varies according to terminal width

I have tried to find some standard reference on this and, unsurprisingly, it's not standard at all. This stack overflow discussion says that the triple-click is application dependent. The wikipedia page gives a few examples, mostly showing triple-click selecting a line.

The Apple HIG explicitly says:

In some contexts—in a programming language, for example—it may be appropriate to allow users to select both the left and right parentheses (or braces or brackets) in a pair, as well as all the characters between them, by double-clicking either one of them.

... which I think "select text contained in quotes" would qualify.

It's a delicate balance, one question is what to do if no double-quotes is found. In this case, interestingly, rxvt just reverts back to the original behaviour which is to select the entire line on triple-click.

It might seem confusing at first, but I have found that it works surprisingly well. If the entire line doesn't get selected at first, your brain quickly gets into the habit of mashing that mouse button until it selects what you want.

I've even seen setups where quadruple-click would select the quotes as well as the contained string, so you would get:

  • double-click: selects the word quadruple
  • triple-click: selects the string quadruple click
  • quadruple-click: selects the string "quadruple click"
  • quintuple-click: selects the line (e.g. including )., but varies according to terminal width

and yes, that gets a bit ridiculous, but it still works! :)

There are different conventions on what "double-click" means out there. Typically, it means "select word". But what about triple-click? Currently, in foot, it selects a whole line. But in some other programs (for example rxvt does this), triple-click selects the content of a quoted string, and to select the whole line you click another time (so "quadruple click"). For example, given the above paragraph, if I put my mouse on the word "quadruple" and: * double-click: selects the word `quadruple` * triple-click: selects the string `quadruple click` * quadruple-click: selects the line (e.g. including `).`, but varies according to terminal width I have tried to find some standard reference on this and, unsurprisingly, it's not standard at all. [This stack overflow discussion](https://stackoverflow.com/questions/2575758/conventions-for-the-behavior-of-double-or-triple-click-to-select-text-features) says that the triple-click is application dependent. The [wikipedia page](https://en.wikipedia.org/wiki/Triple-click) gives a few examples, mostly showing triple-click selecting a line. The [Apple HIG](http://developer.apple.com/Mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIntro/XHIGIntro.html) explicitly says: > In some contexts—in a programming language, for example—it may be appropriate to allow users to select both the left and right parentheses (or braces or brackets) in a pair, as well as all the characters between them, by double-clicking either one of them. ... which I think "select text contained in quotes" would qualify. It's a delicate balance, one question is what to do if no double-quotes is found. In this case, interestingly, rxvt just reverts back to the original behaviour which is to select the entire line on triple-click. It might seem confusing at first, but I have found that it works surprisingly well. If the entire line doesn't get selected at first, your brain quickly gets into the habit of mashing that mouse button until it selects what you want. I've even seen setups where quadruple-click would select the quotes as well as the contained string, so you would get: * double-click: selects the word `quadruple` * triple-click: selects the string `quadruple click` * quadruple-click: selects the string `"quadruple click"` * quintuple-click: selects the line (e.g. including `).`, but varies according to terminal width and yes, that gets a bit ridiculous, but it still works! :)
dnkl added the
enhancement
label 2023-05-31 14:42:26 +00:00
Owner

I personally think triple-click to select the text inside the quotes, and fallback to the entire line, strikes the perfect balance. Five clicks to select a line is a bit much...

I'm also thinking it might be worth adding an option that defines the quote characters. For example, one might want single quotes, double quotes, parenthesis, brackets etc to act as quotes. Of course, only matching quotes would be selected.

I personally think triple-click to select the text inside the quotes, and fallback to the entire line, strikes the perfect balance. Five clicks to select a line is a bit much... I'm also thinking it might be worth adding an option that defines the quote characters. For example, one might want single quotes, double quotes, parenthesis, brackets etc to act as quotes. Of course, only **matching** quotes would be selected.
dnkl closed this issue 2023-09-19 14:30:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: dnkl/foot#1364
No description provided.