mirror of
https://github.com/neovim/neovim.git
synced 2026-05-05 13:35:02 +00:00
fix(prompt): ensure prompt-mark col gets reseted properly #37669
problem: currently when empty string is set as prompt the prompt-mark column doesn't update. solution: ensure the column is reset to 0 when starting prompt buffer and before creating a new prompt after prompt-callback.
This commit is contained in:
@@ -6668,6 +6668,7 @@ void prompt_invoke_callback(void)
|
||||
curwin->w_cursor.lnum = lnum + 1;
|
||||
curwin->w_cursor.col = 0;
|
||||
curbuf->b_prompt_start.mark.lnum = lnum + 1;
|
||||
curbuf->b_prompt_start.mark.col = 0;
|
||||
|
||||
if (curbuf->b_prompt_callback.type == kCallbackNone) {
|
||||
xfree(user_input);
|
||||
|
||||
@@ -711,7 +711,7 @@ const char *did_set_buftype(optset_T *args)
|
||||
// Set default value for 'comments'
|
||||
set_option_direct(kOptComments, STATIC_CSTR_AS_OPTVAL(""), OPT_LOCAL, SID_NONE);
|
||||
// set the prompt start position to lastline.
|
||||
pos_T next_prompt = { .lnum = buf->b_ml.ml_line_count, .col = 1, .coladd = 0 };
|
||||
pos_T next_prompt = { .lnum = buf->b_ml.ml_line_count, .col = 0, .coladd = 0 };
|
||||
RESET_FMARK(&buf->b_prompt_start, next_prompt, 0, ((fmarkv_T)INIT_FMARKV));
|
||||
}
|
||||
if (win->w_status_height || global_stl_height()) {
|
||||
|
||||
Reference in New Issue
Block a user