Skip to content

Commit

Permalink
Fix for Issue #78
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
jimklo committed Mar 24, 2015
1 parent 7e98bb2 commit 8b41b2c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions footnotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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()):
Expand All @@ -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):
Expand Down

0 comments on commit 8b41b2c

Please sign in to comment.