| To: vim_dev@googlegroups.com |
| Subject: Patch 7.4.806 |
| 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.4.806 |
| Problem: CTRL-A in Visual mode doesn't work properly with "alpha" in |
| 'nrformat'. |
| Solution: Make it work. (Christian Brabandt) |
| Files: src/ops.c, src/testdir/test_increment.in, |
| src/testdir/test_increment.ok |
| |
| |
| |
| |
| |
| *** 5492,5497 **** |
| --- 5492,5499 ---- |
| |
| for (i = lnum; i <= lnume; i++) |
| { |
| + colnr_T stop = 0; |
| + |
| t = curwin->w_cursor; |
| curwin->w_cursor.lnum = i; |
| ptr = ml_get_curline(); |
| |
| *** 5501,5531 **** |
| continue; |
| if (visual) |
| { |
| ! if (doalp) /* search for ascii chars */ |
| ! { |
| ! while (!ASCII_ISALPHA(ptr[col]) && ptr[col]) |
| ! col++; |
| ! } |
| ! /* skip to first digit, but allow for leading '-' */ |
| ! else if (dohex) |
| { |
| ! while (!(vim_isxdigit(ptr[col]) || (ptr[col] == '-' |
| ! && vim_isxdigit(ptr[col+1]))) && ptr[col]) |
| ! col++; |
| } |
| ! else /* decimal */ |
| { |
| ! while (!(vim_isdigit(ptr[col]) || (ptr[col] == '-' |
| ! && vim_isdigit(ptr[col+1]))) && ptr[col]) |
| ! col++; |
| } |
| } |
| - if (visual && ptr[col] == '-') |
| - { |
| - negative = TRUE; |
| - was_positive = FALSE; |
| - col++; |
| - } |
| /* |
| * If a number was found, and saving for undo works, replace the number. |
| */ |
| --- 5503,5530 ---- |
| continue; |
| if (visual) |
| { |
| ! if (VIsual_mode == 'v' |
| ! && i == lnume) |
| ! stop = curwin->w_cursor.col; |
| ! else if (VIsual_mode == Ctrl_V |
| ! && curbuf->b_visual.vi_curswant != MAXCOL) |
| ! stop = curwin->w_cursor.col; |
| ! |
| ! while (ptr[col] != NUL |
| ! && !vim_isdigit(ptr[col]) |
| ! && !(doalp && ASCII_ISALPHA(ptr[col]))) |
| { |
| ! if (col > 0 && col == stop) |
| ! break; |
| ! ++col; |
| } |
| ! |
| ! if (col > startcol && ptr[col - 1] == '-') |
| { |
| ! negative = TRUE; |
| ! was_positive = FALSE; |
| } |
| } |
| /* |
| * If a number was found, and saving for undo works, replace the number. |
| */ |
| |
| |
| |
| *** 260,265 **** |
| --- 260,275 ---- |
| 9 |
| 12 |
| |
| + 19) increment on number with nrformat including alpha |
| + Text: |
| + 1 |
| + 1a |
| + |
| + Expected: |
| + 1) <Ctrl-V>j$ <ctrl-a> |
| + 2 |
| + 1b |
| + |
| |
| |
| STARTTEST |
| |
| *** 369,374 **** |
| --- 379,391 ---- |
| :/^E18=/+put a |
| V3kg.. |
| |
| + :" Test 19 |
| + :set nrformats+=alpha |
| + :/^S19=/+,/^E19=/-y a |
| + :/^E19=/+put a |
| + k$ |
| + :set nrformats&vim |
| + |
| :" Save the report |
| :/^# Test 1/,$w! test.out |
| :qa! |
| |
| *** 547,552 **** |
| --- 564,576 ---- |
| |
| |
| |
| + # Test 19 |
| + S19==== |
| + 1 |
| + 1a |
| + E19==== |
| + |
| + |
| |
| |
| ENDTEST |
| |
| |
| |
| *** 261,266 **** |
| --- 261,275 ---- |
| 12 |
| |
| |
| + # Test 19 |
| + S19==== |
| + 1 |
| + 1a |
| + E19==== |
| + |
| + 2 |
| + 2a |
| + |
| |
| |
| ENDTEST |
| |
| |
| |
| *** 743,744 **** |
| --- 743,746 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 806, |
| /**/ |
| |
| -- |
| Not too long ago, compress was something you did to garbage... |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |