fix: clear file tree filter when expanding a folder
This commit is contained in:
parent
90106e32f0
commit
7708457bb8
1 changed files with 3 additions and 3 deletions
|
|
@ -301,6 +301,9 @@ fn select(menu: **Type.MenuType, button: *Type.ButtonType, _: Type.Pos) void {
|
||||||
if (node.type_ == .folder) {
|
if (node.type_ == .folder) {
|
||||||
node.expanded = !node.expanded;
|
node.expanded = !node.expanded;
|
||||||
|
|
||||||
|
palette.inputbox.text.shrinkRetainingCapacity(0);
|
||||||
|
palette.inputbox.cursor = tui.egc_chunk_width(palette.inputbox.text.items, 0, 8);
|
||||||
|
|
||||||
if (node.expanded and node.children == null) {
|
if (node.expanded and node.children == null) {
|
||||||
request_node_children(palette, node) catch |e| {
|
request_node_children(palette, node) catch |e| {
|
||||||
palette.logger.err("request_node_children", e);
|
palette.logger.err("request_node_children", e);
|
||||||
|
|
@ -312,9 +315,6 @@ fn select(menu: **Type.MenuType, button: *Type.ButtonType, _: Type.Pos) void {
|
||||||
palette.entries.clearRetainingCapacity();
|
palette.entries.clearRetainingCapacity();
|
||||||
if (palette.value.root_node) |root| build_visible_list(palette, root, 0) catch return;
|
if (palette.value.root_node) |root| build_visible_list(palette, root, 0) catch return;
|
||||||
|
|
||||||
palette.inputbox.text.shrinkRetainingCapacity(0);
|
|
||||||
palette.inputbox.cursor = tui.egc_chunk_width(palette.inputbox.text.items, 0, 8);
|
|
||||||
|
|
||||||
const new_idx = for (palette.entries.items, 0..) |e, i| {
|
const new_idx = for (palette.entries.items, 0..) |e, i| {
|
||||||
if (e.node == node) break i + 1;
|
if (e.node == node) break i + 1;
|
||||||
} else 0;
|
} else 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue