behaveLikeTabs
For space-based indentation, should the caret move as if the underlying data structure uses tab characters? i.e. using the arrow keys, clicking/dragging with the mouse, backspace and delete should treat an indentation consisting of many spaces as if it were a single tab-character.
When set to true
, the caret will not appear in the middle of an indentation. Delete and Backspace will delete the whole indentation, not just a single space. This leads to an asymmetry which may annoy some people : Pressing space 4 times at the start of a line, then hitting Backspace once will get back to the starting state. (assuming columns == 4).
The tab vs spaces flame wars have good arguments on both sides :
Pro Spaces
There is no standard for what a
tab
character means. The onlystandard
is 8 columns, which virtually nobody uses. Storing text documents with spaces ensures they look correct everywhere.
Pro Tabs
Your editor should never allow misalignment.
Manually tinkering with spaces is a waste of time an effort.
The tab key should always indent by the correct amount.
The caret should never appear part-way within an indentation.
My choice of indentation size should have no bearing on your choice. Using spaces forces us to use the same indentation width.
Using spacesIndentation with behaveLikeTabs solves these issues except for the last one. Well, it would, if every editor had a behaveLikeTabs option. I've yet to see another editor with this feature. A first for Glok?
At the very least this option should be a god-send for tab-lovers who are forced to work with spaces!
Note. This feature only works for indentation at the start of a line. IMHO, adding tab-character mid-line is crazy. I had a coworker who spent ages, lining up code with mid-line tab-characters, and it was unreadable everywhere other than his editor. This is a problem for indentation within dokka comments. WTF are all those asterisks for anyway? IDK.