TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.98k stars 1.18k forks source link

[BUG] CodeMirror e.toggleComment is not a function #4550

Closed linonetwo closed 4 years ago

linonetwo commented 4 years ago

Describe the bug I've installed the codemirror editor, and try to edit a css file.

When I press command+/ to toggle comment, this error pops up.

To Reproduce Steps to reproduce the behavior:

  1. Install codemirror plugin and sublime keymap, and enable that keymap
  2. Create a code tiddler with css
  3. press command+/
  4. See error

Expected behavior No error, and comment is toggled

Screenshots

Screen Shot 2020-04-11 at 12 04 40 PM

Desktop (please complete the following information):

linonetwo commented 4 years ago

I know the source is in https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/codemirror-keymap-sublime-text/files/keymap/sublime.js

But it is minimized so difficult to fix.

How can I found the source and debug? And I'd like to make a VSCode keymap, I also need a reference to modify from.

BurningTreeC commented 4 years ago

Thanks for the bug-report @linonetwo

This is probably related to https://github.com/codemirror/CodeMirror/issues/5917

@pmario, what do you think, should we include comments.js somewhere?

pmario commented 4 years ago

@pmario, what do you think, should we include comments.js somewhere?

I think it should be included, if it is needed.

pmario commented 4 years ago

It seems we "just" missed it ;)

BurningTreeC commented 4 years ago

We'll need to find the plugin which requires comment.js - the sublime keymap doesn't do so

pmario commented 4 years ago

may be they also missed to define the dependency.

pmario commented 4 years ago

comment.js is part of the addOns section: https://codemirror.net/doc/manual.html#addons