Skip to content

Commit

Permalink
Fix: log by author, also when you are not found
Browse files Browse the repository at this point in the history
  • Loading branch information
stoivo committed Feb 11, 2018
1 parent 06b1e7f commit 95cc22e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/commands/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ def run_async(self, **kwargs):
author_text = "{} <{}>".format(author_name, author_email)
self._entries.append((commit_count, author_name, author_email, author_text))

try:
selected_index = (list(line[2] for line in self._entries)).index(email)
except ValueError:
selected_index = 0

self.window.show_quick_panel(
[entry[3] for entry in self._entries],
lambda index: self.on_author_selection(index, **kwargs),
flags=sublime.MONOSPACE_FONT,
selected_index=(list(line[2] for line in self._entries)).index(email)
selected_index=selected_index
)

def on_author_selection(self, index, **kwargs):
Expand Down

0 comments on commit 95cc22e

Please sign in to comment.