Home Download Buy Blog Forum Support

Dev Build 3014

Dev Build 3014

Postby jps on Thu Feb 28, 2013 5:01 am

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 http://www.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.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 3014

Postby C0D312 on Thu Feb 28, 2013 5:29 am

sublime.DRAW_NO_OUTLINE


WUUB! GET YOUR ASS OVER HERE!
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Dev Build 3014

Postby facelessuser on Thu Feb 28, 2013 6:33 am

Thanks for the add_regions changes!
facelessuser
 
Posts: 1547
Joined: Tue Apr 05, 2011 7:38 pm

Re: Dev Build 3014

Postby wuub on Thu Feb 28, 2013 7:22 am

C0D312 wrote:
sublime.DRAW_NO_OUTLINE

WUUB! GET YOUR ASS OVER HERE!


http://www.youtube.com/watch?v=gdnbAvnRrQs&sns=em ;-)

Thank you jps
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: Dev Build 3014

Postby bizoo on Thu Feb 28, 2013 7:37 am

jps wrote:- 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+-.

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 !
bizoo
 
Posts: 873
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Dev Build 3014

Postby bizoo on Thu Feb 28, 2013 8:13 am

The TODO still missing:
Code: Select all
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:
Code: Select all
    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: Select all
    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))

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.
bizoo
 
Posts: 873
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Dev Build 3014

Postby discouraged_one on Thu Feb 28, 2013 8:34 am

jps wrote:- 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+-.

THIS! Now take my money already ;-)
discouraged_one
 
Posts: 6
Joined: Sat May 21, 2011 12:35 pm

Re: Dev Build 3014

Postby teoric on Thu Feb 28, 2013 8:37 am

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.
teoric
 
Posts: 6
Joined: Wed Jan 23, 2013 10:52 am

Re: Dev Build 3014

Postby jps on Thu Feb 28, 2013 8:41 am

bizoo wrote: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 :)
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 3014

Postby jps on Thu Feb 28, 2013 8:44 am

teoric wrote: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.

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.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 11 guests

cron