Sublime Forum

Decimal Number Double Click Option == Select ENTIRE Number

#1

Hi –

Again, Love ST…

What I cannot understand is that a text editor of this magnitude has not once been thought to be used by coders outside of the realm of HTML and Co…

I use ST to code a lot of diff. things. And for the world of me, I cannot understand WHY I can’t double click a number with decimals and have ST select the entire number instead of just selecting
either the left or the right of the dot or comma. I.e. double-clicking 0.2898933 will either select the zero or the 2898933.

This is SO tedious and I can’t believe this even happening :wink:

Could you please - ASAP - give us an option for such…

IF there already IS an option for this, please forgive my post and point me in the right direction

Thx
Morten

0 Likes

#2

If nothing else, you could take the . out of your “word_separators” setting, but that may lead to more headaches down the road. Is there a way to check the surrounding text when selecting, and apply a regex to it to only trigger when the . is surrounded by numbers? I know in the context of some keymap settings, there are “following_text” and “preceding_text” arguments, which you can use to check around the caret. For example:

{ "keys": "shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
	
		{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
		{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
		{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true }, // This line
		{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true } // And this one
	]
},

Maybe your answer lies there?

0 Likes