Skip to content

Commit 75673c5

Browse files
committed
fix: snippet bar should (un)collapse additional snippet buttons in horizontal layout mode
1 parent 4b7a6d0 commit 75673c5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/yasgui/src/Tab.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ export class Tab extends EventEmitter {
337337
// Refresh components to adjust to new layout
338338
if (tab.yasqe) {
339339
tab.yasqe.refresh();
340+
// Trigger snippets overflow detection after layout change
341+
tab.yasqe.refreshSnippetsBar();
340342
}
341343
if (tab.yasr) {
342344
tab.yasr.refresh();
@@ -1061,6 +1063,8 @@ WHERE {
10611063
// Refresh editors after resizing
10621064
if (this.yasqe) {
10631065
this.yasqe.refresh();
1066+
// Trigger snippets overflow detection after horizontal resize
1067+
this.yasqe.refreshSnippetsBar();
10641068
}
10651069
if (this.yasr) {
10661070
this.yasr.refresh();

packages/yasqe/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,10 @@ export class Yasqe extends CodeMirror {
767767
}
768768
// Refresh the editor to make sure the 'hidden' lines are rendered
769769
this.refresh();
770+
// Trigger snippets overflow detection after resize
771+
if (this.snippetsResizeHandler) {
772+
this.snippetsResizeHandler();
773+
}
770774
}
771775
public duplicateLine() {
772776
const cur = this.getDoc().getCursor();
@@ -1292,6 +1296,10 @@ export class Yasqe extends CodeMirror {
12921296

12931297
public refreshSnippetsBar() {
12941298
this.drawSnippetsBar();
1299+
// Also trigger overflow detection after redrawing
1300+
if (this.snippetsResizeHandler) {
1301+
this.snippetsResizeHandler();
1302+
}
12951303
}
12961304

12971305
/**

0 commit comments

Comments
 (0)