User talk:Nardog/CodeEditorAssist

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Doesn't work while adding a codeblock in VisualEditor[edit]

@Nardog: In VE, the Insert > Code block option (or the edit option on an existing code block) summons the CodeEditor (one of the best ways to edit code embedded in wikitext). But the CodeEditorAssist settings don't work over there. Could this be easily taken care of? – SD0001 (talk) 11:18, 30 April 2021 (UTC)[reply]

@SD0001: Thank you for the feedback! I never knew such a thing existed. (It doesn't even work properly on my end. Initially, the editor scrolls to the right by the same width as the letter as I type, hiding the entire code.) I briefly roamed around the relevant repos but it doesn't look very easy to me, unfortunately. Is there an event that can be accessed from the global scope that fires when the dialog is opened?
I have a patch for T261118 by the way, which I haven't submitted because I'm still waiting for the patch for T102486 to be merged, which has overlapping lines (I know I can submit it with the other patch as a dependency, I've just been lazy). That would of course not work with other interfaces using Ace, including the edit filter editor, which is the only one this script currently covers. Nardog (talk) 23:40, 30 April 2021 (UTC)[reply]
@Nardog: No idea about VE events. I see that the VE code is at ve.ui.MWAceEditorWidget.prototype.setupEditor. It even has a `this.editor.setOptions` line already. – SD0001 (talk) 07:59, 2 May 2021 (UTC)[reply]
And very similar looking code for edit filter editor here. – SD0001 (talk) 08:01, 2 May 2021 (UTC)[reply]
@SD0001: I figured this could be done by outright overriding setupEditor() (see code). Is that what you were hinting at? (If so it was so hacky it didn't occur to me!) Let me know if there's any problem or a better way. Nardog (talk) 09:24, 31 January 2022 (UTC)[reply]