To: vim-dev@vim.org Subject: Patch 6.1a.017 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1a.017 Problem: Clicking the mouse in the top row of a window where the first line doesn't fit moves the cursor to the wrong column. Solution: Add the skipcol also for the top row of a window. Files: src/ui.c *** ../vim61a.016/src/ui.c Fri Feb 22 16:28:16 2002 --- src/ui.c Thu Feb 28 22:11:29 2002 *************** *** 2565,2581 **** #endif count = plines_win(win, lnum, TRUE); if (count > row) ! { ! /* Position is in this buffer line. Compute the column ! * without wrapping. */ ! off = win_col_off(win) - win_col_off2(win); ! if (col < off) ! col = off; ! col += row * (W_WIDTH(win) - off); ! /* add skip column (for long wrapping line) */ ! col += win->w_skipcol; ! break; ! } #ifdef FEAT_FOLDING (void)hasFoldingWin(win, lnum, NULL, &lnum, TRUE, NULL); #endif --- 2565,2571 ---- #endif count = plines_win(win, lnum, TRUE); if (count > row) ! break; /* Position is in this buffer line. */ #ifdef FEAT_FOLDING (void)hasFoldingWin(win, lnum, NULL, &lnum, TRUE, NULL); #endif *************** *** 2586,2591 **** --- 2576,2592 ---- } row -= count; ++lnum; + } + + if (!retval) + { + /* Compute the column without wrapping. */ + off = win_col_off(win) - win_col_off2(win); + if (col < off) + col = off; + col += row * (W_WIDTH(win) - off); + /* add skip column (for long wrapping line) */ + col += win->w_skipcol; } if (!win->w_p_wrap) *** ../vim61a.016/src/version.c Thu Feb 28 21:32:31 2002 --- src/version.c Thu Feb 28 22:16:27 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 17, /**/ -- From "know your smileys": :-)-O Smiling doctor with stethoscope /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///