From 10f0330328ad50dae408fd370d240cc918618961 Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Sat, 14 Mar 2015 16:19:06 +0000 Subject: [PATCH] fix crasher in sbp_tab_cmd --- jove.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jove.py b/jove.py index 57c4504..a036835 100644 --- a/jove.py +++ b/jove.py @@ -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. # @@ -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 @@ -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: