Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE Elastic Tabstops #175

Open
RobertBColton opened this issue Sep 1, 2015 · 2 comments
Open

RFE Elastic Tabstops #175

RobertBColton opened this issue Sep 1, 2015 · 2 comments

Comments

@RobertBColton
Copy link

I am not sure if this has been considered before but I'd like to bring it up. Elastic tabstops is a new way of solving the old tabs vs. spaces dillema by treating vertical tabs as TSV to achieve block alignment.
http://nickgravgaard.com/elastic-tabstops/

It has been implemented in a number of editors including Google's new Go programming language, Sublime, Visual Studio, Eclipse (halted by a bug), and there has been talks of Atom support.
https://github.com/SublimeText/ElasticTabstops
Elastic Tabstops

The approach has been to implement it for the vertical tab character to not break existing tab indentation and also because it solves rare edge cases such as python as in the following:

def foo( bar,
         xyzzy ):
         wibble() # Too much indentation

So that you can get the following instead:

def foo( bar,
         xyzzy ):
    wibble()

Basically normal tabs would be for indentation and vertical tab would be for columnar alignment. The reason being also that vertical tabs have really no need for anything but every editor and parser still usually treats them as whitespace.

I feel this would be a really great feature to set RTFX apart from a lot of other editors in a very good way and something I would like to see. Even if implemented as an optional feature I would like to see it enabled by default as well.

@TomasMikula
Copy link
Member

It is a nice feature, but not trivial to implements. Currently, the document is a list of TextFlows. This would have to change to a list of TextFlows or tables of TextFlows, where deciding what is going to be a single TextFlow and what is going to be a table has to be detected automatically. It is an interesting challenge that I would like to take on if I had the bandwidth for it, but I don't see that happening in the near future. Of course anyone is welcome to take on the task.

@nick-gravgaard
Copy link

I just saw this issue and wanted to point out that that my elastic tabstops invention does not propose using the vertical tab character for anything, and never has. Elastic tabstops uses normal tab characters. It just means that the tabstops are set dynamically according to the text in the buffer. Using tabs to jump to the next fixed tabstop, and vertical tabs to jump to a different set of elastic tabstops would be very confusing and hard to use. Imagine having two different kinds of tabstop - ugh!

One of the arguments against using tab characters for indenting is that people sometimes have a hard time telling the difference between a tab and a space. Introducing a new whitespace character would make that even worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants