Gordon P. Hemsley

Linguist by day. Web developer by night.

Real Tab Support in Bespin

Posted by Gordon P. Hemsley on March 18, 2009

Over the past week, I have been attempting to add real tab support to Bespin (bug 474055), under the guidance of Ben Galbraith (bgalbraith). Discussion on this issue has ensued in many places, including on Ben’s blog (in which he indirectly called me a weird hippie), as well as in at least two topics on the Google Group/mailing list Bespin Core.

The issue behind supporting real tabs is getting the editor to know that a tab is a variable width character. I was able to solve the problem of calculating just how wide that character is supposed to be, but that turned out to be the easy part. The problem that I’ve/we’ve been having is whether to contain all that knowledge in the cursor code (since it is essentially only a display issue) or to allow it to seep into the model code (which does all the actual text manipulation). That discussion is still ongoing right now, but either way, the change would require a little bit of refactoring of a lot of different functions, so that we can keep track of whether the function is getting the cursor position or the model position (as the latter is really just the nth index in the array, with all characters being equal).

So that’s where I’m at now. I’ve tagged the bug with the “student-project” keyword, since I’m a student and I’m working on the project, and I’ve posted a couple of patches in the bug to track my progress (the first one actually works, for the most part; the second one, not so much). All suggestions welcome.

About these ads

One Response to “Real Tab Support in Bespin”

  1. [...] Real Tab Support in Bespin [...]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: