You are here: PSPad forum > English discussion forum > Backspace on autoIndented line with Real Tabs On, Trim Trailing Spaces On

Backspace on autoIndented line with Real Tabs On, Trim Trailing Spaces On

#1 Backspace on autoIndented line with Real Tabs On, Trim Trailing Spaces On

Posted by: Programmer_SM | Date: 2011-04-23 21:43 | IP: IP Logged

In this scenario:

PSPad 4.5.5 build 2417

[AutoIndent] = On
[Real Tabs] = On
[Trim Trailing Spaces] = On

1234 (below) = 4 columns indented
12345678 (below) = 8 columns indented, etc

------------------------------
void main()<enter>
{<enter>
<tab>
1234for (i=0;i<5;i++)<enter>
1234{<enter>
1234<tab>
12345678call_some_function();<enter>
12345678<backspace> -- i want to go back one tab width
1234567 -- no, it only takes me back one character
1234567 <backspace>
123456 <backspace>
12345 <backspace>
1234}

------------------------------

However, if I move the cursor in front of the "c" in "call_some_function();"
and hit backspace, it brings me back one tab width (4 columns) as I would expect it should do on an empty line as well.

Setting [Trim Trailing Spaces] to OFF gives me my anticipated behavior. However, imo [Trim Trailing Spaces] should affect spaces at the end of lines with text followed by whitespace, not auto indent.

Example: [Trim Trailing Spaces] = On should make:

some_text_here and here<space><space><space><EOL>

turn into:

some_text_here and here<EOL>

Can we fix this bug?

Options: Reply | Quote | Up ^


#2 Re: Backspace on autoIndented line with Real Tabs On, Trim Trailing Spaces On

Posted by: carbonize | Date: 2011-04-24 06:57 | IP: IP Logged

forum.pspad.com

--
Carbonize

Options: Reply | Quote | Up ^


#3 Re: Backspace on autoIndented line with Real Tabs On, Trim Trailing Spaces On

Posted by: Programmer_SM | Date: 2011-04-25 05:04 | IP: IP Logged

carbonize:

I read that thread but it seems to be a different issue.

In my example, I haven't left the line yet and [Real Tabs] are On, so, the contents of the line buffer start out as (since Autoindent is On)

[TAB][TAB]

Now I hit backspace. The contents of the line buffer should be

[TAB]

but instead I get

[TAB][ sequence of N-1 spaces where N is the tab width]

In summary, I'm saying is that the action of [backspacing after auto-indent] works differently (and in my opinion is broken) when Trim Trailing Spaces is On.

Options: Reply | Quote | Up ^


#4 Re: Backspace on autoIndented line with Real Tabs On, Trim Trailing Spaces On

Posted by: myf | Date: 2011-04-25 18:13 | IP: IP Logged

It is probably OT, but for now I do not recommend to have autotrim enabled at all; it causes nasty history bug ( pspad.nlift.com ). Be warned.
It seems that it is the interoperability of autotrim and autoindent what causes all the mess in recent builds.

Options: Reply | Quote | Up ^


#5 Re: Backspace on autoIndented line with Real Tabs On, Trim Trailing Spaces On

Posted by: Cacycle | Date: 2013-05-31 20:10 | IP: IP Logged

I would like to bump this up. When the "Trim trailing spaces" setting is checked, then adding tabs to the start of a line just moves the cursor withhout actually adding the character. I guess the new tab character gets immediately and erroneously removed by "Trim trailing spaces".

This causes major problems when starting a new indented line as backspace always jumps to the start of the line instead of removing just the last tab character.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR