tab vs. spaces indent

2007-08-17
2013-03-15
  • Ryan O'Rourke

    Ryan O'Rourke - 2007-08-17

    (Maybe this is more a general Eclipse question, but it's causing me problems trying to use PyDev.)

    My existing code has tab indentations.  In the editor with PyDev, when I hit return at the end of a line, it will indent the next line using spaces.  Naturally Python does not appreciate the variety in indentation style.  Is there a way to get the editor to use tabs to indent new lines?

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2007-08-17

      You should be able to specify whether you want to use tabs or spaces at window > preferences > pydev

      Cheers,

      Fabio

       
      • Ryan O'Rourke

        Ryan O'Rourke - 2007-08-17

        Ah thanks.

        I had looked there, but not on the top-level Pydev preferences, only under "Typing" and such.  :)

         
    • Matthias Baas

      Matthias Baas - 2007-08-21

      By the way, what exactly is the difference between the Pydev settings "Tab length" / "Replace tabs with spaces when typing?" and the general settings "Displayed tab width" / "Insert spaces for tabs" (in General -> Editors -> Text Editors)?

      At first I was confused by the seemingly duplicate options. But I take it the Pydev options should only affect a Python editor while the general options are valid for the regular text editor. Is that correct?
      The thing is that when I was enabling the general "Insert spaces for tabs" option it actually did affect the Python editor as well (even though it did not behave as expected until I set the Pydev option accordingly).

      - Matthias -

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2007-08-21

        Hummm... that option is new (added in eclipse 3.3) -- I hadn't seen it before, so, please open a bug report for that (I'll have to take a better look at that).

        Cheers,

        Fabio

         
    • Matthias Baas

      Matthias Baas - 2007-08-21

      ok, I added an entry to the bug tracker (unfortunately I have already been logged out, so it appears to be posted by "anonymous", sorry).

      - Matthias -

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks