Small request: Strip trailing spaces, but NOT b4 the cursor

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply

This idea is

Good
1
50%
Bad
1
50%
 
Total votes: 2

User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Small request: Strip trailing spaces, but NOT b4 the cursor

Post by jeffy »

I also always have the "Strip trailing spaces from lines when saving" setting checked.

The one thing that annoys me about it is, if the cursor happens to follow some whitespace, it is moved to column zero.

I wish there was a sub-setting under "Strip trailing spaces from lines when saving", to say "Do not strip whitespace immediately before cursor".
Mordachai
Posts: 22
Joined: Mon Mar 26, 2007 2:19 pm

Post by Mordachai »

Isn't virtual spaces the correct and universal solution to this issue?
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post by jeffy »

What are virtual spaces?
Mordachai
Posts: 22
Joined: Mon Mar 26, 2007 2:19 pm

Post by Mordachai »

Many text editors allow you to turn on 'virtual spaces', which then allows you to place your cursor wherever you want - beyond the end of any given line, but it won't create spaces to fill the difference until you start typing real characters.

So, if you combine that with strip trailing spaces when saving a file, then it will remove all of the trailing whitespace, but won't move your cursor. If you then type something, those spaces will automatically be recreated and the next time you save, they'll be preserved.

So, not exactly what you're asking for, but maybe as useful to you (you'll have to answer that).

OH! I found it - in TextPad it's called "Constrain the cursor to the text" - under Preferences, Editor - first check-box.

Uncheck that, and it will allow your cursor to be wherever you want. Maybe that will be useful to you?
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post by jeffy »

I only care about the cursor not moving, as you say, I don't actually care if the spaces are stripped in the file itself, I just don't want the cursor moving when I save.

So +1 to virtual spaces.

The constrain to text only works when word-wrap is off. I mostly keep it on. But worth a try!
Mordachai
Posts: 22
Joined: Mon Mar 26, 2007 2:19 pm

Post by Mordachai »

Sounds like TextPad has a bug with word-wrap. It shouldn't allow you to put your cursor past the end of a word-wrapped line in the middle, but it should allow you to place it past the end of the paragraph, just like normal non-word-wrapped lines allow when 'constrain cursor' is turned off.
Post Reply