File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -853,17 +853,21 @@ export const activate = (context: vscode.ExtensionContext): void => {
853853 // TODO: investigate possible performance issues with this
854854 // when an undo or redo contains our magic character, perform it twice as adding
855855 // and removing the magic character is an extra item on the undo stack
856- vscode . workspace . onDidChangeTextDocument ( ( event ) => {
857- if ( event . contentChanges [ 0 ] ?. text === MAGIC_CHARACTER ) {
858- if ( event . reason === vscode . TextDocumentChangeReason . Undo ) {
859- vscode . commands . executeCommand ( "undo" )
860- } else if ( event . reason === vscode . TextDocumentChangeReason . Redo ) {
861- vscode . commands . executeCommand ( "redo" )
862- } else {
863- // ignore undefined event reasons (e.g. typing)
856+ vscode . workspace . onDidChangeTextDocument (
857+ ( event ) => {
858+ if ( event . contentChanges [ 0 ] ?. text === MAGIC_CHARACTER ) {
859+ if ( event . reason === vscode . TextDocumentChangeReason . Undo ) {
860+ vscode . commands . executeCommand ( "undo" )
861+ } else if ( event . reason === vscode . TextDocumentChangeReason . Redo ) {
862+ vscode . commands . executeCommand ( "redo" )
863+ } else {
864+ // ignore undefined event reasons (e.g. typing)
865+ }
864866 }
865- }
866- } )
867+ } ,
868+ null ,
869+ context . subscriptions
870+ )
867871
868872 if ( DEBUG ) {
869873 vscode . window . showInformationMessage ( "jsdoc comment toggler loaded" )
You can’t perform that action at this time.
0 commit comments