Select word with subsequent space by doubleclick

General TRichView support forum. Please post your questions here
Post Reply
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Select word with subsequent space by doubleclick

Post by Jim Knopf »

In most text programs the subsequent space also is selected if a word is doubleclicked. Is there a solution for TRichViewEdit to imitate this behaviour?
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

It was made intentionally, because I think that copying a word is more useful than copying a word with following spaces.

Changing this behavior requires modifying TRichView source code.
Open CRVFData.pas, find the function TCustomRVFormattedData.FindWordAtR_, insert BEFORE the line:

Code: Select all

Word := RVU_Copy(Word, Offs, Len, ItemOptions);
the following code:

Code: Select all

        {$IFDEF RVSELECTWORDINCLUDESPACE}
        while (Offs+Len-1<RVU_Length(Word,ItemOptions)) and
          RVU_IsSpace(Word, Offs+Len, ItemOptions) do
            inc(Len);
        {$ENDIF}
And add RVSELECTWORDINCLUDESPACE in the list of compiler defines for your project.
This change will be included in the next update.
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Post by Jim Knopf »

Sergey Tkachenko wrote:It was made intentionally, because I think that copying a word is more useful than copying a word with following spaces.
It depends on the context. Usually I agree if you have to do something with this word. But during writing it is more comfortable including the spcae char to move the word to another place in the text.

Optimum would be to enable/disable this behavior via options. Will that be possible in the next version perhaps?

Thank you!
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I do not think that such an option is necessary (to many options complicate components and applications).
If you think that selection with spaces is more appropriate, activate RVSELECTWORDINCLUDESPACE
Post Reply