[Geany] de-indent: possible bug, and a question

John Gabriele jmg3000 at xxxxx
Sun May 6 20:35:05 UTC 2007


On 5/5/07, Enrico Tröger <enrico.troeger at uvena.de> wrote:
> On Thu, 3 May 2007 12:23:48 -0400, "John Gabriele" <jmg3000 at gmail.com>
> wrote:
>
> > I've got Geany set to always use spaces (4 space indents).
> > Autoindentation is on (set to "Advanced").
> >
> > At the end of a block, I hit Enter and get the auto-indent, but then
> > want to back up 4 spaces. Is there a way to delete those extra 4
> > spaces without having to hit my backspace key 4 times?
> >
> > I was hoping Shift-Tab would do it. But Shift-Tab only moves the
> > cursor back 4 spaces, leaving those 4 extra spaces still hanging off
> > the end. (Yes, I have Prefs --> Files tab --> "Strip trailing spaces"
> > enabled, but still, the behaviour of Shift-Tab doesn't seem right.)
> >
> > I tried Shift-Ctrl-i, but that moved the cursor back only one space.
> > This seems like a bug (I'd expect it to behave the same as Shift-Tab).
>
> I'm not completely sure what you mean, sorry. Could you send me a
> little example?

Sure.

I'm working on a Python file. Maybe in some method that's part of a
class, so I'm already indented by, say, 8 spaces total:

I type: "for i in range(10):" and hit Enter. The next line is indented
by the usual 4 spaces:

class Foo(object):
    def foo():
        for in in range(10):
            #... I'm here now.

I type some command like "do_something()", then hit Enter. At this
point, I'm still indented, but I'm done with the "for" statement, and
want to go back to the indentation level of the foo() method.

class Foo(object):
    def foo():
        for in in range(10):
            do_something()
        # I want to get back to this indentation level.

Currently, Geany makes me hit the backspace key 4 times to get back
there. I want a way to hit one key (or Ctrl-some_key) to do it. I
realize that if I were using tabs, I could just hit backspace once,
but I'm using spaces exclusively (as many folks do).

Vim has a key for this (Ctrl-d maybe? -- I can't recall as I haven't
used vim in a very long time). Some other editors try to be smart and
delete all 4 spaces if the last thing it did was an autoindent (I
think nedit may do this). Emacs does something completely different
(it shifts the line around when you hit Tab to the "proper"
indentation, regardless of where the cursor is).

---John


More information about the Users mailing list