Page 1 of 1

Double clicking a word selects the trailing hyphens

Posted: Fri May 26, 2017 2:55 pm
by jjmc
Normally when I double-click a word in Textpad it won't select the trailing hyphen (unless it's a keyword defined in syntax highlighting), but today that behaviour changed for some reason.

For example, if the text is "$obj->property" and I double-click on "obj", I want it to only highlight "obj" but it's now highlighting "obj-".

This is only happening in some document classes and not in others. I haven't changed any of my syntax files recently so I have no idea why it just started acting like this today. Is it possible that a Windows update would affect that behaviour?

Posted: Fri May 26, 2017 3:19 pm
by ben_josephs
Is there a hyphen in
Configure | Preferences | Document Classes | <Class> | Syntax | Other characters in words
?

If so, remove it.

Posted: Fri May 26, 2017 3:27 pm
by jjmc
No, I only have an underscore there.

Posted: Sat May 27, 2017 1:37 pm
by ben_josephs
Look in the syntax files for the document classes in which this is happening. Do they have any keywords that contain hyphens?

From the help, under How To... | Customize Settings | Syntax Highlighting:
When selecting and stepping over words, the default set of characters in a word are letters, numbers and those used in keywords in the syntax definition file. If you need to include any others, such as a hyphen, type them in the box labelled "Other characters in words".

Posted: Mon May 29, 2017 1:19 pm
by jjmc
The issue fixed itself for a brief time without me changing anything, but is now happening again.

There are keywords with hyphens in my syntax file, however this never caused an issue before.