Closed firai closed 10 months ago
Yes, as far as I can tell. The code block and the console.warn
were copied from here: https://github.com/jupyterlab-contrib/jupyterlab-vim/blob/f08ef414dd2908171b56768319205b1b3a33dd65/src/index.ts#L87-L104
Do you have any suggestions on what the console.warn
should be replaced with? Also, I suppose I'm supposed to refactor this out into a function so that it isn't duplicated?
Well, the difference is that when vim:enter-normal-mode
is run we expect the current widget to be vim-enabled, but shell.currentChanged
will fire for any kind of a widget. I would say you could use console.debug
or just remove it (if you want to leave the logic for clarity you can add // no-op
comment).
IMO duplication is fine as these are slightly different contexts.
The build process fails without the if (!current)
code path, so I'll replace with no-op comments
Fixes #103.
On
ILabShell
currentChanged()
, check ifcurrentWidget
matches one tracked byeditorTracker
ornotebookTracker
, and callmodifyEditor()
ormodifyCell()
accordingly.@krassowski, can you please help review whether this is right approach?