CodeMirror 6 plugin Beta

Hi @BurningTreeC, it seems I have a CSS rule somewhere that makes all the AC text white-on-white:

image

The problem is, I can’t figure out which rule it is, because any interaction with the PC closes the popup, i.e. I cannot look at its CSS rules in the Inspector. I even had to use a delayed screenshot tool to take the screenshot above since pressing the key combination for a regular screenshot would close the popup before taking the shot. In that sense it is even less tangible than a Windows context menu popup. TW popups are much more permanent and easy to style in that regard.

Do you have any ideas what I could do?

Yaisog

Hi @Yaisog

what palette are you using?

Thanks,
Simon

My approach of last resort for these situations is to trigger the debugger from the console with a delay:

setTimeout(function() {debugger;}, 5000);

@BurningTreeC I have a lot of custom CSS in my wiki. It’s probably one of those rules. I just cannot identify which. Is the DOM structure of the popup documented somewhere? I could insert an override rule or an exception if I just knew what to target…

@saqimtiaz That worked! Thanks for the tip. I’ll dig into the CSS now…

Hi @BurningTreeC I think I traced the problem back to a missing line in $:/palettes/Vanilla/extend that should be something like
cm-tooltip-foreground: <<colour foreground>>

Adding this line fixed it for me. The codemirror CSS does try to look up that particular value.
I only checked Vanilla, don’t know about the other palettes.

Yaisog

Thank you @Yaisog !

Yes that parameter is probably missing in all extended palettes.
I’ll fix that!

Thank you

Hi all,

I’ve updated the plugin to version 0.1.15

ATTENTION: tiddler-title completions, widget completions, variable completions and filter completions are removed

That’s because the current implementation is too error prone

2 Likes

Thanks I am taking a deep dive now.

A question that only occurred to me now, is access to the traditional editor with Codemirror installed possible?.

The way codemirror 5 was implemented it was one or the other because code mirror changes quite a few core tiddlers. With a bit of hacking I managed to create a tiddler preview that gave access to the standard editor.

  • This was essential as I am a terrible speller (That part of my brain is used for other things) and code mirror 5 did not have spell check, I understand code mirror six does now pewrmit spell check.
  • I still however see value in cases where we may want access to the standard editor.

Do you have any insights as to how we may code or select the standard editor without plugin enable disable?

  • Or do you think it is basically the same as with codemirror 5?

Thanks for your effort.

Hi @TW_Tones

the codemirror-6 editor isn’t used if the type of the tiddler isn’t recognized
so if you set the type to “text” for example, the standard tiddlywiki editor is used

The only thing that changes is the buttons available, I still see the line numbers coming from code mirror and of course the output preview is not wikified.

  • Will investigate further but if you have any more to share I look forward to it.

Hmm…

what you’re looking for is a switch that disables the codemirror-6 editor for text/vnd.tiddlywiki ?

Yes, per tiddler ideally, but worst case is to have to toggle it off and on with a disable, save and reload.

  • Since raising my question I looked at the contents of the plugin and there seems to be just too much core tiddler replacement to make this possible, without a recode.
  • It seems to me to be better to create a separate “text editor” or special preview, based on the original one, or use the more limited edit widget.
    • I may be able to do something through the Edit Template Body Cascade.
  • So on review, I think codemirror has always being tightly integrated and hard to integrate more loosely.

simplescreenrecorder-2023-10-14_17.05.32

Hello @vyug18,
can’t replicate your issue… it’s working fine for me.

1 Like

Works in firefox
Linux Chromium Version 118.0.5993.70 (Official Build) snap (64-bit) and
Ungoogled-chromium Версия 113.0.5672.127 not working

Thanks, it’s fixed. Here’s another one, but it’s not so critical.simplescreenrecorder-2023-10-14_19.31.29

Thank you @vyug18

This one is now fixed

Just to be clear here my suggestion is you consider dropping the code mirror auto completion features so it is “not yours or code mirrors responcibility” and acting to make it possible to use the feature rich autocomplete plugin instead

  • bracket closure may be an exception
  • in this way you excise this complexity from code mirror and let users make use of a more generic tool that also works inside and outside code mirror.

Of course this is totaly your call because you know more about the issue than I. But perhaps we can help.

Hi @TW_Tones

the codemirror autocompletion features are baked into the various languages
if you use a tiddler of type application/javascript for example or text/markdown you will see that there’s semantic autocompletion

tiddlers of type text/vnd.tiddlywiki have only the anyword autocompletion feature if it’s switched on

I could turn autocompletion totally off but that would cut a very useful feature and I won’t do so

Hi @BurningTreeC,

width of texteditor / preview changes after update plugin from v0.1.19 → v0.1.20: