TW5 CodeMirror bug when using Vim emulation

169 views
Skip to first unread message

R Ax

unread,
May 7, 2015, 2:16:58 PM5/7/15
to tiddl...@googlegroups.com
Hi guys,

I get the following error message whenever I type the characters '#' or '~' in insert mode of vim emulation for CodeMirror.

"TypeError: keyName.indexOf is not a function"

I noticed a similar bug reported a year ago which was triggered by the '=' character and which since appears to have been fixed.

Any ideas?

regards

Jeremy Ruston

unread,
May 18, 2015, 2:13:36 PM5/18/15
to TiddlyWiki, R Ax
Hi R Ax

My apologies for the late reply. I'm not familiar with vim; could you kindly list the step-by-step instructions that will reproduce the bug on http://tiddlywiki.com/plugins/tiddlywiki/codemirror/?

Many thanks,

Jeremy,

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4ca09d5c-839c-4228-b190-aee17f78bd5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

R Ax

unread,
May 18, 2015, 6:02:40 PM5/18/15
to tiddl...@googlegroups.com, jeremy...@gmail.com, rax....@gmail.com
Hi Jeremy,

Thanks for the response.

I can't reproduce the bug on the tiddlywiki site because I can't save changes there. To reproduce the bug yourself, do the following;

1. Create a new tiddler titled $:/config/CodeMirror.
2. Paste the following code into this new tiddler;

{
  "require": [
      "$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js",
      "$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js",
      "$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js",
      "$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js",
      "$:/plugins/tiddlywiki/codemirror/keymap/vim.js",
  ],
  "configuration": {
      "keyMap": "vim",
      "matchBrackets":true,
      "showCursorWhenSelecting": true
  }
}

3. Set the type field of this tiddler to application/json.
4. Refresh for the changes to take effect.
5. If you now attempt to edit any tiddler, you will see a block cursor. Vim is a modal editor and starts off in command mode.
6. Press the 'i' key. This will switch to insert mode. You can now type as for a normal editor.
7. Entering the '#' or
'~' key however should reproduce the error I described.

Further details on configuring CodeMirror (which is where I got the information on setting it up from) are to
be found in $:/plugins/tiddlywiki/codemirror/usage.

Thank you so much for your help.

R Ax

unread,
Jun 1, 2015, 1:33:11 PM6/1/15
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy and others,

Any progress on this?

Alternatively, can anyone tell me how to invoke an external editor for a tiddler. I'd rather be working with a fully-functional version of Vim than the cutdown version as implemented by CodeMirror.

Thanks

D. A. Holton

unread,
Jun 2, 2015, 8:21:44 AM6/2/15
to tiddl...@googlegroups.com, jeremy...@gmail.com
caveat: I am a very basic/beginning user of TWC.
I don't like coming into a conversation in the middle, but.....here goes:

"...can anyone tell me how to invoke an external editor for a tiddler?"

I do all my editing in gvim using FireFox, and I use an Extension called "It's All Text!".  This enables you to set up an external editor to launch for ANY text field in a web page.  You point it to your favorite editor, and in any text field it will put a small button that reads "Edit".  You click that button to launch your editor.  Sometimes I have to click it twice.  Also, you can set up a hot key to launch.  It seems to work in both Linux (my environment), and Windows w/ gvim installed.

I have not yet found an alternative for Chrome which is the only other browser I use.

--
Dave H

R Ax

unread,
Jul 6, 2015, 2:45:41 PM7/6/15
to tiddl...@googlegroups.com, jeremy...@gmail.com
Dave,

Sorry about late reply. Yes, I know about It's All Text and have used it successfully before on a Linux and Windows 7 box. (In fact, if you use Vimperator and configure _vimperatorrc properly, you don't even need to use It's All Text.) However, I have been unable to make this work on a Windows 8.1 box.

Thanks anyway.
Reply all
Reply to author
Forward
0 new messages