Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (15 sloc) 1.71 KB

Elastic tabstops for Scintilla

This is an implementation of elastic tabstops for Scintilla. It was originally based on a port by David Kinder of my old Gedit implementation.

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 for more information.