Skip to content

Commit

Permalink
fix crasher in sbp_tab_cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Payne committed Mar 14, 2015
1 parent 455a5ca commit 10f0330
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jove.py
Expand Up @@ -568,6 +568,9 @@ def reset_target_column(self):
self.run_command("move", {"by": "characters", "forward": True})
self.run_command("move", {"by": "characters", "forward": False})

def get_tab_size(self):
tab_size = self.view.settings().get("tab_size", 8)

#
# Returns the mark position.
#
Expand Down Expand Up @@ -1358,7 +1361,7 @@ def run_cmd(self, util, direction):
if state.argument_supplied:
cols = direction * util.get_count()
else:
cols = direction * self.view.settings().get("tab_size")
cols = direction * util.get_tab_size()

# now we know which way and how far we're shifting, create a cursor for each line we
# want to shift
Expand Down Expand Up @@ -2154,7 +2157,7 @@ class SbpTabCmdCommand(SbpTextCommand):
def run_cmd(self, util, indent_on_repeat=False):
point = util.get_point()
indent,cursor = util.get_line_indent(point)
tab_size = self.view.settings().get("tab_size")
tab_size = util.get_tab_size()
if util.state.active_mark or cursor > indent:
util.run_command("reindent", {})
else:
Expand Down

0 comments on commit 10f0330

Please sign in to comment.