Coding for Tab Awareness in Bespin

Gordon P. Hemsley

During our last status meeting, I brought up the issue of people not taking tabs (and the fact that they are variable-length characters) into consideration when coding new features that require text manipulation. As a result, I was asked to write a little tutorial on the wiki to help explain the situation to those not familiar with the code.

Take a look at the article. It starts by giving a little background information about the issue. It then makes note of which functions are expecting to be fed modelPos, rather than pos. It then goes on to explain how to obtain the proper position value and other things related to the fact that tabs are variable-length, based upon where they are in a line.

This article outlines the tools that one needs in order to properly consider tabs in text. However, it does not necessarily give step-by-step instructions on how to properly use the code; it has no examples. Is it clear enough to use? Or is there still confusion as to what to do?

Please leave me feedback here, and I’ll make any changes that are necessary to clarify things better. (Alternatively, you could make the edits yourself—it is a wiki, after all—but I wouldn’t necessarily recommend that. I mean, I am the one that wrote the original code…. You know, just saying.)