discussion: codemirror editor and improved indentation handling

184 views
Skip to first unread message

PMario

unread,
Apr 25, 2018, 3:55:52 AM4/25/18
to TiddlyWiki
Hi folks,

I wanted to move this discussion to its own thread, since it is "off topic" in the thread, where it came up.

There is a proposal to improve indentation handling:

On Wednesday, April 25, 2018 at 5:09:27 AM UTC+2, TonyM wrote:
Mario,

I hear all you are saying.  On Further consideration.
  • The main need I have for tabs in wiki-text  tiddlers is for structuring information in edit mode so that it is more reasonable to read. I could live with its invisible non line break if in some modes I could see them, and even if not rendered in the View Template.
  • The secondary need I have, which many authors and content provides has is for indent in this case ":" works for this in tiddlywiki (although on my keyboard it is a shift-: and you have to place ":::" at the beginning of a line not while you are typing.
  • The final need is to organise text in simple columns, this is when it is displayed as well, and its helpful that tab"text" moves it to the next tab position.
A work around for this last items would be
|*|Item|detail|
|*|Item 2|detail|

if I could easily make the table boarders disappear.

Regards
Tony

On Wednesday, April 25, 2018 at 10:54:33 AM UTC+10, PMario wrote:
On Wednesday, April 25, 2018 at 2:30:45 AM UTC+2, TonyM wrote:
Using the CodeMirror plugin I can insert tabs in the text, long desired. However the tabs only show in edit mode, not view mode

Tabs are __not__ a "styling" element. They are treated as whitespace in HTML.
 
However if a line has one or more tab characters in it it is not visible yet it is no longer blank and will cause text to move up and join the line before. ie; same paragraph.

That's an issue or feature request. ... I think you could start a new thread for codemirror only. ... It may be possible to create a setting, that shows whitespace, like spaces and tabs ...
 
This could frustrate a lot of people trying to debug their tiddler view content.

As I wrote. Either create a new issue at github or start a new thread in the group. So it won't be forgotten.
 
Solutions?, A edit/View mode that shows hidden characters,

Should be possible.
 
or honour tabs in view mode such that they also end the paragraph/

no .. Only 2 "new lines" ends a paragraph. 

If tabs cause a lot of problems, we will need to turn them off for TW wikitext. They are invisible anyway.

Tabs can only be used for json, data tidlers, CSS, SVG and javascript code.

have fun!
mario

Thomas Elmiger

unread,
Apr 25, 2018, 12:24:48 PM4/25/18
to TiddlyWiki
Hi Mario and Tony

Just a short note on tab styling. In my design approach on https://tid.li/tw5/test/bricks.html
I use the following CSS to see tab indenting everywhere:

body {
-moz-tab-size: 3;
tab-size: 3;
}

Cheers,
Thomas

TonyM

unread,
Apr 25, 2018, 9:20:48 PM4/25/18
to TiddlyWiki
Thomas,

Are you inserting the above in a stylesheet then entering tabs with the code mirror editor.

Because when I do it does not seem to honour the tabs in the text in view mode.

Regards
Tony

Thomas Elmiger

unread,
Apr 26, 2018, 4:33:10 PM4/26/18
to TiddlyWiki
You are right, Tony.

Everywhere was much exaggerated :–/

In every editor might be more correct (with and without code mirror). TW rendering seems to remove tabs from view mode.

Best regards,
Thomas
Reply all
Reply to author
Forward
0 new messages