Recent

Author Topic: How to unselect text ?  (Read 793 times)

440bx

  • Hero Member
  • *****
  • Posts: 5809
How to unselect text ?
« on: May 02, 2025, 12:54:37 am »
Hello,

When Editor->General->Selection->persistent block is set and some text has been selected in the editor, it seems the only way to unselect the text is to select some other text.

The question is: is there a way to unselect the selected text without having to select some other text ?

Also: is there a simple way to invert the selection ?

Thank you for your help.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

dsiders

  • Hero Member
  • *****
  • Posts: 1464
Re: How to unselect text ?
« Reply #1 on: May 02, 2025, 01:45:55 am »

When Editor->General->Selection->persistent block is set and some text has been selected in the editor, it seems the only way to unselect the text is to select some other text.
The question is: is there a way to unselect the selected text without having to select some other text ?
Also: is there a simple way to invert the selection ?


None that I'm aware of - for either question.

When I try to use it... it feels counter-intuitive. Especially when the Overwrite Block option is enabled (and consequently does nothing).

So, I leave it off.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

440bx

  • Hero Member
  • *****
  • Posts: 5809
Re: How to unselect text ?
« Reply #2 on: May 02, 2025, 01:54:11 am »
None that I'm aware of - for either question.
Thank you @dsiders. 

I'm selecting and de-selecting a space (from anywhere) to de-select whatever was previously selected.  It feels a bit hokey but, looks like there is no simple way anyway.  Thanks again.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11800
  • Debugger - SynEdit - and more
    • wiki
Re: How to unselect text ?
« Reply #3 on: May 02, 2025, 01:58:10 am »
Select and unselect. E.g. (when away from the persistent selection)
- Shift + Right to select 1 char
- Shift + Left to unselect that char

There is a "Hide block", but not sure that may be visible hide only.

You can also set the begin to before the end Ctrl-k + k "set block begin/end" => the old ones.



What would be "invert"?

The only way I understand it, would be to have 2 selections
- first from start of text to where the old select began
- 2nd from end of old select to end of text

And only one selection is supported.

440bx

  • Hero Member
  • *****
  • Posts: 5809
Re: How to unselect text ?
« Reply #4 on: May 02, 2025, 02:14:28 am »
You can also set the begin to before the end Ctrl-k + k "set block begin/end" => the old ones.
That suggestion put me on the right track.  Ctrl-k + h turns the selection off. :)



What would be "invert"?
Whatever was selected gets deselected and whatever was not selected, gets selected.

Yes, that can cause more than one area to be selected but, not always.  For instance, if the first line of a file is selected then inverting it, selects the entire file, except the first line.

It's usually handy to exclude some text from being searched.



Thank you Martin.  That helped.

FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018