Closed Danp2 closed 1 year ago
Hmmmm, for window.onDidChangeVisibleTextEditors
, the first parameter is a listener, which means that VSCode expects the parameter to return a function for it to call when the event happens. Setting the parameter to be trimOutputLines()
directly means that when the event happens, VSCode attempts to call undefined
-- the "nothing" that trimOutputLines()
is currently built to return.
Ummm...trimOutputLines
should be passed to window.onDidChangeVisibleTextEditors
not executed...:
window.onDidChangeVisibleTextEditors(trimOutputLines);
No need for an extra wrapper.
Ah, so my inclusion of the parens was the mistake?
Yes, you basically executed the function one time instead of letting window.onDidChangeVisibleTextEditors
execute it each time output console changed.
The changes made in https://github.com/loganch/AutoIt-VSCode/commit/2ab9aeb695cd79ba5b78da894dd397169a7819ff result in a runtime error --
Changing this line https://github.com/loganch/AutoIt-VSCode/blob/f5b762314df2f44a7d08730dab4dfd534bb8dea6/src/ai_commands.js#L165 to
window.onDidChangeVisibleTextEditors(() => { trimOutputLines() });
eliminates this error.Two questions --
subscriptions
array. Is this needed here?