This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cheryl.sabella
Recipients cheryl.sabella, terry.reedy
Date 2019-03-21.12:57:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553173078.62.0.821065414158.issue36390@roundup.psfhosted.org>
In-reply-to
Content
Refactoring the methods was relatively straight forward, but I did have some questions:

1.  The name `formatregion` could probably be improved.
2.  The `classifyws` method is a module level method in editor.  It's needed in `formatregion` also, so I made a copy (bad!).  I would have liked to create a `utils.py` for this, but maybe there's a better place for it?  It doesn't just operate on text widgets as it is just a string function.  I'm sure there's an obvious choice that I'm missing.  See also #4 below.
3.  `tabwidth` and `indentwidth` in `formatregion` are getting the values from the editor window.  I thought about adding those to the init for FormatRegion, but then they would need to be updated if config changed.  Not sure which way would be better.
4.  Other methods in editor might be candidates for moving, such as the auto-indent methods (search on `### begin autoindent code ###` in editor) and specifically `smart_indent_event`.  Moving more of the indent code to a separate module helps with #2 and #3 above, but I wasn't sure how much of the text formatting should be moved.  I thought it best to start with the minimal change.
History
Date User Action Args
2019-03-21 12:57:58cheryl.sabellasetrecipients: + cheryl.sabella, terry.reedy
2019-03-21 12:57:58cheryl.sabellasetmessageid: <1553173078.62.0.821065414158.issue36390@roundup.psfhosted.org>
2019-03-21 12:57:58cheryl.sabellalinkissue36390 messages
2019-03-21 12:57:58cheryl.sabellacreate