feat(ST2.UtilPackages): bump up all packages
- Refresh PackageCache with latest versions of everything
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"highlight_search_icon": "bookmark",
|
||||
"highlight_search_scope": "entity.name.function",
|
||||
"highlight_search_results": false
|
||||
}
|
||||
"highlight_search_results": false,
|
||||
"open_search_result_everywhere": false
|
||||
}
|
||||
|
@@ -3,5 +3,13 @@
|
||||
"keys": ["g", "o"],
|
||||
"command": "open_search_result",
|
||||
"context": [{"key": "setting.command_mode"}]
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+enter"],
|
||||
"command": "open_search_result",
|
||||
"context":
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "text.find-in-files" }
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@@ -24,3 +24,6 @@ openable paths or the icon. See your theme file for examples of colors.
|
||||
- 'highlight_search_icon': If you want an icon to show up in the gutter next to
|
||||
openable paths, include a valid icon name as a string (e.g., 'circle', 'dot' or
|
||||
'bookmark')
|
||||
- 'open_search_result_everywhere': Set to true to enable this plugin on all
|
||||
files not just Find Results panes. You can use this for saving and reopening
|
||||
your find results.
|
||||
|
@@ -1,31 +1,40 @@
|
||||
import os
|
||||
import sublime, sublime_plugin
|
||||
import util
|
||||
# Load with Python3, fallback to load with Python2
|
||||
try:
|
||||
from .util import parse_line_number, is_file_path
|
||||
except ValueError:
|
||||
from util import parse_line_number, is_file_path
|
||||
|
||||
|
||||
class OpenSearchResultKeys:
|
||||
HIGHLIGHT_ENABLED = 'highlight_search_results'
|
||||
SCOPE_SETTINGS = 'highlight_search_scope'
|
||||
ICON_SETTINGS = 'highlight_search_icon'
|
||||
OPEN_EVERYWHERE = 'open_search_result_everywhere'
|
||||
|
||||
|
||||
class HighlightFilePaths(sublime_plugin.EventListener):
|
||||
HIGHLIGHT_REGION_NAME = 'HighlightFilePaths'
|
||||
HIGHLIGHT_ENABLED_KEY = 'highlight_search_results'
|
||||
SCOPE_SETTINGS_KEY = 'highlight_search_scope'
|
||||
ICON_SETTINGS_KEY = 'highlight_search_icon'
|
||||
DEFAULT_SCOPE = 'search_result_highlight'
|
||||
DEFAULT_ICON = ''
|
||||
|
||||
def show_highlight(self, view):
|
||||
valid_regions = []
|
||||
show_highlight = view.settings().get(self.HIGHLIGHT_ENABLED_KEY, False)
|
||||
scope = view.settings().get(self.SCOPE_SETTINGS_KEY, self.DEFAULT_SCOPE)
|
||||
icon = view.settings().get(self.ICON_SETTINGS_KEY, self.DEFAULT_ICON)
|
||||
show_highlight = view.settings().get(OpenSearchResultKeys.HIGHLIGHT_ENABLED, False)
|
||||
scope = view.settings().get(OpenSearchResultKeys.SCOPE_SETTINGS, self.DEFAULT_SCOPE)
|
||||
icon = view.settings().get(OpenSearchResultKeys.ICON_SETTINGS, self.DEFAULT_ICON)
|
||||
open_everywhere = view.settings().get(OpenSearchResultKeys.OPEN_EVERYWHERE, False)
|
||||
|
||||
if view.name() != 'Find Results':
|
||||
if open_everywhere == False and view.name() != 'Find Results':
|
||||
return
|
||||
|
||||
for s in view.sel():
|
||||
line = view.line(s)
|
||||
line_str = view.substr(view.line(s))
|
||||
line_num = util.parse_line_number(line_str)
|
||||
line_num = parse_line_number(line_str)
|
||||
|
||||
if util.is_file_path(line_str) or line_num:
|
||||
if is_file_path(line_str) or line_num:
|
||||
valid_regions.append(line)
|
||||
|
||||
if valid_regions:
|
||||
@@ -40,8 +49,8 @@ class HighlightFilePaths(sublime_plugin.EventListener):
|
||||
view.erase_regions(self.HIGHLIGHT_REGION_NAME)
|
||||
|
||||
def on_selection_modified(self, view):
|
||||
highlight_enabled = (view.settings().get(self.HIGHLIGHT_ENABLED_KEY)
|
||||
or view.settings().get(self.ICON_SETTINGS_KEY))
|
||||
highlight_enabled = (view.settings().get(OpenSearchResultKeys.HIGHLIGHT_ENABLED)
|
||||
or view.settings().get(OpenSearchResultKeys.ICON_SETTINGS))
|
||||
|
||||
if view.settings().get('is_widget') \
|
||||
or not view.settings().get('command_mode') \
|
||||
@@ -108,19 +117,20 @@ class OpenSearchResultCommand(sublime_plugin.TextCommand):
|
||||
break
|
||||
|
||||
line = self.view.substr(prev).strip()
|
||||
if util.is_file_path(line):
|
||||
if is_file_path(line):
|
||||
return self.open_file_from_line(line, line_num)
|
||||
|
||||
def run(self, edit):
|
||||
open_everywhere = self.view.settings().get(OpenSearchResultKeys.OPEN_EVERYWHERE, False)
|
||||
for cursor in self.view.sel():
|
||||
cur_line = self.view.line(cursor)
|
||||
line_str = self.view.substr(cur_line).strip()
|
||||
line_num = util.parse_line_number(line_str)
|
||||
line_num = parse_line_number(line_str)
|
||||
|
||||
if self.view.name() != 'Find Results':
|
||||
if open_everywhere == False and self.view.name() != 'Find Results':
|
||||
return
|
||||
|
||||
if util.is_file_path(line_str):
|
||||
if is_file_path(line_str):
|
||||
self.open_file_path(line_str)
|
||||
elif line_num:
|
||||
self.open_file_at_line_num(cur_line, line_num)
|
||||
|
@@ -1 +1 @@
|
||||
{"url": "https://github.com/abrookins/OpenSearchResult", "version": "2012.09.11.15.18.59", "description": "a Sublime Text 2 plugin that opens files listed in the Find in File output"}
|
||||
{"url": "https://github.com/abrookins/OpenSearchResult", "version": "2013.07.25.03.39.55", "description": "a Sublime Text 2 plugin that opens files listed in the Find in File output"}
|
@@ -27,7 +27,7 @@ def is_file_path(line_str):
|
||||
|
||||
>>> is_file_path('/Users/me/code/OpenSearchResult/open_search_result.py:')
|
||||
True
|
||||
>>> is_file_path('C:\Users\me\\test.txt:')
|
||||
>>> is_file_path('C:\\Users\\me\\test.txt:')
|
||||
True
|
||||
>>> is_file_path('5: def parse_line_number(line_str):')
|
||||
False
|
||||
|
Reference in New Issue
Block a user