Sublime Forum

Dev Build 3118

#21

Currently relying on __del__ is the only option.

cancel may be either a command name (a Sublime Text one, not a shell command), or a map of args that to pass to the target command.

If a buffer has multiple views (e.g., New View into File has been used), then is_primary() will only return True for one of them. Note that a view can start as non-primary, but become primary if the previous primary view is closed. By default, ViewEventListeners only get created for primary views.

4 Likes

#22

where the generated settings gets saved ??, i cant find it in the active scheme

0 Likes

#23

I would expect them not to get saved at all but rather generated on the fly.

0 Likes

#24

Amazing API additions in the new dev builds!!

It would be great to use this to preview the best completion inserted by insert_best_completion (tab key by default) particularly when the completion popup is not visible. However, I donā€™t think there is an API method to get the best completion (maybe I am wrong) and ST adds a small gap for LAYOUT_INLINE. Would be pretty neat.

body = """\n <style>\n body {\n  background-color: #f1f1f1;\n}\n span {\n color: #aaaaaa;\n }\n </style>\n <span>ball</span> """

view.add_phantom("test", view.sel()[0], body, sublime.LAYOUT_INLINE)
1 Like

#25

They are not saved to disk anywhere, just stored in memory. They are not generated if the color scheme defines its own popupCss.

0 Likes

#26

Small bug.

In symbol.py, this line:
symbol_begin_pt = view.text_point(l[2][0] - 1, l[2][1])
must be:
symbol_begin_pt = view.text_point(l[2][0] - 1, l[2][1] - 1)

In addition, this is a Gist with a modified symbol.py to propose active file items first and an other item than the current one by default.
Maybe this can be integrated in standard ST3 (only tested on Windows).

1 Like

#27

when i define the settings they always use the same default colors (white bg and blue links) so maybe u can save the generated colors to the scheme file ,this way it could be edited easily :wink:

0 Likes

#28

First off, thanks for the new build!


Iā€™ve found https://github.com/lord/slate to be great for documentation, compare https://lord.github.io/slate for output of the gh-pages branch. Docs could be included and opened via default brower from Sublime Text when offline, as well as linked to from the website when hosted on github and opened from Sublime Text when online.

@alkuzad Dash and/or Zeal would require those to be installed, browsers come with the OS. Using Slate here would reduce third-party dependencies.

0 Likes

#29
  • Build errors are now shown inline at the location where they occurred. This is controlled with the show_errors_inline setting.

As much as I welcome this feature in general, I think the way itā€™s currently implemented looks terrible. Would be nice if error messages can by customized by themes, so they stand out visually, rather than looking like a line of text inserted in the editor ā€“ I find that very confusing.

1 Like

#30

Really excited about the new APIā€™s. This opens many possibilities related to additional information about the code on screen. One thing I would like to see added is the ability to set an icon for a phantom region to be displayed only when there is no existing icon on the line (for inline display) or always display when displaying as a block region. I can see this being very effective for quickly identifying lines with build errors. To avoid the issue of trying to render multiple icons to the gutter I would say existing icons from normal regions that have been added to the code should take priority over phantom icons.

Thank you for the new build devs, keep up the amazing work!

1 Like

#31

Iā€™ve been working on some enhancements to minihtml that will make it easier to tweak the various popups. Iā€™m also planning on making some visual tweaks. Keep your eyes peeled for further improvements.

8 Likes

#32

I was trying out your example ViewCalculator plugin and I noticed that if I open a new file tab that the is_applicable() class method gets called on every character I type into that view until the file is saved. Is that expected behavior?

1 Like

#33

Thanks for the updates :sunglasses:

I played with appearance of the popup in my theme and have some questions.

How can I change the font size, face and weight of the Definition: title?

minihtml: Implemented font-family stacks

I was able to change the font face of the links only. Is this a bug?

0 Likes

#34

Thanks for the cool updates.

If anyone else wants to make the inline errors stand out more, hereā€™s an example of what I added to the .tmTheme file Iā€™m using

<key>phantomCss</key>
<string><![CDATA[
    html {
        color: black;
        background-color: darkorange;
    }
]]></string>

2 Likes

#35

Without the code you used, I canā€™t really say. Currently the CSS selectors in minihtml only support a single level of selectors, i.e. no nested selectors.

As I mentioned in another comment, I am working on implementing more features to make the various built-in popup customizable via color schemes. I will also be working in the near future on documenting the current feature set of minihtml.

4 Likes

#36

exec.py should html-escape (html.escape) the build result message. Otherwise tracebacks like these suddenly end after in:

Traceback (most recent call last):
  File "E:\Temp\default\exec.py", line 9, in <module>
    import sublime
ImportError: No module named 'sublime'


@ others: In order to make exec.py parse build results and add them as phantom views, View.find_all_results_with_text() was added. This wasnā€™t mentioned before.

>>> e = window.create_output_panel("exec")
Running python -u "E:\Temp\default\exec.py"
>>> e.find_all_results_with_text()
[('/E/Temp/default/exec.py', 9, 0, '  File "E:\\Temp\\default\\exec.py", line 9, in <module>')]

@jps, @wbond: When revising build results parsing, Iā€™d like to point to two different issues Iā€™ve had with those that I reported here: https://github.com/SublimeTextIssues/Core/issues/938
My suggestion was to provide a mapping that allows selecting a specific match of a pattern and modifying that in case the match is not in a format we can use. I donā€™t think this suggestion can be adjusted to support the error message being in the line(s) following filename, linenumber and column, though.

1 Like

#37

Did anyone manage to display a multi-line phantom ?
I tried to put <br /> and \n in a sublime.LAYOUT_BLOCK but without successā€¦

0 Likes

#38

Seems to be working fine for me.

0 Likes

#39

A question regarding the generation of popupCss: Are the styles always generated (i.e. is it guaranteed that the success and error classes are defined) and can then be overridden by a schemeā€™s actual popupCss values or are they really only generated if itā€™s not present at all? Having a guaranteed basic set of styles available at all times sounds very neat to me.

It might make sense to show errors from build results in a span with the error class to make them easier to distinguish from normal text. Thatā€™s not considering plans you might have for this already. :wink:

1 Like

#40

They are only generated when no popupCss setting is defined. The idea is that authors should provide at least those classes. I imagine we will be expanding the ā€œstandardā€ set of classes as we get more feedback from the community and package developers start using the popup and phantoms more.

Yes, I am currently working on visual tweaks to the inline build output, and features of minihtml that will help with that. The tweaks should also make it easy for color scheme authors to target build errors, definition popups, etc.

My hope is to establish some guidelines around the HTML and CSS for plugins to provide rich override functionality for color scheme authors and users.

4 Likes