MPS-extensions icon indicating copy to clipboard operation
MPS-extensions copied to clipboard

Add support for tab-literals

Open JoostvanPinxten opened this issue 5 years ago • 4 comments

I'd like to generate tab-delimited files with plaintextgen. The current work-around is to split-extract some whitespace (tabs are 'imported' as 4 spaces), and adding a property macro that returns a tab literal "\t". The exported file then contains a tab literal.

Unfortunately, there seems to be no support for adding literal tabs otherwise, so I will try to make a pull-request for:

  • showing literal tab characters (via a special arrow glyph?)
  • editor support (via intention) to insert a literal tab
  • importing unstructured text with literal tabs in the body (not at the start of the file)

JoostvanPinxten avatar Apr 02 '19 13:04 JoostvanPinxten

I haven't tested this change with the flow language, but the tab literal works quite well in combination with the indentlayout.

Of course, contrary to this tab construct, the indent layout can nest arbitrary levels (and perhaps should also be able to indent with literal tabs instead of spaces only).

JoostvanPinxten avatar Apr 03 '19 13:04 JoostvanPinxten

@eugenschindler this might be a great way to check #159 ;-)

JoostvanPinxten avatar Apr 03 '19 14:04 JoostvanPinxten

Can you please do a pull request to check and merge it back?

eugenschindler avatar Apr 03 '19 15:04 eugenschindler

I should still fix two things:

  • On copy unstructured text (keep tab literals), remove empty words (e.g. tab at start of line, or two consecutive tabs)
  • The tab literal is not as wide as I had it in my development environment, need to look into that

JoostvanPinxten avatar Jul 10 '19 13:07 JoostvanPinxten