Skip to content

Commit

Permalink
Hack to avoid problems if cursor is at the end of the line
Browse files Browse the repository at this point in the history
  • Loading branch information
martisak committed Feb 24, 2018
1 parent 4ae2b23 commit 36ee5a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions orgmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,15 @@ def run(self, edit):
sels = view.sel()
sel = sels[0]

# Get the scope name for the current cursor position
# also contains other scopes
if 'orgmode.todo' not in view.scope_name(sel.end()):
return

# If the cursor is at the end of the view, return.
if (sel.end() == sel.begin()) and (sel.end() == view.size()):
return

region = view.extract_scope(sel.end())

todo = self.get_todo(region)
Expand Down

0 comments on commit 36ee5a3

Please sign in to comment.