Skip to content

Commit 61149d8

Browse files
froupsykzz
authored andcommitted
Give diff-viewing tabs better name than 'untitled' (#23)
1 parent 2742789 commit 61149d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

git-blame.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def on_phantom_close(self, href):
169169
elif intent == "show":
170170
desc = self.get_commit(sha, self.view.file_name()).decode('utf-8')
171171
buf = self.view.window().new_file()
172-
buf.run_command('insert_commit_description', {'desc': desc})
172+
buf.run_command('insert_commit_description', {'desc': desc, 'scratch_view_name': 'commit ' + sha})
173173
else:
174174
self.view.erase_phantoms('git-blame')
175175
else:
@@ -182,7 +182,7 @@ def run(self, edit):
182182
if self.phantom_set.phantoms and self.view.line(self.view.sel()[0]) == self.view.line(self.phantom_set.phantoms[0].region):
183183
self.phantom_set.update(phantoms)
184184
return
185-
185+
186186
for region in self.view.sel():
187187
line = self.view.line(region)
188188
(row, col) = self.view.rowcol(region.begin())
@@ -347,8 +347,9 @@ def on_modified_async(self):
347347

348348
class InsertCommitDescriptionCommand(sublime_plugin.TextCommand):
349349

350-
def run(self, edit, desc):
350+
def run(self, edit, desc, scratch_view_name):
351351
view = self.view
352352
view.set_scratch(True)
353353
view.set_syntax_file('Packages/Diff/Diff.sublime-syntax')
354354
view.insert(edit, 0, desc)
355+
view.set_name(scratch_view_name)

0 commit comments

Comments
 (0)