| To: vim-dev@vim.org |
| Subject: Patch 7.3.008 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.3.008 |
| Problem: 'cursorbind' is kept in places where 'scrollbind' is reset. |
| Solution: Reset 'cursorbind'. |
| Files: src/buffer.c, src/diff.c, src/ex_cmds.c, src/ex_cmds2.c, |
| src/ex_docmd.c, src/ex_getln.c, src/if_cscope.c, src/macros.h, |
| src/quickfix.c, src/search.c, src/tag.c, src/window.c |
| |
| |
| |
| |
| |
| *** 1288,1296 **** |
| /* Go to the other buffer. */ |
| set_curbuf(buf, action); |
| |
| ! #if defined(FEAT_LISTCMDS) && defined(FEAT_SCROLLBIND) |
| if (action == DOBUF_SPLIT) |
| ! curwin->w_p_scb = FALSE; /* reset 'scrollbind' */ |
| #endif |
| |
| #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) |
| --- 1288,1299 ---- |
| /* Go to the other buffer. */ |
| set_curbuf(buf, action); |
| |
| ! #if defined(FEAT_LISTCMDS) \ |
| ! && (defined(FEAT_SCROLLBIND) || defined(FEAT_CURSORBIND)) |
| if (action == DOBUF_SPLIT) |
| ! { |
| ! RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */ |
| ! } |
| #endif |
| |
| #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) |
| |
| *** 1917,1925 **** |
| tabpage_new(); |
| else if (win_split(0, 0) == FAIL) /* Open in a new window */ |
| return FAIL; |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| } |
| } |
| #endif |
| --- 1920,1926 ---- |
| tabpage_new(); |
| else if (win_split(0, 0) == FAIL) /* Open in a new window */ |
| return FAIL; |
| ! RESET_BINDING(curwin); |
| } |
| } |
| #endif |
| |
| |
| |
| *** 1127,1137 **** |
| # endif |
| |
| wp->w_p_diff = TRUE; |
| #ifdef FEAT_CURSORBIND |
| - /* Use cursorbind if it's available */ |
| wp->w_p_crb = TRUE; |
| #endif |
| - wp->w_p_scb = TRUE; |
| wp->w_p_wrap = FALSE; |
| # ifdef FEAT_FOLDING |
| curwin = wp; |
| --- 1127,1139 ---- |
| # endif |
| |
| wp->w_p_diff = TRUE; |
| + /* Use 'scrollbind' and 'cursorbind' when available */ |
| + #ifdef FEAT_SCROLLBIND |
| + wp->w_p_scb = TRUE; |
| + #endif |
| #ifdef FEAT_CURSORBIND |
| wp->w_p_crb = TRUE; |
| #endif |
| wp->w_p_wrap = FALSE; |
| # ifdef FEAT_FOLDING |
| curwin = wp; |
| |
| *** 1177,1186 **** |
| { |
| /* Set 'diff', 'scrollbind' off and 'wrap' on. */ |
| wp->w_p_diff = FALSE; |
| ! #ifdef FEAT_CURSORBIND |
| ! wp->w_p_crb = FALSE; |
| ! #endif |
| ! wp->w_p_scb = FALSE; |
| wp->w_p_wrap = TRUE; |
| #ifdef FEAT_FOLDING |
| curwin = wp; |
| --- 1179,1185 ---- |
| { |
| /* Set 'diff', 'scrollbind' off and 'wrap' on. */ |
| wp->w_p_diff = FALSE; |
| ! RESET_BINDING(wp); |
| wp->w_p_wrap = TRUE; |
| #ifdef FEAT_FOLDING |
| curwin = wp; |
| |
| |
| |
| *** 3498,3506 **** |
| curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */ |
| curwin->w_p_nu = 0; /* no line numbers */ |
| curwin->w_p_rnu = 0; /* no relative line numbers */ |
| ! #ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; /* no scroll binding */ |
| ! #endif |
| #ifdef FEAT_ARABIC |
| curwin->w_p_arab = FALSE; /* no arabic mode */ |
| #endif |
| --- 3498,3504 ---- |
| curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */ |
| curwin->w_p_nu = 0; /* no line numbers */ |
| curwin->w_p_rnu = 0; /* no relative line numbers */ |
| ! RESET_BINDING(curwin); /* no scroll or cursor binding */ |
| #ifdef FEAT_ARABIC |
| curwin->w_p_arab = FALSE; /* no arabic mode */ |
| #endif |
| |
| *** 5471,5479 **** |
| return FALSE; |
| curwin->w_p_pvw = TRUE; |
| curwin->w_p_wfh = TRUE; |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; /* don't take over 'scrollbind' */ |
| ! # endif |
| # ifdef FEAT_DIFF |
| curwin->w_p_diff = FALSE; /* no 'diff' */ |
| # endif |
| --- 5469,5476 ---- |
| return FALSE; |
| curwin->w_p_pvw = TRUE; |
| curwin->w_p_wfh = TRUE; |
| ! RESET_BINDING(curwin); /* don't take over 'scrollbind' |
| ! and 'cursorbind' */ |
| # ifdef FEAT_DIFF |
| curwin->w_p_diff = FALSE; /* no 'diff' */ |
| # endif |
| |
| |
| |
| *** 2165,2173 **** |
| { |
| if (win_split(0, 0) == FAIL) |
| return; |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| } |
| else |
| #endif |
| --- 2165,2171 ---- |
| { |
| if (win_split(0, 0) == FAIL) |
| return; |
| ! RESET_BINDING(curwin); |
| } |
| else |
| #endif |
| |
| |
| |
| *** 6898,6906 **** |
| # ifdef FEAT_WINDOWS |
| if (win_split(0, 0) == FAIL) |
| return; |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| |
| /* When splitting the window, create a new alist. Otherwise the |
| * existing one is overwritten. */ |
| --- 6898,6904 ---- |
| # ifdef FEAT_WINDOWS |
| if (win_split(0, 0) == FAIL) |
| return; |
| ! RESET_BINDING(curwin); |
| |
| /* When splitting the window, create a new alist. Otherwise the |
| * existing one is overwritten. */ |
| |
| *** 7300,7306 **** |
| || cmdmod.browse |
| # endif |
| ) |
| ! curwin->w_p_scb = FALSE; |
| else |
| do_check_scrollbind(FALSE); |
| # endif |
| --- 7298,7306 ---- |
| || cmdmod.browse |
| # endif |
| ) |
| ! { |
| ! RESET_BINDING(curwin); |
| ! } |
| else |
| do_check_scrollbind(FALSE); |
| # endif |
| |
| |
| |
| *** 6147,6155 **** |
| curwin->w_p_rl = cmdmsg_rl; |
| cmdmsg_rl = FALSE; |
| # endif |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| |
| # ifdef FEAT_AUTOCMD |
| /* Do execute autocommands for setting the filetype (load syntax). */ |
| --- 6147,6153 ---- |
| curwin->w_p_rl = cmdmsg_rl; |
| cmdmsg_rl = FALSE; |
| # endif |
| ! RESET_BINDING(curwin); |
| |
| # ifdef FEAT_AUTOCMD |
| /* Do execute autocommands for setting the filetype (load syntax). */ |
| |
| |
| |
| *** 1274,1282 **** |
| { |
| win_split(postponed_split > 0 ? postponed_split : 0, |
| postponed_split_flags); |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| postponed_split = 0; |
| } |
| # endif |
| --- 1274,1280 ---- |
| { |
| win_split(postponed_split > 0 ? postponed_split : 0, |
| postponed_split_flags); |
| ! RESET_BINDING(curwin); |
| postponed_split = 0; |
| } |
| # endif |
| |
| |
| |
| *** 285,287 **** |
| --- 285,301 ---- |
| #else |
| # define DO_AUTOCHDIR |
| #endif |
| + |
| + #if defined(FEAT_SCROLLBIND) && defined(FEAT_CURSORBIND) |
| + # define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE |
| + #else |
| + # if defined(FEAT_SCROLLBIND) |
| + # define RESET_BINDING(wp) (wp)->w_p_scb = FALSE |
| + # else |
| + # if defined(FEAT_CURSORBIND) |
| + # define RESET_BINDING(wp) (wp)->w_p_crb = FALSE |
| + # else |
| + # define RESET_BINDING(wp) |
| + # endif |
| + # endif |
| + #endif |
| |
| |
| |
| *** 1656,1664 **** |
| opened_window = TRUE; /* close it when fail */ |
| p_swb = empty_option; /* don't split again */ |
| swb_flags = 0; |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| if (ll_ref != NULL) |
| { |
| /* The new window should use the location list from the |
| --- 1656,1662 ---- |
| opened_window = TRUE; /* close it when fail */ |
| p_swb = empty_option; /* don't split again */ |
| swb_flags = 0; |
| ! RESET_BINDING(curwin); |
| if (ll_ref != NULL) |
| { |
| /* The new window should use the location list from the |
| |
| *** 2334,2342 **** |
| win_goto(lastwin); |
| if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL) |
| return; /* not enough room for window */ |
| ! #ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! #endif |
| |
| if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) |
| { |
| --- 2332,2338 ---- |
| win_goto(lastwin); |
| if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL) |
| return; /* not enough room for window */ |
| ! RESET_BINDING(curwin); |
| |
| if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) |
| { |
| |
| |
| |
| *** 5075,5083 **** |
| if (win_split(0, 0) == FAIL) |
| #endif |
| break; |
| ! #ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! #endif |
| } |
| if (depth == -1) |
| { |
| --- 5075,5081 ---- |
| if (win_split(0, 0) == FAIL) |
| #endif |
| break; |
| ! RESET_BINDING(curwin); |
| } |
| if (depth == -1) |
| { |
| |
| |
| |
| *** 3143,3151 **** |
| { |
| win_split(postponed_split > 0 ? postponed_split : 0, |
| postponed_split_flags); |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| } |
| #endif |
| |
| --- 3143,3149 ---- |
| { |
| win_split(postponed_split > 0 ? postponed_split : 0, |
| postponed_split_flags); |
| ! RESET_BINDING(curwin); |
| } |
| #endif |
| |
| |
| |
| |
| *** 525,533 **** |
| setpcmark(); |
| if (win_split(0, 0) == OK) |
| { |
| ! # ifdef FEAT_SCROLLBIND |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, |
| ECMD_HIDE, NULL); |
| if (nchar == 'F' && lnum >= 0) |
| --- 525,531 ---- |
| setpcmark(); |
| if (win_split(0, 0) == OK) |
| { |
| ! RESET_BINDING(curwin); |
| (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, |
| ECMD_HIDE, NULL); |
| if (nchar == 'F' && lnum >= 0) |
| |
| *** 3277,3285 **** |
| if (aucmd_win != NULL) |
| { |
| win_init_some(aucmd_win, curwin); |
| ! # ifdef FEAT_SCROLLBIND |
| ! aucmd_win->w_p_scb = FALSE; |
| ! # endif |
| new_frame(aucmd_win); |
| } |
| } |
| --- 3275,3281 ---- |
| if (aucmd_win != NULL) |
| { |
| win_init_some(aucmd_win, curwin); |
| ! RESET_BINDING(aucmd_win); |
| new_frame(aucmd_win); |
| } |
| } |
| |
| *** 3320,3329 **** |
| /* First window in new tab page, initialize it from "oldwin". */ |
| win_init(curwin, oldwin, 0); |
| |
| ! # ifdef FEAT_SCROLLBIND |
| ! /* We don't want scroll-binding in the first window. */ |
| ! curwin->w_p_scb = FALSE; |
| ! # endif |
| } |
| #endif |
| |
| --- 3316,3323 ---- |
| /* First window in new tab page, initialize it from "oldwin". */ |
| win_init(curwin, oldwin, 0); |
| |
| ! /* We don't want cursor- and scroll-binding in the first window. */ |
| ! RESET_BINDING(curwin); |
| } |
| #endif |
| |
| |
| |
| |
| *** 716,717 **** |
| --- 716,719 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 8, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 181. You make up words that go with the "happy tune" your modem makes |
| while dialing your ISP. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |