Edit / Selection / (Un)Indent: Why are the start and end position of the selection changing?

Roeland

Member³
When selecting some text, and then indenting or unindenting it, the selection is moving along.

But this leads to some rather unwanted side effects:

  • Selecting a block of text and indenting it, makes it suddenly unfit to copy and paste, because the first line is not correctly aligned.
    Use Case: when adding an if-then clause, I frequently have to copy&paste the code to both blocks and alter some small things in it. It should be easier to indent something and then be able to copy and paste it without having to align the code.
  • When I select a block of text, and only white space at the end, unindenting until I lose the selection will not return the selection when I indent again.
The best and easiest solution should be quite simple IMHO. When (un)indenting, make the selected lines completely selected.

PL/SQL Developer version 12 beta 9 (and lower)
 
Thanks for picking up this so fast!

[quote:from Beta 10]Indent and Unindent functions now preserve selection start position[/quote]
This partially fix the issue, but is still a little awkward in use.
  • If I select some text now, and unindent it, the start of the code can get before the start of the selection?
  • When I select a block of text, and only white space at the end, unindenting until I lose the selection will not return the selection when I indent again. (see the first post)
I still believe that the best option is to select the lines completely when indenting or unindenting. This will make it clear that:
  • the operation is affecting the whole lines
  • solve some corner cases
 
Another issue detected with the current implementation:

If the text of the first line is unindented so that it comes before the start of the selection, the selection is removed from the first line...

For example:
Selecting text from # to #

Code:
T#est
          Test#

unidenting this 2 times and you will lose the selection on the first line.

Beta 10
 
Still not good in version 12.

The solution is IMHO fast and simple:
select the lines completely when indenting or unindenting

Please fix this Marco.
 
Back
Top