edit-comptext plugin and CodeMirror

217 views
Skip to first unread message

History Buff

unread,
Aug 23, 2020, 7:05:26 PM8/23/20
to TiddlyWiki
All,

I use the edit-comptext plugin extensively because it saves me huge amounts of time. However, I've found that it doesn't seem to work with CodeMirror.

I would love to use CodeMirror for the latest syntax highlighting features, but can't get myself to not use edit-comptext.

Does anyone know how to make it work with CodeMirror or if there is something equivalent?

Thanks,

Damon

TW Tones

unread,
Aug 23, 2020, 11:11:41 PM8/23/20
to TiddlyWiki
History Buff/Damon,

It helps sharing the plugin you refer to https://snowgoon88.github.io/TW5-extendedit/, I don't use it presently.

But on reviewing it there is an Editor  toolbar Button to help do this that works in code mirror and others are working on a range of alternative that can achieve the same and more discussed in the last month.

Codemirror is more sophisticated than the standard edit and as a result does not present a simple textarea to the browser that some plugins, and even some browser add-ons are designed to address. 

Perhaps you could state what specifically you can't do without in the edit-comptext functionally, not with a plugin specific reference?

Regards
Tony

History Buff

unread,
Aug 24, 2020, 1:40:49 PM8/24/20
to TiddlyWiki
Hey Tony,

Thanks for the reminder to include a link to the plugin I'm referring to. I don't have that good habit yet.

The functionality of edit-comptext that I haven't been able to get to work is the autocompletion feature. For example, to link to another tiddler within my wiki, in edit-comptext I start typing [[ and a few characters and it pulls up a list of the tiddler titles that start with the characters that I type. I can then use the arrow keys to scroll through the list and pick the one I'm looking for. Since I have nearly 3,000 tiddlers, this is extremely helpful because I can't possibly remember the exact title of every tiddler. I know in the plugin that I have to select the editor type as comptext which is probably part of the problem.

When you refer to an editor toolbar button, are you refering to the plugin or CodeMirror? I don't see a toolbar button with the plugin.

Thanks,

Damon

Saq Imtiaz

unread,
Aug 24, 2020, 4:12:09 PM8/24/20
to TiddlyWiki

History Buff

unread,
Aug 24, 2020, 5:18:37 PM8/24/20
to TiddlyWiki
Thanks Saq,

I'll give that a try.

Damon

TW Tones

unread,
Aug 24, 2020, 6:17:39 PM8/24/20
to TiddlyWiki
Damon,

In the standard editor Toolbar the "link icon" allows insertion of a tiddler title after searching for the tiddler.

There are numerous tools on the works that will allow what you are asking including Saq's suggestion.

As an old timer with tiddlywiki now I often see solutions to questions build for which there was an acceptable if not perfect solution already available.

I urge all users to search for and experiment on tiddlywiki.com or a playground wiki with any problem because many are already solve, please continue to ask here.

Regards
Tony

Adithya B

unread,
Aug 25, 2020, 3:55:41 AM8/25/20
to TiddlyWiki
Tony, 

The link icon on the editor toolbar does work and hopefully with the new keyboard-only features of 5.1.23, it will be even better.

However, why is it that I cant use editor keyboard shortcuts when the editor toolbar is hidden?
This goes against reason - I would want to hide the editor controls and use TW with only the shortcuts. Is this possible?

Adithya

Birthe C

unread,
Aug 25, 2020, 5:51:54 AM8/25/20
to TiddlyWiki
Adithya,

I do not know, but a guess would be it has to do with the iframe in use when using Editor toolbar. Still wanting the functionality though from the keyboard....does that also need the iframe? Sorry if I am totally stupid here.

Birthe

TW Tones

unread,
Aug 25, 2020, 6:58:43 PM8/25/20
to TiddlyWiki
Adithya


However, why is it that I cant use editor keyboard shortcuts when the editor toolbar is hidden?
This goes against reason - I would want to hide the editor controls and use TW with only the shortcuts. Is this possible?


I think this is a good Question. I expect the original idea was if people wanted the toolbar functionality or not. 
  • I believe the editor keyboard shortcuts override the wiki keyboard shortcuts, so you may understand why people may want Editor shortcuts turned off
  • Perhaps we can hack the tool bar or raise a issue on github for it to be addressed.

Research for further study

The tiddler 

$:/core/ui/EditTemplate/body is where $:/core/ui/EditTemplate/body/editor is transcluded,

Within 

$:/core/ui/EditTemplate/body/editor we see transclusion of $:/core/ui/EditTemplate/body/toolbar/button that deals with each Editor toolbar button and defines its shortcut.


Regards
TW Tones


JD

unread,
Aug 25, 2020, 11:12:28 PM8/25/20
to TiddlyWiki
Adithya, 

A fix I use for this is a stylesheet that can be toggled... 

.tc-editor-toolbar {
 height: 0;
 overflow: hidden;
 padding: 0;
}

A hack of a fix, because the toolbar is still in the dom. A toolbar keyboard shortcut is defined in the button's tiddler itself, so removing the toolbar, as what the current method does when toggling at ControlPanel, removes the functionality. This should probably be opened as an issue on Github

-jd
Reply all
Reply to author
Forward
0 new messages