4

Normally in a webpage if I triple-click a paragraph, it highlights the entire paragraph. This currently works on a non-code formatted block of text here on Stack Exchange. But if I triple-click a code block, it just highlights the current line. It'd be nice to just triple-click and highlight the entire code-block for copy-pasting purposes. I think this is a feature everyone can benefit from. I am currently using Chrome so I don't know if this works on other browsers and if it does, please fix the functionality for Chrome. Also, I'm not sure whether this belongs on meta.stackoverflow.com, or meta.stackexchange.com but it seems more prevalent here so I posted it here.

1
  • 1
    Never knew about that feature but it works in FireFox too (apart from in code blocks).
    – PeterJ
    Commented Jul 13, 2014 at 7:28

1 Answer 1

4

No! Triple click selects a line. This is the same in the Markdown editor and in the rendered output; it just so happens that lines in prose are long and correspond to paragraphs. In code, lines are shorter, but that does not mean it is useless to select lines. In fact, lines are the most convenient unit to select code with. I commonly use it to select small chunks of code that may be part of a larger code block to manipulate (often removing it or changing its indentation with CtrlK). Changing it to select whole blocks of code would break this use case.

Besides the uses of the current triple-click behavior, it might be difficult to change. The triple-click behavior is not something Stack Exchange specifies; it’s something your browser specifies. I can only imagine the hoops that would have to be gone through to override the browser’s default selection behavior.

I should also point out that in the past, Stack Exchange has tended to not try to override the browser. The best example of this is how the tab key still works to move between fields, not to indent. Yes, they could change that behavior, but it has been discussed and consciously not implemented. Keeping the default browser behavior in this case would follow that precedent.

1
  • 1
    I remember systems where quadruple-click would select a paragraph. It looks like Opera is not one of them, but if it were, I suppose it would be helpful to mark the whole code block as a paragraph.
    – sh1
    Commented Dec 15, 2016 at 8:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .