comparison src/move.c @ 18574:8b0114ffde2b v8.1.2281

patch 8.1.2281: 'showbreak' cannot be set for one window Commit: https://github.com/vim/vim/commit/ee85702c10495041791f728e977b86005c4496e8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 9 23:26:40 2019 +0100 patch 8.1.2281: 'showbreak' cannot be set for one window Problem: 'showbreak' cannot be set for one window. Solution: Make 'showbreak' global-local.
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Nov 2019 23:30:03 +0100
parents 66964658cc3c
children 4ac042c8ed98
comparison
equal deleted inserted replaced
18573:f18a4ae518f1 18574:8b0114ffde2b
986 width = textwidth + curwin_col_off2(); 986 width = textwidth + curwin_col_off2();
987 987
988 /* long line wrapping, adjust curwin->w_wrow */ 988 /* long line wrapping, adjust curwin->w_wrow */
989 if (curwin->w_wcol >= curwin->w_width) 989 if (curwin->w_wcol >= curwin->w_width)
990 { 990 {
991 char_u *sbr;
992
991 /* this same formula is used in validate_cursor_col() */ 993 /* this same formula is used in validate_cursor_col() */
992 n = (curwin->w_wcol - curwin->w_width) / width + 1; 994 n = (curwin->w_wcol - curwin->w_width) / width + 1;
993 curwin->w_wcol -= n * width; 995 curwin->w_wcol -= n * width;
994 curwin->w_wrow += n; 996 curwin->w_wrow += n;
995 997
996 #ifdef FEAT_LINEBREAK 998 #ifdef FEAT_LINEBREAK
997 /* When cursor wraps to first char of next line in Insert 999 /* When cursor wraps to first char of next line in Insert
998 * mode, the 'showbreak' string isn't shown, backup to first 1000 * mode, the 'showbreak' string isn't shown, backup to first
999 * column */ 1001 * column */
1000 if (*p_sbr && *ml_get_cursor() == NUL 1002 sbr = get_showbreak_value(curwin);
1001 && curwin->w_wcol == (int)vim_strsize(p_sbr)) 1003 if (*sbr && *ml_get_cursor() == NUL
1004 && curwin->w_wcol == (int)vim_strsize(sbr))
1002 curwin->w_wcol = 0; 1005 curwin->w_wcol = 0;
1003 #endif 1006 #endif
1004 } 1007 }
1005 } 1008 }
1006 1009