Skip to content

Commit a6531a9

Browse files
committed
Do not consider prompt line as changed when push-enabled
This leads to a flicker on command prompt where the idle callback decides to redraw even though nothing changed (and it used to wrongly redraw the empty prompt as error, which is now fixed). As a consequence of this change, incremental search does not apply automatically to initial empty searches anymmore, which may be a bit better to avoid the window jumping around. Fixes #5405
1 parent 9e8c53a commit a6531a9

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

src/input_handler.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,8 +1089,6 @@ class Prompt : public InputMode
10891089
context().client().menu_select(0);
10901090
}
10911091
}
1092-
else
1093-
m_line_changed = true;
10941092

10951093
if (not (context().flags() & Context::Flags::Draft))
10961094
m_idle_timer.set_next_date(Clock::now() + get_idle_timeout(context()));

src/normal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ void command(const Context& context, EnvVarMap env_vars, char reg = 0)
535535
if (event == PromptEvent::Change)
536536
{
537537
auto info = CommandManager::instance().command_info(context, cmdline);
538-
context.input_handler().set_prompt_face(context.faces()[info ? "Prompt" : "Error"]);
538+
context.input_handler().set_prompt_face(context.faces()[info or cmdline.empty() ? "Prompt" : "Error"]);
539539

540540
auto autoinfo = context.options()["autoinfo"].get<AutoInfo>();
541541
if (autoinfo & AutoInfo::Command)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ui_out -until '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }'
2+
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":" ] }'
3+
ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[{ "face": { "fg": "yellow", "bg": "default", "underline": "default", "attributes": [] }, "contents": ":" }, { "face": { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }, "contents": "" }, { "face": { "fg": "black", "bg": "cyan", "underline": "default", "attributes": [] }, "contents": " " }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "underline": "default", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "yellow", "bg": "default", "underline": "default", "attributes": [] }, "contents": "prompt" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "underline": "default", "attributes": [] }] }'
4+
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "a<backspace>" ] }'
5+
ui_out -ignore 2
6+
ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[{ "face": { "fg": "yellow", "bg": "default", "underline": "default", "attributes": [] }, "contents": ":" }, { "face": { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }, "contents": "" }, { "face": { "fg": "black", "bg": "cyan", "underline": "default", "attributes": [] }, "contents": " " }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "underline": "default", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "yellow", "bg": "default", "underline": "default", "attributes": [] }, "contents": "prompt" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "underline": "default", "attributes": [] }] }'
7+
ui_out -ignore 3
8+
# Error face redraw was happening here
9+
ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["prompt", { "line": 0, "column": 1 }] }'

0 commit comments

Comments
 (0)