komodo.assertMacroVersion(3); if (komodo.view.scintilla) { komodo.view.scintilla.focus(); } // bug 67103 var koDoc = (komodo.koDoc === undefined ? komodo.document : komodo.koDoc); var formatter = null; var onlyWholeFile = false; switch (koDoc.language) { case 'Python': case 'Python3': formatter = 'autopep8 --aggressive -'; break; } // Save cursor Position try { if (formatter) { // Group operations in a single undo // Select Buffer, pipe it into formatter. var wholeFile = onlyWholeFile || komodo.editor.selText == ''; var currentPos = komodo.editor.currentPos; komodo.editor.beginUndoAction(); if (wholeFile) { komodo.doCommand('cmd_selectAll'); } ko.run.runEncodedCommand(window, formatter + " {'insertOutput': True, 'operateOnSelection': True}"); komodo.editor.gotoPos(currentPos); } } catch (e) { alert(e); } finally { komodo.editor.endUndoAction(); }
Jan 5, 2016
PEP8 Fix on save
Labels:
IT
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
New comment