Skip to content

Commit

Permalink
Preselect the commit on the cursor when picking a new commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Nov 21, 2024
1 parent 656c498 commit a4f2b94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/commands/blame.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def blame(self, coords):
view.run_command("gs_handle_vintageous")


class gs_blame_current_file(LogMixin, GsTextCommand):
class gs_blame_current_file(LogMixin, BlameMixin):

_commit_hash = None
_file_path = None
Expand All @@ -144,7 +144,10 @@ def run(self, edit, **kwargs): # type: ignore[override]

if self.view.settings().get("git_savvy.blame_view"):
if not self._commit_hash:
self._commit_hash = self.view.settings().get("git_savvy.commit_hash")
self._commit_hash = (
self.find_selected_commit_hash()
or self.view.settings().get("git_savvy.commit_hash")
)

self._file_path = self.file_path
kwargs["file_path"] = self._file_path
Expand Down

0 comments on commit a4f2b94

Please sign in to comment.