[11.55rc1] Controversial change: deleting the first line with Backspace

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

[11.55rc1] Controversial change: deleting the first line with Backspace

Post by *Flint »

28.03.25 Fixed: Compare by content: Backspace can now remove the first line if it is completely empty (32/64)
I have not seen even a single text editor where such a functionality was implemented. All the programs or embedded text editing controls, that I've ever seen in my life, never remove the first empty line if I place the caret there and press Backspace.

Traditionally, the current line's EOL is considered to be located behind the last caret position, not in front of it. And since Backspace removes a character before the caret, it cannot delete the current line's EOL (or anything else, because there's nothing in front of the caret). Similar to how the Del key does nothing, when the caret is at the very end of the file, because it removes what's behind the caret, and cannot do it if nothing is present after the caret.

I believe that such a change in TC contradicts with this standard behavior too much, and may lead to unexpected editing results that user might have not intended.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50703
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [11.55rc1] Controversial change: deleting the first line with Backspace

Post by *ghisler(Author) »

I don't understand your report. How would you then
1. Create a zero byte file?
2. Remove all empty lines before the actual text starts?

It's not that the line disappears when you delete all text from it, you explicitly have to press Backspace to remove it. You don't need to do this if you dont' want to remove the line.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5895
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [11.55rc1] Controversial change: deleting the first line with Backspace

Post by *white »

It seems useful to me to bring the beginning of files in sync. And I think the comparison with normal editors fails in my opinion. I mean you can't compare the two. (Edit: I take that back, I was confused. Delete should delete the line, not backspace.)

Perhaps unrelated: Adding a line at the beginning, scrolls the line out of view (I used a small window and long enough file).
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Re: [11.55rc1] Controversial change: deleting the first line with Backspace

Post by *Flint »

How would you then
1. Create a zero byte file?
2. Remove all empty lines before the actual text starts?
Exactly like in any other text editor.
1) By selecting everything with Ctrl+A and pressing Del or Backspace.
2) By using Del key on the first empty line instead of Backspace.
3) By placing the cursor on the second line after the first empty line and pressing Backspace.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
MaxX
Power Member
Power Member
Posts: 1183
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: [11.55rc1] Controversial change: deleting the first line with Backspace

Post by *MaxX »

2Flint
>> 2) By using Del key on the first empty line instead of Backspace.
>> 3) By placing the cursor on the second line after the first empty line and pressing Backspace.

Then you will get UPPER next line, that can break comparison lines.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Re: [11.55rc1] Controversial change: deleting the first line with Backspace

Post by *Flint »

2MaxX
I just tried it. I opened the compare tool for two almost identical files, the second of which has an extra empty line at the beginning.
I place the cursor at this empty line and press Del. The line gets deleted, and both files jump one line up, and are kept synchronized. I don't see a problem here.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
petermad
Power Member
Power Member
Posts: 16065
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [11.55rc1] Controversial change: deleting the first line with Backspace

Post by *petermad »

If the first line is empty in the left file I see a difference between using Backspace and Delete:

If I use Backspace on the first line in the left side the line number is removed, but the (blank) line is still visible in both sides
If I use Delete the line is deleted and the content in both sides is moved one line up while the line number is set to 0 instead of 1 in the left side.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Re: [11.55rc1] Controversial change: deleting the first line with Backspace

Post by *Flint »

I noticed that difference too, but I fail to find any practical application. I mean, if the line doesn't exist on either side, why even show it? What is the scenario when you might want to have that non-existent line present? All the other lines disappear as soon as they are deleted (and have no counterpart on the other side). Why should the first line be different?
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50703
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [11.55rc1] Controversial change: deleting the first line with Backspace

Post by *ghisler(Author) »

I think it's a useful addition which people don't need to use if they don't want to, and which can be reversed via Undo, so I will keep it.

Moderator message from: ghisler(Author) » 2025-05-13, 09:35 UTC

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
Post Reply