Skip to content

Commit a4a2df7

Browse files
Fix Symbol Pane not updating on external file reversion (#1715) (#1716)
Trigger symbol refresh when the document is reloaded externally (e.g., via git reset) or reverted, rather than relying solely on internal buffer changes. Co-authored-by: Jeremy Wootten <jeremywootten@gmail.com>
1 parent 4b6e1f7 commit a4a2df7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/Services/Document.vala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,10 @@ namespace Scratch.Services {
818818
public void revert () {
819819
this.source_view.set_text (original_content, false);
820820
check_undoable_actions ();
821+
822+
if (outline != null) {
823+
outline.parse_symbols ();
824+
}
821825
}
822826

823827
// Get text
@@ -981,6 +985,10 @@ namespace Scratch.Services {
981985
set_saved_status (true);
982986
source_view.buffer.set_modified (false);
983987
loaded = true;
988+
989+
if (outline != null) {
990+
outline.parse_symbols ();
991+
}
984992
return;
985993
}
986994

@@ -1102,6 +1110,10 @@ namespace Scratch.Services {
11021110
last_save_content = source_view.buffer.text;
11031111
set_saved_status (true);
11041112
locked = false;
1113+
1114+
if (outline != null) {
1115+
outline.parse_symbols ();
1116+
}
11051117
break;
11061118
case 1: // Overwrite
11071119
// Force save, unlock to allow saving to same location

0 commit comments

Comments
 (0)