To: vim_dev@googlegroups.com Subject: Patch 8.2.0309 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0309 Problem: Window-local values have confusing name. Solution: Rename w_p_bri* to w_briopt_*. Files: src/structs.h, src/indent.c, src/drawline.c *** ../vim-8.2.0308/src/structs.h 2020-02-22 14:26:39.244757847 +0100 --- src/structs.h 2020-02-23 15:21:34.631111579 +0100 *************** *** 3341,3354 **** int *w_p_cc_cols; // array of columns to highlight or NULL char_u w_p_culopt_flags; // flags for cursorline highlighting #endif - #ifdef FEAT_LINEBREAK - int w_p_brimin; // minimum width for breakindent - int w_p_brishift; // additional shift for breakindent - int w_p_brisbr; // sbr in 'briopt' - #endif long w_p_siso; // 'sidescrolloff' local value long w_p_so; // 'scrolloff' local value // transform a pointer to a "onebuf" option into a "allbuf" option #define GLOBAL_WO(p) ((char *)p + sizeof(winopt_T)) --- 3341,3355 ---- int *w_p_cc_cols; // array of columns to highlight or NULL char_u w_p_culopt_flags; // flags for cursorline highlighting #endif long w_p_siso; // 'sidescrolloff' local value long w_p_so; // 'scrolloff' local value + #ifdef FEAT_LINEBREAK + int w_briopt_min; // minimum width for breakindent + int w_briopt_shift; // additional shift for breakindent + int w_briopt_sbr; // sbr in 'briopt' + #endif + // transform a pointer to a "onebuf" option into a "allbuf" option #define GLOBAL_WO(p) ((char *)p + sizeof(winopt_T)) *** ../vim-8.2.0308/src/indent.c 2019-12-21 18:47:05.128754192 +0100 --- src/indent.c 2020-02-23 15:22:24.718942292 +0100 *************** *** 875,883 **** ++p; } ! wp->w_p_brishift = bri_shift; ! wp->w_p_brimin = bri_min; ! wp->w_p_brisbr = bri_sbr; return OK; } --- 875,883 ---- ++p; } ! wp->w_briopt_shift = bri_shift; ! wp->w_briopt_min = bri_min; ! wp->w_briopt_sbr = bri_sbr; return OK; } *************** *** 927,936 **** (int)wp->w_buffer->b_p_ts, wp->w_p_list); # endif } ! bri = prev_indent + wp->w_p_brishift; // indent minus the length of the showbreak string ! if (wp->w_p_brisbr) bri -= vim_strsize(get_showbreak_value(wp)); // Add offset for number column, if 'n' is in 'cpoptions' --- 927,936 ---- (int)wp->w_buffer->b_p_ts, wp->w_p_list); # endif } ! bri = prev_indent + wp->w_briopt_shift; // indent minus the length of the showbreak string ! if (wp->w_briopt_sbr) bri -= vim_strsize(get_showbreak_value(wp)); // Add offset for number column, if 'n' is in 'cpoptions' *************** *** 941,949 **** bri = 0; // always leave at least bri_min characters on the left, // if text width is sufficient ! else if (bri > eff_wwidth - wp->w_p_brimin) ! bri = (eff_wwidth - wp->w_p_brimin < 0) ! ? 0 : eff_wwidth - wp->w_p_brimin; return bri; } --- 941,949 ---- bri = 0; // always leave at least bri_min characters on the left, // if text width is sufficient ! else if (bri > eff_wwidth - wp->w_briopt_min) ! bri = (eff_wwidth - wp->w_briopt_min < 0) ! ? 0 : eff_wwidth - wp->w_briopt_min; return bri; } *** ../vim-8.2.0308/src/drawline.c 2020-02-23 15:17:24.499956118 +0100 --- src/drawline.c 2020-02-23 15:21:05.963208460 +0100 *************** *** 1140,1150 **** } #ifdef FEAT_LINEBREAK ! if (wp->w_p_brisbr && draw_state == WL_BRI - 1 && n_extra == 0 && *get_showbreak_value(wp) != NUL) // draw indent after showbreak value draw_state = WL_BRI; ! else if (wp->w_p_brisbr && draw_state == WL_SBR && n_extra == 0) // After the showbreak, draw the breakindent draw_state = WL_BRI - 1; --- 1140,1150 ---- } #ifdef FEAT_LINEBREAK ! if (wp->w_briopt_sbr && draw_state == WL_BRI - 1 && n_extra == 0 && *get_showbreak_value(wp) != NUL) // draw indent after showbreak value draw_state = WL_BRI; ! else if (wp->w_briopt_sbr && draw_state == WL_SBR && n_extra == 0) // After the showbreak, draw the breakindent draw_state = WL_BRI - 1; *************** *** 1176,1182 **** c_final = NUL; n_extra = get_breakindent_win(wp, ml_get_buf(wp->w_buffer, lnum, FALSE)); ! if (wp->w_skipcol > 0 && wp->w_p_wrap && wp->w_p_brisbr) need_showbreak = FALSE; // Correct end of highlighted area for 'breakindent', // required when 'linebreak' is also set. --- 1176,1182 ---- c_final = NUL; n_extra = get_breakindent_win(wp, ml_get_buf(wp->w_buffer, lnum, FALSE)); ! if (wp->w_skipcol > 0 && wp->w_p_wrap && wp->w_briopt_sbr) need_showbreak = FALSE; // Correct end of highlighted area for 'breakindent', // required when 'linebreak' is also set. *** ../vim-8.2.0308/src/version.c 2020-02-23 15:17:24.499956118 +0100 --- src/version.c 2020-02-23 15:29:30.081502633 +0100 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 309, /**/ -- hundred-and-one symptoms of being an internet addict: 106. When told to "go to your room" you inform your parents that you can't...because you were kicked out and banned. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///