Mercurial > vim
comparison src/evalfunc.c @ 15117:2fed75dee954 v8.1.0569
patch 8.1.0569: execute() always resets display column to zero
commit https://github.com/vim/vim/commit/10ccaa17ec8b2be1132fd19059e1cd5fb5c902c4
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Dec 7 16:38:23 2018 +0100
patch 8.1.0569: execute() always resets display column to zero
Problem: Execute() always resets display column to zero. (Sha Liu)
Solution: Don't reset it to zero, restore the previous value. (closes https://github.com/vim/vim/issues/3669)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 07 Dec 2018 16:45:05 +0100 |
parents | 3a94f7918980 |
children | 895abc8a5195 |
comparison
equal
deleted
inserted
replaced
15116:80ba0405fcd2 | 15117:2fed75dee954 |
---|---|
3260 int save_emsg_silent = emsg_silent; | 3260 int save_emsg_silent = emsg_silent; |
3261 int save_emsg_noredir = emsg_noredir; | 3261 int save_emsg_noredir = emsg_noredir; |
3262 int save_redir_execute = redir_execute; | 3262 int save_redir_execute = redir_execute; |
3263 int save_redir_off = redir_off; | 3263 int save_redir_off = redir_off; |
3264 garray_T save_ga; | 3264 garray_T save_ga; |
3265 int save_msg_col = msg_col; | |
3265 | 3266 |
3266 rettv->vval.v_string = NULL; | 3267 rettv->vval.v_string = NULL; |
3267 rettv->v_type = VAR_STRING; | 3268 rettv->v_type = VAR_STRING; |
3268 | 3269 |
3269 if (argvars[0].v_type == VAR_LIST) | 3270 if (argvars[0].v_type == VAR_LIST) |
3302 if (redir_execute) | 3303 if (redir_execute) |
3303 save_ga = redir_execute_ga; | 3304 save_ga = redir_execute_ga; |
3304 ga_init2(&redir_execute_ga, (int)sizeof(char), 500); | 3305 ga_init2(&redir_execute_ga, (int)sizeof(char), 500); |
3305 redir_execute = TRUE; | 3306 redir_execute = TRUE; |
3306 redir_off = FALSE; | 3307 redir_off = FALSE; |
3308 msg_col = 0; // prevent leading spaces | |
3307 | 3309 |
3308 if (cmd != NULL) | 3310 if (cmd != NULL) |
3309 do_cmdline_cmd(cmd); | 3311 do_cmdline_cmd(cmd); |
3310 else | 3312 else |
3311 { | 3313 { |
3334 redir_execute = save_redir_execute; | 3336 redir_execute = save_redir_execute; |
3335 if (redir_execute) | 3337 if (redir_execute) |
3336 redir_execute_ga = save_ga; | 3338 redir_execute_ga = save_ga; |
3337 redir_off = save_redir_off; | 3339 redir_off = save_redir_off; |
3338 | 3340 |
3339 /* "silent reg" or "silent echo x" leaves msg_col somewhere in the | 3341 // "silent reg" or "silent echo x" leaves msg_col somewhere in the line. |
3340 * line. Put it back in the first column. */ | 3342 // Put it back where it was, since nothing should have been written. |
3341 msg_col = 0; | 3343 msg_col = save_msg_col; |
3342 } | 3344 } |
3343 | 3345 |
3344 /* | 3346 /* |
3345 * "exepath()" function | 3347 * "exepath()" function |
3346 */ | 3348 */ |