To: Mark Yeager In-Reply-To: <37A20504.8F355812@rtviz.com> CC: vim-dev@vim.org Subject: patch 5.4.11 Fcc: outbox From: Bram Moolenaar ------------ Mark Yeager wrote: > Options are set in .vimrc: > > set cpoptions=aAbBcdeEfFjklLmorStwWx$!%< > > What I am finding, with either or both of the S or s options, is that if > I go to each file in order using :n then the tabstop setting "sticks", > but if I jump around out of order using, say, :6b, then for that file > the tabstop does not stick. So it seems to depend on how I arrive at a > file for the first time. Aha, now I can see the problem. The 'tabstop' setting is not copied when using a ":buffer" command. Even though the 'S' flag in 'cpoptions' instructs to do so. Patch 5.4.11 Problem: When using the 'S' flag in 'cpoptions', 'tabstop' is not copied to the next buffer for some commands, e.g., ":buffer". Solution: When the BCO_NOHELP flag is given to buf_copy_options(), still copy the options used by do_help() when neither the "from" or "to" buffer is a help buffer. Files: src/option.c *** ../vim-5.4/src/option.c Sun Jul 25 22:02:04 1999 --- src/option.c Sat Jul 31 16:18:37 1999 *************** *** 4898,4904 **** * BCO_ENTER We will enter the bp_to buffer. * BCO_ALWAYS Always copy the options, but only set b_p_initialized when * appropriate. ! * BCO_NOHELP Don't copy the help settings. */ void buf_copy_options(bp_from, bp_to, flags) --- 4898,4904 ---- * BCO_ENTER We will enter the bp_to buffer. * BCO_ALWAYS Always copy the options, but only set b_p_initialized when * appropriate. ! * BCO_NOHELP Don't copy the help settings from or to a help buffer. */ void buf_copy_options(bp_from, bp_to, flags) *************** *** 4908,4913 **** --- 4908,4914 ---- { int should_copy = TRUE; char_u *save_p_isk = NULL; /* init for GCC */ + int dont_do_help; /* * Don't do anything of the "to" buffer is invalid. *************** *** 4941,4947 **** if (should_copy || (flags & BCO_ALWAYS)) { ! if ((flags & BCO_NOHELP)) /* don't free b_p_isk */ { save_p_isk = bp_to->b_p_isk; bp_to->b_p_isk = NULL; --- 4942,4950 ---- if (should_copy || (flags & BCO_ALWAYS)) { ! dont_do_help = (flags & BCO_NOHELP) ! && (bp_to->b_help || bp_from->b_help); ! if (dont_do_help) /* don't free b_p_isk */ { save_p_isk = bp_to->b_p_isk; bp_to->b_p_isk = NULL; *************** *** 5025,5034 **** #endif /* ! * Don't copy the options set by do_help(), use the saved values ! * Don't touch these at all when BCO_NOHELP is used. */ ! if ((flags & BCO_NOHELP)) bp_to->b_p_isk = save_p_isk; else { --- 5028,5039 ---- #endif /* ! * Don't copy the options set by do_help(), use the saved values, ! * when going from a help buffer to a non-help buffer. ! * Don't touch these at all when BCO_NOHELP is used and going from ! * or to a help buffer. */ ! if (dont_do_help) bp_to->b_p_isk = save_p_isk; else { *** ../vim-5.4/src/version.h Sat Jul 31 16:28:09 1999 --- src/version.h Sat Jul 31 16:29:33 1999 *************** *** 19,26 **** #define VIM_VERSION_MINOR_STR "4" #define VIM_VERSION_BUILD 57 #define VIM_VERSION_BUILD_STR "57" ! #define VIM_VERSION_PATCHLEVEL 10 ! #define VIM_VERSION_PATCHLEVEL_STR "10" /* * VIM_VERSION_NODOT is used for the runtime directory name. --- 19,26 ---- #define VIM_VERSION_MINOR_STR "4" #define VIM_VERSION_BUILD 57 #define VIM_VERSION_BUILD_STR "57" ! #define VIM_VERSION_PATCHLEVEL 11 ! #define VIM_VERSION_PATCHLEVEL_STR "11" /* * VIM_VERSION_NODOT is used for the runtime directory name. *************** *** 30,35 **** */ #define VIM_VERSION_NODOT "vim54" #define VIM_VERSION_SHORT "5.4" ! #define VIM_VERSION_MEDIUM "5.4.10" ! #define VIM_VERSION_LONG "VIM - Vi IMproved 5.4.10 (1999 Jul 30)" ! #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 5.4.10 (1999 Jul 30, compiled " --- 30,35 ---- */ #define VIM_VERSION_NODOT "vim54" #define VIM_VERSION_SHORT "5.4" ! #define VIM_VERSION_MEDIUM "5.4.11" ! #define VIM_VERSION_LONG "VIM - Vi IMproved 5.4.11 (1999 Jul 31)" ! #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 5.4.11 (1999 Jul 31, compiled " -- ARTHUR: Did you say shrubberies? ROGER: Yes. Shrubberies are my trade. I am a shrubber. My name is Roger the Shrubber. I arrange, design, and sell shrubberies. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /