cell block local function reference code highlight bug:

Minor bug: draw appears to be grayed out in this code line: .on(‘word’, draw);

see code behind cloud cell:

Yep, unfortunately that one has an existing issue in CodeMirror and no clear strategy for a fix, because hoisting requires CodeMirror to color something differently based on code that comes after it.

Workaround: don’t ever use the bare function foo(bar) {} syntax. Instead assign functions to variables like const foo = function foo(bar) {}.

Hoisting is a pain to reason about even for humans.

@jrus well, that’s an easy fix. yeah, defining those functions outside of code block def. solves the issue.

I just sort of stumbled on it yesterday and thought it was odd for inner functions and closures :slight_smile:

@tom that CodeMirror issue link is 404, but thanks for looking into it and jotting a note