[quote=āC0D312ā]
WUUB! GET YOUR ASS OVER HERE![/quote]
Damn, Iāve decided not to go with ST3 for a while, but now Iāve no choiceā¦
I tried every plugins in addition to wrote one myself to achieve this feature, but I was never happy with the result.
Look like your implementation is what I want.
Thanks.
edit: And the implementation is in Python ! Great !
The TODO still missing:
class GotoDefinition(sublime_plugin.WindowCommand):
def select_entry(self, locations, idx, orig_view, orig_sel):
if idx >= 0:
self.goto_location(locations[idx])
else:
# TODO: restore sel
if orig_view:
self.window.focus_view(orig_view)
This is my implementation:
def select_entry(self, locations, idx, orig_view, orig_sel):
if idx >= 0:
self.goto_location(locations[idx])
else:
if orig_view:
orig_view.sel().clear()
orig_view.sel().add_all(orig_sel)
self.window.focus_view(orig_view)
orig_view.show(orig_sel[0])
In addition, Iāve modified the run method to highlight by default the second item of the list if the first is the current one.
This way if a symbol appear 2 times in a file, the default highlighted item is not the current one:
[code] def run(self, symbol = None):
ā¦
defindex = 0
if len(locations) > 1:
fname, _, rowcol = locations[0]
if os.path.normpath(fname) == os.path.normpath("\" + v.file_name().replace(":", āā)):
if v.rowcol(v.sel()[0].begin())[0] == rowcol[0]-1:
defindex = 1
if len(locations) == 0:
sublime.status_message("Unable to find " + symbol)
elif len(locations) == 1:
self.goto_location(locations[0])
else:
self.window.show_quick_panel(
[self.format_location(l) for l in locations],
lambda x: self.select_entry(locations, x, v, orig_sel),
selected_index = defindex,
on_highlight = lambda x: self.highlight_entry(locations, x))[/code]
A little bit hacky, as the path returning from lookup_symbol() is not usable out of the box (at least on Windows), you have to convert it manually.
A method in the API to convert lookup_symbol() path to OS path would be useful.
Thanks.
This build enables the keybindings for Alt-(Shift-)hyphen on the Mac. These are normally used to produce en-dash and em-dash e.g. on the German or US keyboard. It would be nice if they could be disabled. (I googled and found suggestions to bind to null or ānoneā, but the best I achieve is that it does not jump, I still cannot insert dashes.
Overall, I would prefer if keybindings on the Mac did never contain only the alt modifier, but always also control or command (crtl/super), because otherwise they will inevitably shadow some characters. If that was at least an option to be configured, I would very much appreciate it.
Another note: The menu says that jumping back is control-shift-L control-b, but alt-hyphen seems to do the same?
I would be grateful for any help, and will downgrade to 3012 for the moment.
Jump Back / Jump Forward were done by Hong, one of Sublime HQs new employees (the other being Kari, whose work you can see in the recent blog post). You can direct all blame there, provided I can cajole him into joining the forum
I do generally avoid option key bindings on OS X, but missed that alt-hyphen was inserting something other than a hypen in my limited testing. Iāll change the binding to controlĀ± for future builds.
Waiting for a blog post with some info on everyone (yeah, including you, Jon!): picture, small description, role and so on
And some future plans for Sublime would be much appreciated too!
I was not sure how much of a co-incidence this was . Thank you very much!
Thanks again for the prompt help!
Damn, itās soooo close, but there are still glitches caused by rounded corners on the edge of regions.
āno_antialiasā doesnāt help either.
[quote=ājpsā]
Look like your implementation is what I want. Thanks.
Jump Back / Jump Forward were done by Hong, one of Sublime HQs new employees (the other being Kari, whose work you can see in the recent blog post). You can direct all blame there, provided I can cajole him into joining the forum [/quote]
So thanks Hong, clever implementation and nicely writing (even unittest!).
I think thereās only a small bug (typo) here:
elif name == 'move_to' and args'to'] == 'bof' and args'to'] == 'eof':
# move to bof/eof
get_jump_history(view.window().id()).push_selection(view)
I suppose it must be a or in the test:
elif name == 'move_to' and (args'to'] == 'bof' or args'to'] == 'eof'):
When I saw the addition of on_text_command/on_window_command, I immediately though it will be useful for this kind of things but Iām not sure that, if I had to write it myself, my solution will be as clean.
Using add_region() in on_selection_modified/on_modified event is a nightmare, undo command screw everything.
Now Iāve a question for Hong:
Currently the commands that trigger a push_selection() is written in stone (does it means something in english ?) in the on_text_command.
I have my own commands to navigate in the view and I like that they trigger the push_selection() too.
Is it OK to create my own eventlistener and use push_selection() ?
[code]import sublime, sublime_plugin
import Default.history_list as history_list
class MyJumpHistoryUpdater(sublime_plugin.EventListener):
def on_text_command(self, view, name, args):
if view.settings().get(āis_widgetā):
return
if name == āmoveā and argsābyā] == āwordsā:
# syntax is {ābyā: ālinesā, āforwardā: True}
history_list.get_jump_history(view.window().id()).push_selection(view)[/code]
Really liked the add_region changes!
Maybe a bug though:
The API says I can use an icon name of ācrossā. When I try it gives a yellow and red stripped graphic with this error:
Unable to decode Packages/Theme - Default/cross.png
Iām not seeing the fading minimap nor its related option in the default settings file. Anyone?
- Minimap view rectangle auto hides, and only displays on mouse over. This is an experimental change, Iād like feedback from anyone who thinks this is for the worse.
[quote=ājpsā]
Recently Iāve set the āoverlay_scroll_barsā to āenabledā on my Windows box and activated the ādraw_minimap_borderā.
The point was to expand my workspace by removing the scroll bars, now I use the minimap as an indicator of my position in the file in place of the scroll bar.
Iām pretty happy with this configuration and I think I will keep it.
So the auto hide of the minimap view rectangle donāt make me happy, cos Iāve now no indicator of my relative position in the file without using the mouse or moving the view.
So a setting to enabled/disable auto hide is really a must have for me.
- Minimap view rectangle auto hides, and only displays on mouse over. This is an experimental change, Iād like feedback from anyone who thinks this is for the worse.
You have forgotten this setting in the Default/Preferences.sublime-settings.
Edit: @bizoo There is already a setting, just set āalways_show_minimapā: true
[quote=ājpsā]
For a window with a 1x1 row/column layout the change is merely a bit distracting. For multi-column layouts the minimap loses nearly all of its utility (at least for the way I use it).