Beta 4, deleting several lines with option 'Delete unindents' enabled, deletes too many spaces

Claus Pedersen

Member³
I have three lines in the editor (new option 'Delete unindents' is enabled):

Code:
aaa
   bbb
   ccc

I place the cursor on position one on first line and press Shift and two times Down-Arrow (to mark the first two lines) and press Delete.
The two first lines are deleted (OK), but the spaces before "ccc" are also deleted. This is probably not by design.

Pressing delete on marked text should only delete the marked text (including new line) and the new option 'Delete unindents' should not be activated.

Pressing Ctrl-Z one time illustrates what has happened: now the spaces before "ccc" are back. Pressing Ctrl-Z again puts the lines with "aaa" and "bbb" back again.

So it seems that one press on Delete performs two actions. First it deletes the marked lines and then it unindents.

Only the marked lines should be deleted when I press Delete. If I want to unindent, I must should Delete again.
 
When text is marked the delete operation should indeed be limited to just the marked text. We'll fix it.
 
Another bug/feature related to the issues above. I have the code:
Code:
aaa
  bbb

When I am on the end of the line with aaa and press delete (to remove the new line character), the result is: "aaabbb", i.e. the new line is deleted, but also the leading spaces before bbb.

I would have expected a result like "aaa bbb", i.e. no spaces deleted, as there was nothing to unindent on the cursor position when I pressed Delete.

If I want to unindent the spaces before bbb, I would have to press Delete again.
 
Beta 7:
Deleting & unindenting at the end of a line now leaves an extra space if necessary
With the example from 21. November, when I press delete while on the 'new line' character, too many spaces are still deleted. In beta 7, when I press delete, I get the following result:
Code:
aaa bbb
i.e. one of the spaces in line two is deleted.
I am not unindenting, I am just deleting a new line character. If I want to unindent, I must place he cursor on a 'space' character.

In version 12, I get the correct when deleting:
Code:
aaa  bbb
(with two spaces before bb). Nothing is deleted but the new line.
 
This is as designed though. The delete key removes all indentation when the preference is enabled. Disable the preference (which is the default) to keep the 12.0 behavior.
 
The new unindent feature is highly useable in my opinion.

But personally I only expect to unindent, when I press Delete when the cursor is on space or Tab character, not e.g. a new line.

If I have code like "aaa..bbb", where the dots are spaces and the cursor is located on the first space after "aaa" then the resulting text should be "aaabbb", where alll spaces up to "bbb" are deleted, this is OK by design.

When I am deleting a new line character, only the new line character should be deleted and nothing on the line after. If I want to unindent spaces, then I should press Delete again. I do not consider a new line character a white space character in the same way as space or Tab.

But if this is the way you designed it, I can just say, that I do not think this is intuitive behaviour.

What are the opinions on this from other forum members?
 
Deleting & unindenting at the end of a line now leaves an extra space if necessary

This is creating strange results. I have the code:
SQL:
....SELECT
....COUNT(*),
....MIN(dual.dummy),
....MAX(dual.dummy)
....FROM dual
....ORDER BY 1
with 4 spaces before each line (stated as dots).

I place the cursor in column 3 and press Delete to unindent the two spaces before each text. I do this for each line and get the following result:
SQL:
..SELECT
...COUNT(*),
..MIN(dual.dummy),
...MAX(dual.dummy)
...FROM dual
...ORDER BY 1

Only lines 1 and 3 have the two spaces deleted, I would have expected as end result to have all lines left-adjusted.

Please correct this.

An extra oddness (probably an adverse effect of this new feature): when you open a read-only source from e.g. the database, and press delete repeatedly in a space in the text, each time the cursor is moved one character to the left. Only the 'normal' keyboard navigation keys should move the cursor in read-only code.
 
Beta 8, issue from 29. November solved, thanks.

From the release notes (https://allroundautomations.com/bodyplsqldev130.html):
A new "Delete unindents" preference has been added. When enabled, pressing the Delete key will delete all tabs and spaces to the right of the cursor position.
I still believe that my example from 21. November does not comply with this design.

When I press Delete after aaa, there are NO tabs and spaces to the right of the cursor position (only a new line character). Therefore no spaces should be deleted on the line below, even after the new line character is deleted.

Otherwise it is a two-step process (first PLD deletes the new line character and then finds out that now there are some spaces to the right of the cursor position and they are now partly deleted) and that is not what I expect.

This is at least how I read the text in the new feature document.
 
Back
Top