From 8fdd572a0ac7fcfb5608ca184ec268cbc71c6b52 Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Thu, 20 Jul 2017 11:12:13 +0200 Subject: [PATCH 1/3] borrow styling from exec.py --- Preferences.sublime-settings | 3 -- README.md | 14 ------- git-blame.py | 76 +++++++++++++++++++++--------------- 3 files changed, 44 insertions(+), 49 deletions(-) delete mode 100644 Preferences.sublime-settings diff --git a/Preferences.sublime-settings b/Preferences.sublime-settings deleted file mode 100644 index 6f908c4..0000000 --- a/Preferences.sublime-settings +++ /dev/null @@ -1,3 +0,0 @@ -{ - "gitblame.scheme": "dark" -} diff --git a/README.md b/README.md index aedd264..31ee507 100644 --- a/README.md +++ b/README.md @@ -16,17 +16,3 @@ View on [packagecontrol.io](https://packagecontrol.io/packages/Git%20blame) > Right click > Git blame - -## Examples - - -### Light scheme -![image](https://cloud.githubusercontent.com/assets/1134201/23709870/bcde89cc-0412-11e7-9464-3f97713bf747.png) - -Light: (with a light theme) - -![image](https://cloud.githubusercontent.com/assets/1134201/23709882/ce0c2ea2-0412-11e7-9bac-e5297629a15a.png) - - -### Dark scheme -![image](https://cloud.githubusercontent.com/assets/1134201/23709854/acfe8ed0-0412-11e7-8329-3aa51e530d19.png) diff --git a/git-blame.py b/git-blame.py index d17539a..ac3a937 100644 --- a/git-blame.py +++ b/git-blame.py @@ -5,41 +5,57 @@ import subprocess from subprocess import check_output as shell - -template_scheme = {} -template_scheme['light'] = ''' - -''' -template_scheme['dark'] = ''' - +stylesheet = ''' + ''' template = ''' - -{scheme} - Git Blame: ({user}) + +{stylesheet} +
+
+ +Git Blame: ({user}) Updated: {date} {time} | {sha} [Copy] [Show] -[X]  +''' + chr(0x00D7) + ''' +
+ ''' # Sometimes this fails on other OS, just error silently @@ -130,11 +146,7 @@ def run(self, edit): sha, user, date, time = self.parse_blame(result) - settings = sublime.load_settings('Preferences.sublime-settings') - scheme_color = settings.get('gitblame.scheme') or 'dark' - - body = template.format(sha=sha, user=user, date=date, time=time, - scheme=template_scheme.get(scheme_color, '')) + body = template.format(sha=sha, user=user, date=date, time=time, stylesheet=stylesheet) phantom = sublime.Phantom(line, body, sublime.LAYOUT_BLOCK, self.on_phantom_close) phantoms.append(phantom) From b2167ddab8119ba52c37aba1c997875961bf96ca Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Thu, 20 Jul 2017 11:20:43 +0200 Subject: [PATCH 2/3] restore example image --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 31ee507..c0df341 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,4 @@ View on [packagecontrol.io](https://packagecontrol.io/packages/Git%20blame) > Right click > Git blame + ![image](https://user-images.githubusercontent.com/2543659/28410198-331b1ec8-6d3d-11e7-9ac1-57d43fb6ab60.png) From f62ce0396af2ad70ad09eca6ceec7ec66b1eea6a Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Thu, 20 Jul 2017 11:21:00 +0200 Subject: [PATCH 3/3] heading --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c0df341..623a661 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,6 @@ View on [packagecontrol.io](https://packagecontrol.io/packages/Git%20blame) > Right click > Git blame +## Example + ![image](https://user-images.githubusercontent.com/2543659/28410198-331b1ec8-6d3d-11e7-9ac1-57d43fb6ab60.png)