I have a command that needs to know if it was the last executed.
Unfortunately, view.command_history
seems to not be reliable… it doesn’t want to log this particular command of mine, though it logs other commands I’ve created, and I can’t tell what distinguishes the two.
Here is some sample code:
class MoveByBinarySearchCommand(sublime_plugin.TextCommand):
def run(self, edit, horizontal=True, forward=True):
last = self.view.command_history(0)[0]
print("last command:", last)
No matter how many times I invoke the above command, the last command logged is never “move_by_binary_search”, though the print statement is occuring.
Does a command have to modify the view in some way before it is logged into the command history?