this is becoming ridiculous, thanx for ur help
Dev Build 3118
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()