Algorithm for editor bookmarks
Algorithm for editor bookmarks
- Subject: Algorithm for editor bookmarks
- From: Martin Hewitson <email@hidden>
- Date: Tue, 13 Aug 2013 13:56:35 +0200
Dear list,
I distribute a LaTeX editor and I have a feature whereby the user can 'bookmark' a place in a particular source file by clicking in the editor ruler, much like you do in Xcode to make a breakpoint. At the moment the bookmark is 'fixed' to the line number in the file, rather than to the text as one would desire. I'm trying to figure out the desired behaviour and how to achieve it. So I take breakpoints in Xcode as an example and observe that
1) Clicking in the vertical ruler creates a breakpoint.
2) Inserting a newline before the line of code moves the breakpoint
3) Splitting the line of code over two lines results in the breakpoint sticking to the first line.
4) Putting a newline in before the first character in the line of code leaves the breakpoint on the line above the code. (A bug?)
5) Changing the content of the line of code leaves the breakpoint in place. In fact, deleting all characters from the line of code leaves the breakpoint in place.
So, I'm trying to figure out if this is done with text attachments, and if yes, what's the algorithm? How is the original intention made to track the line of code? Is there another way one could go about this that doesn't involve text attachments?
Any insights?
Martin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden