mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-02 00:51:15 -03:00
Factor repainting decions from readline commands better in the reader
When typing into the command line, some actions should trigger repainting, others should kick off syntax highlighting or autosuggestions, etc. Prior to this change, these were all triggered in an ad-hoc manner. Each possible This change centralizes the logic around repainting. After each readline command or text change, we compute the difference between what we would draw and what was last drawn, and use that to decide whether to repaint the screen. This is a fairly involved change. Bugs here would show up as failing to redraw, not reacting to a keypress, etc. However it better factors the readline command handling from the drawing.
This commit is contained in:
@@ -197,7 +197,7 @@ void env_dispatch_var_change(const wcstring &key, env_stack_t &vars) {
|
||||
|
||||
// Eww.
|
||||
if (string_prefixes_string(L"fish_color_", key)) {
|
||||
reader_react_to_color_change();
|
||||
reader_schedule_prompt_repaint();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ void env_universal_callbacks(env_stack_t *stack, const callback_data_list_t &cal
|
||||
|
||||
static void handle_fish_term_change(const env_stack_t &vars) {
|
||||
update_fish_color_support(vars);
|
||||
reader_react_to_color_change();
|
||||
reader_schedule_prompt_repaint();
|
||||
}
|
||||
|
||||
static void handle_change_ambiguous_width(const env_stack_t &vars) {
|
||||
|
||||
Reference in New Issue
Block a user