Skip to content

Commit 756dd9e

Browse files
author
tobias
committed
add _show_in_minimap setting
1 parent 9a6333e commit 756dd9e

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

VcsGutter.sublime-settings

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
// Set to false to disable evaluation after each input.
44
// Restart Sublime Text to activate this change.
55
"live_mode": true,
6-
6+
77
// When set to true VcsGutter runs asynchronously in a seperate thread
88
// This may cause a small delay between a modification and the icon change
99
// but can increase performance greatly if needed. Sublime Text 3 only.
1010
"non_blocking": false,
1111

12+
// Set this to true to show the gutter colors also in the minimap
13+
"show_in_minimap": false,
14+
1215
// Paths to VCS commands. Modify if the executable is not in your path.
1316
//
1417
// Format is key: path_to_executable
@@ -19,4 +22,4 @@
1922
"hg": "hg",
2023
"svn": "svn"
2124
}
22-
}
25+
}

vcs_gutter.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
except ValueError:
66
from view_collection import ViewCollection
77

8+
ST3 = int(sublime.version()) >= 3000
9+
10+
_show_in_minimap = False
811

912
def plugin_loaded():
1013
"""
@@ -19,6 +22,9 @@ def plugin_loaded():
1922
if not exists(icon_path):
2023
makedirs(icon_path)
2124

25+
settings = sublime.load_settings('VcsGutter.sublime-settings')
26+
global _show_in_minimap
27+
_show_in_minimap = settings.get('show_in_miminap', False)
2228

2329
class VcsGutterCommand(sublime_plugin.WindowCommand):
2430
region_names = ['deleted_top', 'deleted_bottom',
@@ -44,7 +50,7 @@ def lines_to_regions(self, lines):
4450
regions = []
4551
for line in lines:
4652
position = self.view.text_point(line - 1, 0)
47-
region = sublime.Region(position, position)
53+
region = sublime.Region(position, position+1)
4854
regions.append(region)
4955
return regions
5056

@@ -79,4 +85,8 @@ def bind_icons(self, event, lines):
7985
event_scope = 'deleted'
8086
scope = 'markup.%s.vcs_gutter' % event_scope
8187
icon = self.icon_path(event)
82-
self.view.add_regions('vcs_gutter_%s' % event, regions, scope, icon)
88+
if ST3 and _show_in_minimap:
89+
flags = sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE
90+
else:
91+
flags = sublime.HIDDEN
92+
self.view.add_regions('vcs_gutter_%s' % event, regions, scope, icon, flags)

0 commit comments

Comments
 (0)