From 9bf1f0f1a150ff65025480ae21fdd0395922b009 Mon Sep 17 00:00:00 2001 From: Randy Lai Date: Thu, 27 Jul 2017 00:54:16 -0400 Subject: [PATCH] Enhancement: disable "reset line" in cached mode --- Default.sublime-keymap | 6 ++++-- core/commands/inline_diff.py | 6 +++--- popups/inline_diff_view.html | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Default.sublime-keymap b/Default.sublime-keymap index 6a8f7ac6b..b739742a1 100644 --- a/Default.sublime-keymap +++ b/Default.sublime-keymap @@ -26,7 +26,8 @@ "args": { "reset": true }, "context": [ { "key": "setting.command_mode", "operator": "equal", "operand": false }, - { "key": "setting.git_savvy.inline_diff_view", "operator": "equal", "operand": true } + { "key": "setting.git_savvy.inline_diff_view", "operator": "equal", "operand": true }, + { "key": "setting.git_savvy.inline_diff_view.in_cached_mode", "operator": "equal", "operand": false }, ] }, { @@ -35,7 +36,8 @@ "args": { "reset": true }, "context": [ { "key": "setting.command_mode", "operator": "equal", "operand": false }, - { "key": "setting.git_savvy.inline_diff_view", "operator": "equal", "operand": true } + { "key": "setting.git_savvy.inline_diff_view", "operator": "equal", "operand": true }, + { "key": "setting.git_savvy.inline_diff_view.in_cached_mode", "operator": "equal", "operand": false }, ] }, { diff --git a/core/commands/inline_diff.py b/core/commands/inline_diff.py index ea1b3fe37..e22ea211d 100644 --- a/core/commands/inline_diff.py +++ b/core/commands/inline_diff.py @@ -61,7 +61,7 @@ def run_async(self, settings=None, cached=False): file_ext = util.file.get_file_extension(os.path.basename(settings["git_savvy.file_path"])) self.augment_color_scheme(diff_view, file_ext) - diff_view.settings().set("git_savvy.inline_diff.cached", cached) + diff_view.settings().set("git_savvy.inline_diff_view.in_cached_mode", cached) for k, v in settings.items(): diff_view.settings().set(k, v) @@ -142,7 +142,7 @@ class GsInlineDiffRefreshCommand(TextCommand, GitCommand): def run(self, edit): file_path = self.file_path - in_cached_mode = self.view.settings().get("git_savvy.inline_diff.cached") + in_cached_mode = self.view.settings().get("git_savvy.inline_diff_view.in_cached_mode") savvy_settings = sublime.load_settings("GitSavvy.sublime-settings") ignore_eol_arg = ( "--ignore-space-at-eol" @@ -397,7 +397,7 @@ def run(self, edit, **kwargs): sublime.set_timeout_async(lambda: self.run_async(**kwargs), 0) def run_async(self, reset=False): - in_cached_mode = self.view.settings().get("git_savvy.inline_diff.cached") + in_cached_mode = self.view.settings().get("git_savvy.inline_diff_view.in_cached_mode") savvy_settings = sublime.load_settings("GitSavvy.sublime-settings") ignore_ws = ( "--ignore-whitespace" diff --git a/popups/inline_diff_view.html b/popups/inline_diff_view.html index 07ec52dfb..04740ba96 100644 --- a/popups/inline_diff_view.html +++ b/popups/inline_diff_view.html @@ -9,10 +9,10 @@

Actions