0

This is more of an IDE question :

In Eclipse + PyDev , how can I align a chunk of code with some line ?

Let's say I have this code

  myList=[]
   for i in list
      print i
      do a bunch of other stuff

And in this example I wrote lets say that for some reason the for loop got indented once space when it shouldn't have - it needs to be aligned with the list("myList") definition. How can I indent\align the whole code block of the loop to the left so it is under list? Right now with no better solution I go line by line and move it to the correct spot . Tried using tab , no good ...I bet there's some easy answer for this...

4

1 回答 1

0

尝试 :

窗口 > 首选项 > pydev > 编辑器 > 制表符长度

并将标签长度设置为 4。

附言。我也认为选择所有代码(突出显示它们)。然后,Source > correct indentation也会做的伎俩。不过,我还没有尝试过。

于 2013-03-23T17:56:40.313 回答