Re: [code] [textadept] Autoindent tweak

From: Robert Gieseke <rob.g.att.web.de>
Date: Wed, 9 Sep 2015 12:29:21 +0200

Hi Chris,

Am 05/09/15 um 02:03 schrieb Mitchell:
[...]
> On Fri, 4 Sep 2015, Chris Emerson wrote:
[..]
>> I really like textadept.editing.AUTOINDENT.
>>
>> One thing that's slightly annoying, though (ie not what I've been
>> used to elsewhere), is that I end up leaving otherwise empty lines
>> with spaces around.
>>
>> The behaviour I'd ideally want is that when you move the cursor off
>> the line that's just been autoindented without adding/removing any
>> characters, (either by pressing "enter" to make another new line,
>> or using cursor keys, mouse, etc.), the newly added intentation is
>> removed again.
>>
>> Alternatively, perhaps the autoindent could be implemented using
>> virtual space - but I don't want virtual space otherwise.
>>
>> I'm struggling to find a reliable way to get it to behave exactly
>> as I like. Anyone have any ideas?
>
> I personally have `textadept.editing.STRIP_TRAILING_SPACES` enabled,
> so this issue never presents itself.
>
> Other than using virtual space, I cannot think of any other solution.
> (However, auto-toggling virtual space would likely be a bug-ridden
> endeavor.)

In case you havent't seen it, I use this for saving, removing whitespace
and keeping position:
https://github.com/rgieseke/ta-common/blob/master/save_strips_ws.lua

Might be a starting point or a solution for your problem.

Cheers,
Robert

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 09 Sep 2015 - 06:29:21 EDT

This archive was generated by hypermail 2.2.0 : Wed 09 Sep 2015 - 06:44:22 EDT