Mercurial > vim
comparison src/normal.c @ 2178:c6f1aa1e9f32 vim73
Add 'relativenumber' patch from Markus Heidelberg.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 16 May 2010 15:46:46 +0200 |
parents | 35effbd07a25 |
children | 8c6a66e2b3cc |
comparison
equal
deleted
inserted
replaced
2176:dd87ce87e0cc | 2178:c6f1aa1e9f32 |
---|---|
7843 if (curwin->w_virtcol >= (colnr_T)width1 && width2 > 0) | 7843 if (curwin->w_virtcol >= (colnr_T)width1 && width2 > 0) |
7844 i = (curwin->w_virtcol - width1) / width2 * width2 + width1; | 7844 i = (curwin->w_virtcol - width1) / width2 * width2 + width1; |
7845 } | 7845 } |
7846 else | 7846 else |
7847 i = curwin->w_leftcol; | 7847 i = curwin->w_leftcol; |
7848 /* Go to the middle of the screen line. When 'number' is on and lines | 7848 /* Go to the middle of the screen line. When 'number' or |
7849 * are wrapping the middle can be more to the left. */ | 7849 * 'relativenumber' is on and lines are wrapping the middle can be more |
7850 * to the left. */ | |
7850 if (cap->nchar == 'm') | 7851 if (cap->nchar == 'm') |
7851 i += (W_WIDTH(curwin) - curwin_col_off() | 7852 i += (W_WIDTH(curwin) - curwin_col_off() |
7852 + ((curwin->w_p_wrap && i > 0) | 7853 + ((curwin->w_p_wrap && i > 0) |
7853 ? curwin_col_off2() : 0)) / 2; | 7854 ? curwin_col_off2() : 0)) / 2; |
7854 coladvance((colnr_T)i); | 7855 coladvance((colnr_T)i); |