Mercurial > vim
comparison src/normal.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 | 63ee3c2b140f |
children | bbea1f108187 |
comparison
equal
deleted
inserted
replaced
18573:f18a4ae518f1 | 18574:8b0114ffde2b |
---|---|
1766 | 1766 |
1767 if (VIsual_mode == Ctrl_V) | 1767 if (VIsual_mode == Ctrl_V) |
1768 { | 1768 { |
1769 # ifdef FEAT_LINEBREAK | 1769 # ifdef FEAT_LINEBREAK |
1770 char_u *saved_sbr = p_sbr; | 1770 char_u *saved_sbr = p_sbr; |
1771 char_u *saved_w_sbr = curwin->w_p_sbr; | |
1771 | 1772 |
1772 /* Make 'sbr' empty for a moment to get the correct size. */ | 1773 /* Make 'sbr' empty for a moment to get the correct size. */ |
1773 p_sbr = empty_option; | 1774 p_sbr = empty_option; |
1775 curwin->w_p_sbr = empty_option; | |
1774 # endif | 1776 # endif |
1775 getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol); | 1777 getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol); |
1776 # ifdef FEAT_LINEBREAK | 1778 # ifdef FEAT_LINEBREAK |
1777 p_sbr = saved_sbr; | 1779 p_sbr = saved_sbr; |
1780 curwin->w_p_sbr = saved_w_sbr; | |
1778 # endif | 1781 # endif |
1779 sprintf((char *)showcmd_buf, "%ldx%ld", lines, | 1782 sprintf((char *)showcmd_buf, "%ldx%ld", lines, |
1780 (long)(rightcol - leftcol + 1)); | 1783 (long)(rightcol - leftcol + 1)); |
1781 } | 1784 } |
1782 else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum) | 1785 else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum) |
2575 * screenline or move two screenlines. | 2578 * screenline or move two screenlines. |
2576 */ | 2579 */ |
2577 validate_virtcol(); | 2580 validate_virtcol(); |
2578 virtcol = curwin->w_virtcol; | 2581 virtcol = curwin->w_virtcol; |
2579 #if defined(FEAT_LINEBREAK) | 2582 #if defined(FEAT_LINEBREAK) |
2580 if (virtcol > (colnr_T)width1 && *p_sbr != NUL) | 2583 if (virtcol > (colnr_T)width1 && *get_showbreak_value(curwin) != NUL) |
2581 virtcol -= vim_strsize(p_sbr); | 2584 virtcol -= vim_strsize(get_showbreak_value(curwin)); |
2582 #endif | 2585 #endif |
2583 | 2586 |
2584 if (virtcol > curwin->w_curswant | 2587 if (virtcol > curwin->w_curswant |
2585 && (curwin->w_curswant < (colnr_T)width1 | 2588 && (curwin->w_curswant < (colnr_T)width1 |
2586 ? (curwin->w_curswant > (colnr_T)width1 / 2) | 2589 ? (curwin->w_curswant > (colnr_T)width1 / 2) |