Menu

HTML indents like Python

Help
2005-01-18
2013-04-26
  • Peter Mayne

    Peter Mayne - 2005-01-18

    When I'm editing an HTML document, if I end a line with a colon, the next line is auto-indented as if I'm editing a Python script. This probably shouldn't be happening. :-)

    DrPython v3.9.0

     
    • Daniel Pozmanter

      Context sensitive autoindent should be added to the list of file type specific preferences then.

      (I imagine this is the case as well for c++, plain text).

       
    • Peter Mayne

      Peter Mayne - 2005-01-19

      A workaround would be to change line 282 of drText.py (checking for ':' at end of line) to

                      if self.currentlanguage==0 and self.GetCharAt(checkat) == ord(':'):

      Hmm, the else: after this if (dedent if there is a keyword) is also Python specific, but occurs when editing HTML.

      Since Python is the only language for which these tests make sense, this whole chunk of code should be protected by if self.currentlanguage==0, regardless of a per-type setting.

      It would be nice if there were some constants like LANGUAGE_PYTHON, LANGUAGE_HTML, etc instead of using 0, 1, ...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.