Double clicking a word selects the trailing hyphens

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
jjmc
Posts: 4
Joined: Thu Jan 28, 2016 3:41 pm

Double clicking a word selects the trailing hyphens

Post 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?
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Is there a hyphen in
Configure | Preferences | Document Classes | <Class> | Syntax | Other characters in words
?

If so, remove it.
jjmc
Posts: 4
Joined: Thu Jan 28, 2016 3:41 pm

Post by jjmc »

No, I only have an underscore there.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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".
jjmc
Posts: 4
Joined: Thu Jan 28, 2016 3:41 pm

Post 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.
Post Reply