3

PyDev's "Organize Import" will wrap the line at 80 char width like below: from xyz import A, B, C, \ D, E, F

Is there a way to disable that wrap? or to extend the width? I tried increasing the line width in eclipse settings, but it didn't seem to work. I think that's only specific in Java editors and not PyDev.

Xerion
  • 3,141
  • 5
  • 30
  • 46

2 Answers2

4

Yes, it's possible... the margin may be raised in window > preferences > general > editors > text editors > print margin column.

And the option to break in multilines or not may be changed in window > preferences > pydev > editor > code style > imports > 'allow multiline imports...'

Fabio Zadrozny
  • 24,814
  • 4
  • 66
  • 78
  • @Fabio: Thanks for the answer! I'm unchecking the "allow multiline imports" with LiClipse 3.1 (which uses PyDev 5.2.0), and when I do Ctrl-Shift-O, missing imports are still being broken up in multiple lines. Here's a screenshot of my config: http://pasteboard.co/noHeiVVga.png. Also wondering, if already present, multiline imports are supposed to be reformated as single line imports? Because this also is not happening. – Apteryx Nov 05 '16 at 02:32
  • 1
    I just checked it here and the issue is in the PEP8 compliant organizer (that version is really always breaking -- please create a bug report for that in https://www.brainwy.com/tracker/PyDev). – Fabio Zadrozny Nov 07 '16 at 10:14
  • I've created the ticket here: https://www.brainwy.com/tracker/PyDev/749 – Apteryx Nov 25 '16 at 20:46
2
from xyz import (A, B, C,
                 D, E, F)

Or

from xyz import A, B, C
from xyz import D, E, F

If the line is to wide to be shown it is too wide to be read easily. See Why should Python PEP-8 specify a maximum line length of 79 characters?

Community
  • 1
  • 1
jfs
  • 399,953
  • 195
  • 994
  • 1,670