Sublime Forum

Dev Build 3118

#61

this is becoming ridiculous, thanx for ur help :wink:

0 Likes

#62

I suggest creating a new topic with information such as your console output, settings, etc.

2 Likes

#63

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.

1 Like

#64

Whit this build, my build system doesnā€™t start anymoreā€¦ I donā€™t get any error.

Any way to debug this?

0 Likes

#65

After installing this build on my Mac (2010 Core 2 Duo Macbook Air - OS X Mavericks 10.9.5) Sublime no longer works :frowning:. 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.

0 Likes

#66

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.

0 Likes

#67

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

1 Like

#68

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
0 Likes

#69

Just a note that zeal docs are on my/our radar for the ā€œunofficial documentationā€.

0 Likes

#71

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

0 Likes

#72

A better idea would be to look into sublime.py in the application dir.

1 Like

#73

:+1: 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

0 Likes

#74

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.

0 Likes

#75

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()
0 Likes