Mercurial > vim
comparison src/move.c @ 13384:6740c499de13 v8.0.1566
patch 8.0.1566: too many #ifdefs
commit https://github.com/vim/vim/commit/8a3bb56230d220b8e1b4dcca517ed95f5341b8c7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 4 20:14:14 2018 +0100
patch 8.0.1566: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate FEAT_SCROLLBIND and FEAT_CURSORBIND.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 04 Mar 2018 20:15:05 +0100 |
parents | 69517d67421f |
children | 1bc96dbb5498 |
comparison
equal
deleted
inserted
replaced
13383:22bb9735bd16 | 13384:6740c499de13 |
---|---|
182 if (!screen_valid(TRUE) || curwin->w_height == 0) | 182 if (!screen_valid(TRUE) || curwin->w_height == 0) |
183 { | 183 { |
184 curwin->w_topline = curwin->w_cursor.lnum; | 184 curwin->w_topline = curwin->w_cursor.lnum; |
185 curwin->w_botline = curwin->w_topline; | 185 curwin->w_botline = curwin->w_topline; |
186 curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; | 186 curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; |
187 #ifdef FEAT_SCROLLBIND | |
188 curwin->w_scbind_pos = 1; | 187 curwin->w_scbind_pos = 1; |
189 #endif | |
190 return; | 188 return; |
191 } | 189 } |
192 | 190 |
193 check_cursor_moved(curwin); | 191 check_cursor_moved(curwin); |
194 if (curwin->w_valid & VALID_TOPLINE) | 192 if (curwin->w_valid & VALID_TOPLINE) |
213 if (curwin->w_topline != 1) | 211 if (curwin->w_topline != 1) |
214 redraw_later(NOT_VALID); | 212 redraw_later(NOT_VALID); |
215 curwin->w_topline = 1; | 213 curwin->w_topline = 1; |
216 curwin->w_botline = 2; | 214 curwin->w_botline = 2; |
217 curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; | 215 curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; |
218 #ifdef FEAT_SCROLLBIND | |
219 curwin->w_scbind_pos = 1; | 216 curwin->w_scbind_pos = 1; |
220 #endif | |
221 } | 217 } |
222 | 218 |
223 /* | 219 /* |
224 * If the cursor is above or near the top of the window, scroll the window | 220 * If the cursor is above or near the top of the window, scroll the window |
225 * to show the line the cursor is in, with 'scrolloff' context. | 221 * to show the line the cursor is in, with 'scrolloff' context. |
2771 cursor_correct(); | 2767 cursor_correct(); |
2772 beginline(BL_SOL | BL_FIX); | 2768 beginline(BL_SOL | BL_FIX); |
2773 redraw_later(VALID); | 2769 redraw_later(VALID); |
2774 } | 2770 } |
2775 | 2771 |
2776 #if defined(FEAT_CURSORBIND) || defined(PROTO) | |
2777 void | 2772 void |
2778 do_check_cursorbind(void) | 2773 do_check_cursorbind(void) |
2779 { | 2774 { |
2780 linenr_T line = curwin->w_cursor.lnum; | 2775 linenr_T line = curwin->w_cursor.lnum; |
2781 colnr_T col = curwin->w_cursor.col; | 2776 colnr_T col = curwin->w_cursor.col; |
2844 VIsual_select = old_VIsual_select; | 2839 VIsual_select = old_VIsual_select; |
2845 VIsual_active = old_VIsual_active; | 2840 VIsual_active = old_VIsual_active; |
2846 curwin = old_curwin; | 2841 curwin = old_curwin; |
2847 curbuf = old_curbuf; | 2842 curbuf = old_curbuf; |
2848 } | 2843 } |
2849 #endif /* FEAT_CURSORBIND */ |