Merge #10763 from justinmk/startup-guicursor

startup: handle 'guicursor' after user config
This commit is contained in:
Justin M. Keyes 2019-08-14 11:28:39 +02:00 committed by GitHub
commit 5ad67af3c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 28 deletions

View File

@ -396,8 +396,7 @@ int main(int argc, char **argv)
mch_exit(0); mch_exit(0);
} }
// Set a few option defaults after reading vimrc files: 'title', 'icon', // Set some option defaults after reading vimrc files.
// 'shellpipe', 'shellredir'.
set_init_3(); set_init_3();
TIME_MSG("inits 3"); TIME_MSG("inits 3");

View File

@ -1001,45 +1001,35 @@ void set_init_2(bool headless)
p_window = Rows - 1; p_window = Rows - 1;
} }
set_number_default("window", Rows - 1); set_number_default("window", Rows - 1);
parse_shape_opt(SHAPE_CURSOR); // set cursor shapes from 'guicursor'
(void)parse_printoptions(); // parse 'printoptions' default value (void)parse_printoptions(); // parse 'printoptions' default value
} }
/* /// Initialize the options, part three: After reading the .vimrc
* Initialize the options, part three: After reading the .vimrc
*/
void set_init_3(void) void set_init_3(void)
{ {
parse_shape_opt(SHAPE_CURSOR); // set cursor shapes from 'guicursor'
// Set 'shellpipe' and 'shellredir', depending on the 'shell' option. // Set 'shellpipe' and 'shellredir', depending on the 'shell' option.
// This is done after other initializations, where 'shell' might have been // This is done after other initializations, where 'shell' might have been
// set, but only if they have not been set before. // set, but only if they have not been set before.
int idx_srr; int idx_srr = findoption("srr");
int do_srr; int do_srr = (idx_srr < 0)
int idx_sp; ? false
int do_sp; : !(options[idx_srr].flags & P_WAS_SET);
int idx_sp = findoption("sp");
idx_srr = findoption("srr"); int do_sp = (idx_sp < 0)
if (idx_srr < 0) { ? false
do_srr = false; : !(options[idx_sp].flags & P_WAS_SET);
} else {
do_srr = !(options[idx_srr].flags & P_WAS_SET);
}
idx_sp = findoption("sp");
if (idx_sp < 0) {
do_sp = false;
} else {
do_sp = !(options[idx_sp].flags & P_WAS_SET);
}
size_t len = 0; size_t len = 0;
char_u *p = (char_u *)invocation_path_tail(p_sh, &len); char_u *p = (char_u *)invocation_path_tail(p_sh, &len);
p = vim_strnsave(p, len); p = vim_strnsave(p, len);
{ {
/* //
* Default for p_sp is "| tee", for p_srr is ">". // Default for p_sp is "| tee", for p_srr is ">".
* For known shells it is changed here to include stderr. // For known shells it is changed here to include stderr.
*/ //
if ( fnamecmp(p, "csh") == 0 if ( fnamecmp(p, "csh") == 0
|| fnamecmp(p, "tcsh") == 0 || fnamecmp(p, "tcsh") == 0
) { ) {
@ -1081,7 +1071,7 @@ void set_init_3(void)
} }
} }
set_title_defaults(); set_title_defaults(); // 'title', 'icon'
} }
/* /*