Skip to content

Commit 4706401

Browse files
committed
redraw window on new suggestions
1 parent f695cab commit 4706401

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/suggestion/manager.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ pub fn showSuggestions(current_text: []const u8, current_word: []const u8, x: i3
140140
hideSuggestions();
141141
}
142142
}
143+
143144
/// Update the position of suggestions if visible
144145
pub fn updateSuggestionPosition() void {
145146
if (autocomplete_ui_manager.is_visible) {

src/ui/suggestion_ui.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ pub const AutocompleteUI = struct {
7676

7777
// Show UI suggestion list near cursor position
7878
try self.showSuggestionUI(x, y);
79+
80+
// Force a redraw of the window if it already exists
81+
if (self.suggestion_window != null) {
82+
_ = api.InvalidateRect(self.suggestion_window.?, null, 1);
83+
_ = api.UpdateWindow(self.suggestion_window.?);
84+
}
7985
} else {
8086
self.hideSuggestions();
8187
}

0 commit comments

Comments
 (0)