I'd like to use the "markUndoGroupsForGluing" and "glueMarkedUndoGroups" commands to support multiple-undo in my command.
This works fine in normal use, but when I try to use this as part of the "onDone" function which is run when a QuickPanel ends, the "glueMarkedUndoGroups" command runs out of memory.
I'm guessing this is either a problem with the way I'm using it, or a bug in the command itself as it relates to the QuickPanel.
Example code (this just adds "a" to the beginning of every selection in the view).
This crashes when run with selections on 20 lines (i.e. 20 selections at the beginning of each line).
- Code: Select all
def run(self, view, args):
self.view = view
window = view.window()
window.showInputPanel('Test', "", self.onDone, None, None)
def onDone(self, input):
selections = self.view.sel()
to_insert = ["a"] * len(selections)
for i, region in enumerate(selections):
Related thread: http://www.sublimetext.com/forum/viewtopic.php?f=6&t=1157&start=0