On 5/21/06, Don Taylor <[EMAIL PROTECTED]> wrote:
Folks:

I have written a Pydev script that wraps comment paragraphs in Python or
Jython in Eclipse.  I would be grateful if you could try it out and let
me know about any bugs or suggestions for improving the code.

Hi Don,

I've checked it, and I have some suggestions:
1. Instead of having 80 as the default, you could use the preferences the user specified as its print margin:

from org.python.pydev.plugin import PydevPlugin
from org.eclipse.ui.texteditor import AbstractDecoratedTextEditorPreferenceConstants
cols = PydevPlugin.getChainedPrefStore().getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN );

2. When you try to indent the following:

#_line_to_wrap1_eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
# class Foo:
#    def m1():
#        pass
#_line_to_wrap2_eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

if you start doing it at the first line, it will stop there, and not get the full comment block (so, I think it could indent all that started with '#' + character, instead of bailing out when it finds the first '#' + space)

Cheers,

Fabio

Reply via email to