|
From: Jim V. F. <big...@ow...> - 2002-04-10 21:42:13
|
And better than ever. We've added some caching information (position, line number, previous newline, and next newline) to DefinitionsDocument, and we're guaranteed never to do more work than we have to. If it's cheaper to calculate the documents position from "scratch" i.e. the top of the document, then it does that. Otherwise, it calculates how much earlier or later in the document the current location is than the cached location, and merges it with the cached line number. It's pretty slick; I've never written anything quite like it. There's still an outstanding issue concerning switching documents, you can read the feature request if you're interested. But check out the code, laddies, you can see the line numbers! (I even threw in some spacing in the status bar display, so the Mac OS X users can see it. ;-) Jim |