From 8b41b2c1e59fa2196a224dea6d5e3848681153fa Mon Sep 17 00:00:00 2001 From: Jim Klo Date: Mon, 23 Mar 2015 21:12:33 -0700 Subject: [PATCH] Fix for Issue #78 1. ST3 disallows access to view.begin_edit() and view.end_edit() since it's passed into the TextCommand. 2. Python3 doesn't allow you to sort dict_keys, so need to cast to list(dict_keys).sort(). --- footnotes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/footnotes.py b/footnotes.py index d943456..61288cc 100644 --- a/footnotes.py +++ b/footnotes.py @@ -37,7 +37,7 @@ def get_footnote_definition_markers(view): def get_footnote_identifiers(view): ids = get_footnote_references(view).keys() - ids.sort() + list(ids).sort() return ids @@ -107,7 +107,6 @@ def is_enabled(self): class InsertFootnoteCommand(sublime_plugin.TextCommand): def run(self, edit): - edit = self.view.begin_edit() startloc = self.view.sel()[-1].end() markernum = get_next_footnote_marker(self.view) if bool(self.view.size()): @@ -118,7 +117,6 @@ def run(self, edit): self.view.insert(edit, self.view.size(), '\n.. [%s] ' % markernum) self.view.sel().clear() self.view.sel().add(sublime.Region(self.view.size())) - self.view.end_edit(edit) self.view.show(self.view.size()) def is_enabled(self):