nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] PATCH: indent/un-indent marked text with tab/shift+tab


From: David Lawrence Ramsey
Subject: Re: [Nano-devel] PATCH: indent/un-indent marked text with tab/shift+tab
Date: Mon, 01 May 2006 14:58:47 -0400
User-agent: Thunderbird 1.5.0.2 (X11/20060420)

John M. Gabriele wrote:

<snip>

> Not sure if this is exactly what's being discussed here, but...
>
> NEdit has this useful feature where you can select some text, and then
> hit various Ctrl keys to indent/de-dent either by 1 space or one "tab
> size" (to column 0,4,8,12,... for 4-space indents). You might also
> call it "shift left/right".
>
> (It uses ^0 and ^9 for one space, and ^-Shift-0 and ^-Shift-9 for
> moving to next/previous indent columns.)
>
> The crucial part is, NEdit leaves the text selected/highlighted, so
> you can tap the keys repeatedly to get the text right where you want
> it. I've tried this with vim, but vim de-selects it after the
> indent/de-dent, which IMO, cripples the feature.

Fortunately, nano leaves the text selected after (un)indenting it.

> Anyhow, it would be nice to see nano get this "shift left/right"
> feature that nedit has.

It certainly would, but there are a few problems:

1. What keys should be used?  Given that indenting by tabs is currently
done with keys next to each other on the keyboard, it would be
consistent to do this with the keys to indent by spaces.  Using the
unshifted versions of { and } are out, as the first is reserved for
escape sequences and so has a hardcoded delay.  And, of course, the
NEdit keys won't work due to the shortage of available control
characters.

2. What should be done about certain mixes of spacing characters?  For
example, if you indent a line by a tab, and then immediately try to
unindent it by a space, should nano ignore it due to the column width
difference, reformat the indentation of the line so as to convert the
tab into tabsize spaces and then remove the space, or do something else
entirely?  Not to mention that UTF-8 support introduces a lot more
potential spacing characters besides space and tab, which makes things a
lot messier.

If these can be worked out, I'll look into adding (un)indentation by
spaces, assuming it doesn't require a massice rewrite of how nano
calculates column widths when e.g. the current column is in the middle
of a tab.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]