Sublime Forum

Dev Build 3116

#1

Dev Build 3116 is out now at https://www.sublimetext.com/3dev

Settings now open in a new window, with the default and user settings side-by-side. Likewise for key bindings.

Another highlight is the on_hover API, which is used by the new show_definition functionality. The basics of on_hover are:

class Example(sublime_plugin.EventListener): def on_hover(self, view, point, hover_zone): pass
hover_zone will be one of sublime.HOVER_TEXT, sublime.HOVER_GUTTER or sublime.HOVER_MARGIN.

Along with on_hover are a couple of new flags for show_popup: HIDE_ON_MOUSE_MOVE and HIDE_ON_MOUSE_MOVE_AWAY. The latter flag will hide the popup if the mouse moves away from the popup, but won’t hide the popup if the mouse moves towards it.

API documentation with more details is at http://www.sublimetext.com/docs/3/api_reference.html

11 Likes

Sublime syntax pop multiple levels
Hover/click events in gutter?
#2

If I have a maximized window, and I click on Preferences -> Settings or Preferences -> Key Bindings, I would like it if the new window opened was also maximized. I see that File -> New Window and opening a project also open a non-maximized window, so I guess this is a feature request :slight_smile: maybe make it configurable? :slight_smile:

(previously I almost never worked with more than one window, so didn’t notice it so much…)

2 Likes

Settings pane
#3

When I open keybindings / settings - the default view is empty - it is ok? In older builds, the default file has list of default settings / keybindings - now is empty…

0 Likes

#4

@noreffer what platform are you on? it’s working for me on Windows

0 Likes

#5

OS X, I will look this on Windows at home…

0 Likes

#6

@noreffer check that you’ve got 3116 and not 3115, that was an issue in 3115

0 Likes

#7

Yes, I must have 3115… now I have 3116 and it’s OK!

0 Likes

#8

Thanks for this build, greatly appreciated.

0 Likes

#9

Using build 3116, unsaved file contents is corrupted, also file paths, if they contain umlauts etc.
Every time I open sublime, characters get more and more corrupt.

To reproduce:

  1. open new file
  2. write “ä abc”
  3. close sublime
  4. open sublime
  5. unsaved file contains: ffc3ffa4 abc

1 Like

#10

Thanks jps the popup API opens a lot of possibilities.

But it breaks the PackageDev build system for converting YAML to tmTheme. (Or maybe it’s just I’m not good at YAML).

I tried to put the popupCss key in my YAML-thTheme:

    popupCss: "<![CDATA[
      html {
        background-color: #42342C;
        color: #BDAE9D;
      }
    ]]>"

But it generates:

    <key>popupCss</key>
    <string>&lt;![CDATA[ html { background-color: #42342C; color: #BDAE9D; } ]]&gt;</string>

I want the same thing but with < and > instead of &lt; and &gt;. Is there a way to prevent the escaping ?

EDIT: the answer is don’t use the CDATA, it’s not necessary.

1 Like

#11

@gwenzek if you are not using any special XML characters in your CSS, there is no need to enclose it in CDATA. I think you should log an issue on the PackageDev repo for it though.

1 Like

#12

@apaju thanks for the report, 3117 will be out shortly with a fix for that

1 Like

#13

Hey @jps, thanks for the update.

Couple of things:

  1. Keybindings supports few naming patterns: Default.sublime-keymap and Default (Platform).sublime-keymap. I’m using the first variant on custom keymaps and the configuration window show me a beautiful blank document. Probably an idea would be to either ask which one to show or show all of them.
  • It would be nice to implement an autoscroll for configuration keys, so if i select… let’s say scroll_speed on one side, jump the other side to the same key. That’s because the documentation is in only one place :slightly_smiling:

Btw, show_definition is implemented by default? Or is just an API thingy?

0 Likes

#14

@iamntz from the release notes:

Hovering over a symbol will show a popup indicating where it’s defined. This is controlled with the show_definitions setting.

so show_definition is implemented by default :slight_smile:

0 Likes

#15

Great. It doesn’t work then :smiley:

The whole project is indexed, go to definition and go to symbol and go to symbol in project works as expected.

The video is made on a clean 3116 portable, no plugins or any customization are made (other than font size).

It only works for certain languages?

0 Likes

#16

@iamntz hmm, works in a Python file (and finds the PHP method with the same name in a different file!) but apparently not in a PHP file…

1 Like

#17

looks like it is due to the code in symbol.py in the Default package - starting at line 166 - treating HTML differently, and thus not noticing it is a PHP file, so it is broken for all syntaxes that are embedded in HTML:

    # Limit where we show the hover popup
    if view.score_selector(point, 'text.html'):
        class_ = view.score_selector(point, 'meta.attribute-with-value.class')
        id_ = view.score_selector(point, 'meta.attribute-with-value.id')
        if not class_ and not id_:
            return
    else:
        if not view.score_selector(point, 'source'):
            return
        if view.score_selector(point, 'comment'):
            return
        # Only show definitions in a string if there is interpolated source
        if view.score_selector(point, 'string') and not view.score_selector(point, 'string source'):
            return
0 Likes

#18

Uuuuuuu, looks so pretty! :smiley:

Anyhow, i found another issue, which i think is not necessary related:

jQuery(document).ready(function($){
  function foo(argument) {}
})

foo is not displayed in the Symbol list, although it is a valid symbol, no?

0 Likes

#19

odd, it is displayed for me:

0 Likes

#20

Hmmmm, you’re right. On the portable version it works. On the installed (and heavy customized) it doesn’t.

I’ll start toggling packages and see which one is the nasty one.

0 Likes

JavaScript Symbol List Not Showing Function