Recent

Author Topic: select hyphenated words on double-click  (Read 3896 times)

john60

  • New Member
  • *
  • Posts: 24
select hyphenated words on double-click
« on: August 09, 2018, 03:38:25 pm »
Is there a way to change the way the double click event selects words ?
IE to allow it to select hyphenated words - or even better still - all
words surrounded by white space ?

eg:
abd-def  or  abc.def or   abc(stiil-a_word)

Is there a separator list somewhere I've missed maybe?

thanks

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: select hyphenated words on double-click
« Reply #1 on: August 09, 2018, 10:18:16 pm »
In the IDE, or in your own app?

In the IDE: currently not.

In your app, this depends on the highlighter you use. It should use
   Highlighter.WordBreakChars
to determine the bounds.
Note that this does not yet support utf8.

You can of course hook the mouse click events too. RegisterBeforeMouseDownHandler or write your own MouseActions.

john60

  • New Member
  • *
  • Posts: 24
Re: select hyphenated words on double-click
« Reply #2 on: August 10, 2018, 11:43:59 am »
Thanks martin.

This does seem to be a bit of an omission. A source code search brings
up a fairly incomplete looking Tsynidentchars  (.../tests/tbs/tb0510.pp)
 and nothing for wordbreakchars. and no code commentry by the looks of it.

I'd suggest this would be better in synedit itself to cut down on obscure bugs
when people use multiple highlighters.
I'll have to pass over it for now and wait until I replace synedit later.


 

TinyPortal © 2005-2018