The problem with using list-ops and toggle is that if the starting value of the config tiddler is say codemirror
, you will end up with a value of codemirror edit
and a non-functioning editor.
Recommend something more along these lines:
\whitespace trim
[img width=16 [$:/plugins/oeyoews/tiddlywiki-codemirror-6/icon]]
<$let
type={{{ [<currentTiddler>get[type]else[text/vnd.tiddlywiki]] }}}
configTitle=`$:/config/EditorTypeMappings/$(type)$`
currentEditor={{{ [<configTitle>get[text]] }}}
>
<$action-setfield $tiddler=<<configTitle>> text={{{ [<currentEditor>match[codemirror-6]] :then[[text]] :else[[codemirror-6]] }}} />
</$let>