-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigator not updating often enough #10
Comments
Currently, I use universal-ctags to check tag/symbol when file is saved already and not check them on buffer. |
This is what I got so far, but I cant get it to work. Currently, once the new event happens, the tree disappears, but it is not drawn again. I dont know what is missing, maybe you can fix it. In populate() {
const editor = this.getEditor();
this.statusBarManager.setEmptySymbolLabel();
if (editor != null) {
let filePath = editor.getPath();
if (filePath !== this.previousFilePath || this.refreshTag) {
this.generateTags(filePath);
this.refreshTag = false;
this.currentTag = null;
}
this.previousFilePath = filePath;
this.onEditorSave = editor.onDidSave((event) => {
filePath = event.path;
this.generateTags(filePath);
});
// I ADDED THIS
this.onEditorStopChanging = editor.onDidStopChanging((event) => {
filePath = event.path;
this.generateTags(filePath);
});
this.statusBarManager.update(this.currentTag);
this.onChangeRow = ... and: removeEventForEditor() {
if (this.onEditorSave != null) {
this.onEditorSave.dispose();
}
// I ADDED THIS
if (this.onEditorStopChanging != null) {
this.onEditorStopChanging.dispose();
}
if (this.onChangeRow != null) {
this.onChangeRow.dispose();
}
} |
Hi @tweakimp , |
Currently, the navigator is only updating when I go to another file or save the current file.
But when I delete a function definition for example, the function still stays in the navigator until I save.
I think it should check if there was a change or just redraw the tree more often.
I suggest this event subscription. I tried to put it in myself, but I could get it to work.
The text was updated successfully, but these errors were encountered: