Maybe SulbimeLinter created (SL) variant of the color scheme?
Dev Build 3118
@wbond: Question about the improved styling (which is highly appreciated). Is it going to be possible to have a <code>...</code>
section or something in tooltips etc that use the same syntax highlighting as in the ST syntax and color scheme? That would be pretty good. Maybe with something like class="Python"
for Python.sublime-syntax
.
You can actually do this currently with mdpopups if you have the Sublime syntax highlighter enabled in your preference file. There is a mapping file that takes care of the conversion of short names to the syntax highlighter: https://github.com/facelessuser/sublime-markdown-popups/blob/master/st3/mdpopups/st_mapping.py. This mapping obviously can be expanded by forking and also extended locally in the Preferences.sublime-settings
file.
There are a few quirks due to Sublime’s limited tooltip CSS, but generally it works pretty good.
With that said, a native implementation would be really nice as well.
nop, the SL is already supported by the scheme, so this is the only copy the sublime use.
Ah, it’s really strange. Here’s my popup styling and it works as expected: https://github.com/oivva/boxy/blob/dev/schemes/Boxy%20Monokai.YAML-tmTheme
Clear cache or ⌘+Q?
I suggest creating a new topic with information such as your console output, settings, etc.
One thing I’ve noticed is that when you set the font-size in the popup/phantom CSS, it doesn’t respect the font scaling in Windows. I have a windows system with a 4K monitor and the font set at 125% which is about 120dpi. And when I set my font size in a popup/phantom, the font sizes are 25% too small.
In order to fix this, I had to detect the font size and make adjustments to what I set in the CSS:
def get_font_scale(self):
"""Get font scale."""
scale = 1.0
if sublime.platform() == 'windows':
try:
import ctypes
LOGPIXELSY = 90
dc = ctypes.windll.user32.GetDC(0)
height = ctypes.windll.gdi32.GetDeviceCaps(dc, LOGPIXELSY)
scale = float(height) / 96.0
except Exception:
pass
return scale
Anyways, it would be great if when setting a font in the CSS, the scaling was taken into consideration automatically. I have currently only looked into this on Windows, but it might be an issue on other platforms as well.
Whit this build, my build system doesn’t start anymore… I don’t get any error.
Any way to debug this?
After installing this build on my Mac (2010 Core 2 Duo Macbook Air - OS X Mavericks 10.9.5) Sublime no longer works . Right after updating it was unresponsive then I force quitted it, and now it crashes on startup every single time.
I should probably point out that I have a pretty abnormal way that I work and usually have around 40 to 50 different sublime windows/projects open at any given time.
Anyway I can help debug this? Sublime is my most use app by far.
I was able to get it to work again by backing up and deleting the ~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session
file.
I thought I’d link to the annoying mouse selection bug thread from here as it was introduced in this build: [Bug in 3118 - Solved in 3119] Marking text jumps suddenly with the mouse
this is what I want to do - just add ST3 docs to Zeal so I can easily check for it from existing Zeal plugin to ST, just like for python docs.
Edit - you may ask why ? Two reasons:
- Zeal is offline, no more pain when coding when traveling
- Zeal content is indexed properly so it’s a lot easier to find methods
Just a note that zeal docs are on my/our radar for the “unofficial documentation”.
Hum, I haven’t find add_phantom
, erase_phantom_by_id
, erase_phantoms
, query_phantom
, orquery_phantoms
in the api… Obliged to run a dir(view)
and guess the params…
Could you add it @jps, please?
Matt
Thanks! Didn’t think about looking in there.
I had a look in the function of the class view in particular, and there is some other that aren’t in the API doc! indentation_level
for example.
It’s a bit silly: John builds something that is useful (I created this function) but doesn’t say anything about it, so nobody gets to know it (unless you have a look at the code, which is rare)
So, please: update the doc. I’m more than happy to help in any way that I can.
Matt
Currently I’ve decided not to document these with the hope that the higher-level sublime.Phantom()
and sublime.PhantomSet()
classes will be most appropriate and lead to fewer bugs.
I know this thread is old but the sample code is still useful. There’s a bug however:
self.timeout_scheduled
should be set to True
in on_modified
, when starting the timer. Without it, update_phantoms()
will be called upon each modification and won’t be limited to 10 times per second.
It should be like this:
def on_modified(self):
# Call update_phantoms(), but not any more than 10 times a second
if self.timeout_scheduled:
self.needs_update = True
else:
self.timeout_scheduled = True # bug fix
sublime.set_timeout(lambda: self.handle_timeout(), 100)
self.update_phantoms()