Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#87 auto indent annoying (Part 2)

closed-fixed
nobody
5
2005-04-28
2005-03-11
Dan Kruger
No

In Version 3.10.12, there's still an off-by-one issue
if you hit return on an already existing line
containing text immediately following a line that ends
with colon..

Dan, if you've addressed this already, I apologize for
the bug post.

| is the cursor..
-> is a tab

def Hello:
|->print "hi"

if you hit enter, the following behavior occurs..

def Hello:
->|->print "hi"

And here's the code to fix it..
in module drText, starting at line 120, replace the
source with the following code up to the "else"...
Basically, it checks to see if the current line after
the colon'ed line has text before applying the
additional tab.

if (self.grandparent.prefs.docautoindent == 2)
and (self.filetype == 0):
checkat =
self.GetLineEndPosition(linenumber) - 1
if self.GetCharAt(checkat) == ord(':'):
if self.GetLine(clinenumber+1).strip()=='':
numtabs = numtabs + 1
else:

Discussion

  • Dan Kruger
    Dan Kruger
    2005-03-11

    autoindent bug Fixed drText

     
    Attachments
  • Dan Kruger
    Dan Kruger
    2005-03-11

    Logged In: YES
    user_id=1131500

    attached is the altered drText.py

     
  • Logged In: YES
    user_id=796750

    Got it. Just need to figure out how to upload 3.10.13.
    Thanks for the fix!

     
    • status: open --> closed-fixed