Sublime Forum

Sublime text 2 scrolling in OS X

#1

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.

0 Likes

GUI for preferences
#2

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.

0 Likes

#3

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?

0 Likes

#4

[quote=“pjv”]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?[/quote]

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.

0 Likes