Window Watcher

Summary

Watches changes in active window and notifies subscribers of changes

Entry

Lifecycle

activateWatchers {
  new WindowWatcher
}
WindowWatcher.active {

  // for logging only
	window.onDidChangeVisibleTextEditors
			- log "WindowWatcher:onDidChangeVisibleTextEditors", editorPaths

	window.onDidChangeActiveTextEditor @onDidChangeActiveTextEditor

	window.onDidChangeTextEditorVisibleRanges @onDidChangeTextEditorVisibleRanges
}


onDidChangeActiveTextEditor(doc) {
    ctx = "WindowWatcher:onDidChangeActiveTextEditor"
		...

    @triggerUpdateDecorations
    @triggerNoteGraphViewUpdate

    @onDidChangeActiveTextEditorHandlers.each { it.call }

    if newlyOpened(doc) @onFirstOpen
}

onDidChangeTextEditorVisibleRanges {
		...
    @triggerUpdateDecorations {
      // calls updateDecorations
    }
}

Calls


Backlinks