Elastic tabstops for Scintilla
The work consisted of 2 main parts:
- extending Scintilla's API to support explicit tabstop positions
- implementing elastic tabstops using the extended API
Extending Scintilla's API to support explicit tabstop positions
In August 2014, code from this repo was added to Scintilla's main branch (see this commit) and released as part of version 3.5.0. This makes it possible to set explicit tabstop positions in Scintilla (using SCI_CLEARTABSTOPS, SCI_ADDTABSTOP, and SCI_GETNEXTTABSTOP as documented here), which is a prerequisite for implementing elastic tabstops.
Implementing elastic tabstops using the extended API
Most of the interesting code is in ElasticTabstops.cpp. Currently this is not a very efficient implementation as it rescans the entire buffer every time a change is made, rather than caching everything and only rescanning the parts that have changed. Unless performance is not an issue, those wishing to reimplement elastic tabstops should find a way to cache cell widths per line. For a discussion about possible ways to do this in Scintilla see here.
Visit http://nickgravgaard.com/elastic-tabstops/ for more information.