Home Download Buy Blog Forum Support

sublime text 2 scrolling in OS X

sublime text 2 scrolling in OS X

Postby pjv on Fri Feb 04, 2011 6:47 pm

hi, i am trying out the sublime text 2 alpha and liking a lot of things so far. one thing i found especially awesome today was selecting a word, hitting cmd-D a few times to multiple select the same word further on in the document, and then typing a new word and watching it change in all the selections. wow.

my question is about scrolling in OS X. it seems that you must be implementing some kind of custom, non-cocoa-standard, scrolling routine. i use a great extension called smart scroll that gives you smooth, ios-like scrolling in all cocoa apps. seems like a little thing, but i now can't live without it. doesn't work at all with sublime text 2. i'm wondering how custom and how essential your scrolling routine is and whether there is any way to use the standard cocoa scrolling so my beloved smart scroll will work.

i have a lot of other text-matey functionality requests as well, but scanning through the forum, they seem to have been fairly thoroughly covered already.

awesome work so far, and i am really looking forward to following the development of sublime text 2.
pjv
 
Posts: 30
Joined: Fri Feb 04, 2011 6:34 pm

Re: sublime text 2 scrolling in OS X

Postby jps on Fri Feb 04, 2011 10:05 pm

Sublime Text 2 responds to the standard Cocoa scrolling message, an NSEvent of type NSScrollWheel. It supports both sub-variants of this, per-pixel and per-line scrolling, and supports fractional amounts for both values.

I would hazard a guess that Smart Scroll is doing the wrong thing here, fiddling directly with Cocoa scroll bars, in an effort to support old versions of OS X that didn't work with fractional values in an NSScrollWheel event.
jps
Site Admin
 
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm

Re: sublime text 2 scrolling in OS X

Postby pjv on Sat Feb 05, 2011 3:00 am

thanks for the explanation. alas, i'm sure you are right.

the standard os x trackpad inertial scrolling for the macbook pro works perfectly of course. it's only a problem when i am in "desktop mode" using an external monitor, keyboard, and a scrollwheel mouse.

i coded on and off in ST2 today (these days that means python/django), going back and forth between it and textmate. i was able to adapt some tm django syntax files and snippets to work in ST2 which was great. there were a few rough edges for snippets that do automatic indentation when entering multiple lines of code. i didn't dig into them, but i'm sure that wouldn't be hard to fix. on the whole though, how cool to be able to just pop in the snippets i am already used to and have it just work.

ST2 is really elegant.

i read somewhere that it is written in python. is that correct? are you using pyObjC?

is there a way to use the python console to do things? like, could i interact with my django app in there? is that an embedded python or the system's python?
pjv
 
Posts: 30
Joined: Fri Feb 04, 2011 6:34 pm

Re: sublime text 2 scrolling in OS X

Postby jps on Sat Feb 05, 2011 10:03 am

pjv wrote:i read somewhere that it is written in python. is that correct? are you using pyObjC?

is there a way to use the python console to do things? like, could i interact with my django app in there? is that an embedded python or the system's python?


Sublime Text is written in C++, with Python embedded for the API. In general, you'd use the console more for interacting with the editor, and testing out plugins as they're developed.
jps
Site Admin
 
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 14 guests

cron