brownplt / pyret-lang

The Pyret language.
Other
1.06k stars 106 forks source link

Kebab-case variable name selection #1718

Closed SkylerAusten closed 2 months ago

SkylerAusten commented 7 months ago

Ahoy, me hearties!

In the online Pyret IDE, when you double-click camelCase and underscore_case variable names, it selects the full name. However, when you double-click kebab-case variable names, it will only select the word or dash on which you double-click.

Here's an example where I double-clicked underscore and kebab:

image

Could the CodeMirror be configured to support kebab-case variables?

blerner commented 2 months ago

This is unlikely to happen any time soon -- it's not a CodeMirror mode issue, but rather CodeMirror itself. I think there's been some work in CM 6 that might support this, but we're on CM 5 and it's a very nontrivial amount of work to upgrade to v6...

In the meantime, what you want is achievable with the keyboard, since Ctrl+Left or Ctrl+Right will navigate the cursor to the end of the entire name. So if you have |kebab-name and press Ctrl+Shift+Right, it'll select the entire name.