Sublime Forum

Dev Build 3116


As long as CDATA tags are not required by the color scheme parser, you can just not use them since the converter will already handle escaping the necessary characters before writing the converted XML. CDATA tags are only useful when you are directly editing XML by hand, not when you are converting to it anyway.

Just use a | YAML block scalar.

1 Like


@jps Also is it possible to configure the popup to appear only on some scopes ?
I’d like to limit it to function and types.

@ fitchefoll & kingkeith : Thanks, I just copy-pasted the css from the default themes, without checking that the CDATA wasn’t necessary.



The symbol index does not store context information regarding the symbol it found (specifically its scope path), so you can’t reliably do it from within a plugin.

Depending on what exactly you do not want to see, you can prevent that from being indexed altogether through a “tmPreferences” metadata file. See

1 Like


with the hover functionality, because the new hover API receives a point, it is possible to get the scope under the mouse cursor, so a plugin can reliably choose to ignore certain scopes or only whitelist certain scopes. However, looking at the code in, as it stands, there is no way to configure it - you’d have to write your own plugin and disable the built in functionality using the show_definitions setting.



So how does someone who has a theme style the popups?



you can only style popups in a color scheme I think, apart from that the plugins that show the popups are responsible for what colors to use



The popups are styled via the popupCss setting of the color scheme. It is controlled via the color scheme so that they fit nicely with the text buffer, since that is the only place they are displayed.

At some point in the near future I’ll be working on some docs for our subset of HTML and CSS. We do not currently embed a full-featured HTML engine.



What happens if a popup supplies CSS too? Are the styles merged? Or are the theme CSS styles ignored?



This allows fetching the scope of the symbol the mouse is over, but not the scope of the source of the symbol. You could accomplish checking the destination scope via opening the file/point in a hidden output buffer and checking the scope and then excluding it from the list.

I’m sure we’ll be tweaking Show Definitions over time as we get feedback and have time to implement more features. Keep the feedback coming!



I think @FichteFoll had this question in another thread, and I have it too: What happens if more than one plugin is using the new hover listener, and they both try to show a popup?



There are multiple stylesheets: the default, one based on the current view text settings, the rules from the popup, <style> tags in the content sent to show_popup() and then style="" attributes on the HTML. The selector with the greatest specificity will win.

1 Like


I’m on OS X with build 3117 and neither “settings open in new window” or “show_definition on hover” seem to work.

With settings, I either select Sublime Text -> Preferences -> Settings - User or use the keyboard shortcut cmd-, and both seem to just open the user settings file in a new tab.

For “show_definition on hover” nothing happens. I’ve used the Python example posted above with the build in Python syntax definition, but nothing happens on hover. I’ve also tried with several other syntaxes. All of them work with “goto definition” using keyboard shortcuts or mouse.

Could these be package conflicts or am I misunderstanding how these features work?



There is a single popup visible for a view at a time. The last one to run will be the one visible.

There is a method in the API to check if a popup is already shown (in addition to being able to see if the auto complete menu is shown).

1 Like


It sounds like you have an override for Main.sublime-menu. There is no entry for Settings – User any longer, it is just Settings.

You could check the console to see if any errors are listed.



That is what I expected, but I worry that, especially in the gutter, it is going to be easy for plugins to bump into each other. Maybe there could be a way to allow for paginating the popup if more than one source is trying to show a popup at the same time?

Edited to add: I realize I sound a bit negative, and I don’t want to, I am really excited to see this functionality, and I am already thinking about how to use it.

1 Like


Great, here are some suggestions:

  1. Only display the line number for the current file. (:40)
  2. Display paths as a relative path to the project root, not just the filename (or just the filename for files not in the project). Similar to how the goto anything panel displays file paths. (And the goto definition quick panel.)
  3. Generate a default stylesheet from the color sheme if no popupCss key is defined. In its most simple form, this could be only foreground and background colors.
    mdpopups additionally provides coloring for classes named after standard scopes (and builds from markdown, which is why I’ll probably still be using it).
1 Like


This is already planned for the next build.



If you are using the mdpopups dependency. If you turn on mdpopups.debug in your User/Preferences.sublime-settings, when you create a popup, it will dump CSS and HTML to the console. In that dump you will see the generated CSS for standard scopes (based on the scopes and colors already in your theme). That might be helpful for developers wanting to generate such classes for their theme…maybe I should more easily expose this functionality in a plugin like scopehunter…


					.foreground { color: #4D4D4C; }
					.background { background-color: #FCFCFC; }
					.comment { color: #8E908C; }
					.constant.other { color: #4D4D4C; } { color: #C82829; }
					.entity.other.attribute-name { color: #C82829; }
					.constant.numeric { color: #F5871F; }
					.support.constant { color: #F5871F; }
					.constant.character { color: #F5871F; }
					.variable.parameter { color: #F5871F; }
					.support.type { color: #EAB700; }
					.support.class { color: #EAB700; }
					.string { color: #718C00; }
					.entity.other.inherited-class { color: #718C00; }
					.markup.heading { color: #718C00; }
					.keyword.operator { color: #3E999F; } { color: #4271AE; }
					.support.function { color: #4271AE; }
					.keyword { color: #8959A8; }
					.storage { color: #8959A8; }
					.storage.type { color: #8959A8; }
					.invalid { color: #FAFDFF; background-color: #C82829; }
					.invalid.deprecated { color: #FAFDFF; background-color: #8959A8; }
					.variable.language { color: #EAB700; } { color: #3E999F; }
					.markup.bold { color: #8959A8; font-weight: bold; }
					.markup.italic { color: #8959A8; font-style: italic; }

If you install a plugin like ScopeHunter, the mdpopups dependency should get installed on your system via PackageControl.



Can I configure this popup to show up on mouse over + key, say Ctrl?

1 Like


ST does not provide an API that allows to inspect the currently pressed keys or modifiers and it also does not pass this information as a parameter to the event hook.

You can, however, use the Python ctypes module and use OS-specific system calls to retrieve information about the currently pressed modifier keys.

Another suggestions for the on_hover feature:

It would be nice if the delay for the hover event to trigger was configurable.