Sublime Forum

Dev Build 3014

#1

Dev Build 3014 is out now. Some of the highlights:

  • Jump Back and Jump Forward. This goes hand in hand with Goto Definition: you can now navigate back to where you were by pressing alt±.

  • API: view.add_regions() has a few more options for how the regions are visualised now. Details are in the API docs at sublimetext.com/docs/3/api_reference.html

  • HTML completions and auto indent have been improved. Completions now only suggest tags with the expected case, and the auto indent should be unobtrusive now.

  • 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.

0 Likes

#2

WUUB! GET YOUR ASS OVER HERE!

0 Likes

#3

Thanks for the add_regions changes!

0 Likes

#4

[quote=“C0D312”]

WUUB! GET YOUR ASS OVER HERE![/quote]

http://www.youtube.com/watch?v=gdnbAvnRrQsjps

0 Likes

#5

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 !

0 Likes

#6

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.

0 Likes

#7

THIS! Now take my money already :wink:

0 Likes

#8

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.

0 Likes

#9

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 :slight_smile:

0 Likes

To stay or to leave of this community
To stay or to leave of this community
Atom - GitHub Editor
#10

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.

0 Likes

#11

Waiting for a blog post with some info on everyone (yeah, including you, Jon!): picture, small description, role and so on :geek:

And some future plans for Sublime would be much appreciated too!

0 Likes

#12

I was not sure how much of a co-incidence this was :wink:. Thank you very much!

Thanks again for the prompt help!

0 Likes

#13

Yes, please.

0 Likes

#14

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.

0 Likes

#15

[quote=“jps”]

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 :smile:[/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]

0 Likes

#16

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

0 Likes

#17

I’m not seeing the fading minimap nor its related option in the default settings file. Anyone?

0 Likes

#18

good


0 Likes

#19
  1. As long as there’s a setting to switch this on and off I’m fine with it.
  2. If draw_minimap_border setting is true, when I move the mouse over the minimap, the border flashes and disappears. Looks like a bug.
0 Likes

#20

[quote=“jps”]

  • 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]

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.

0 Likes