Mercurial > vim
comparison src/ops.c @ 6977:b10995a2f7c3 v7.4.806
patch 7.4.806
Problem: CTRL-A in Visual mode doesn't work properly with "alpha" in
'nrformat'.
Solution: Make it work. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 04 Aug 2015 18:23:22 +0200 |
parents | e859731ea1cd |
children | 6cde6404ff7c |
comparison
equal
deleted
inserted
replaced
6976:d678a71cae27 | 6977:b10995a2f7c3 |
---|---|
5490 } | 5490 } |
5491 } | 5491 } |
5492 | 5492 |
5493 for (i = lnum; i <= lnume; i++) | 5493 for (i = lnum; i <= lnume; i++) |
5494 { | 5494 { |
5495 colnr_T stop = 0; | |
5496 | |
5495 t = curwin->w_cursor; | 5497 t = curwin->w_cursor; |
5496 curwin->w_cursor.lnum = i; | 5498 curwin->w_cursor.lnum = i; |
5497 ptr = ml_get_curline(); | 5499 ptr = ml_get_curline(); |
5498 RLADDSUBFIX(ptr); | 5500 RLADDSUBFIX(ptr); |
5499 if ((int)STRLEN(ptr) <= col) | 5501 if ((int)STRLEN(ptr) <= col) |
5500 /* try again on next line */ | 5502 /* try again on next line */ |
5501 continue; | 5503 continue; |
5502 if (visual) | 5504 if (visual) |
5503 { | 5505 { |
5504 if (doalp) /* search for ascii chars */ | 5506 if (VIsual_mode == 'v' |
5505 { | 5507 && i == lnume) |
5506 while (!ASCII_ISALPHA(ptr[col]) && ptr[col]) | 5508 stop = curwin->w_cursor.col; |
5507 col++; | 5509 else if (VIsual_mode == Ctrl_V |
5508 } | 5510 && curbuf->b_visual.vi_curswant != MAXCOL) |
5509 /* skip to first digit, but allow for leading '-' */ | 5511 stop = curwin->w_cursor.col; |
5510 else if (dohex) | 5512 |
5511 { | 5513 while (ptr[col] != NUL |
5512 while (!(vim_isxdigit(ptr[col]) || (ptr[col] == '-' | 5514 && !vim_isdigit(ptr[col]) |
5513 && vim_isxdigit(ptr[col+1]))) && ptr[col]) | 5515 && !(doalp && ASCII_ISALPHA(ptr[col]))) |
5514 col++; | 5516 { |
5515 } | 5517 if (col > 0 && col == stop) |
5516 else /* decimal */ | 5518 break; |
5517 { | 5519 ++col; |
5518 while (!(vim_isdigit(ptr[col]) || (ptr[col] == '-' | 5520 } |
5519 && vim_isdigit(ptr[col+1]))) && ptr[col]) | 5521 |
5520 col++; | 5522 if (col > startcol && ptr[col - 1] == '-') |
5521 } | 5523 { |
5522 } | 5524 negative = TRUE; |
5523 if (visual && ptr[col] == '-') | 5525 was_positive = FALSE; |
5524 { | 5526 } |
5525 negative = TRUE; | |
5526 was_positive = FALSE; | |
5527 col++; | |
5528 } | 5527 } |
5529 /* | 5528 /* |
5530 * If a number was found, and saving for undo works, replace the number. | 5529 * If a number was found, and saving for undo works, replace the number. |
5531 */ | 5530 */ |
5532 firstdigit = ptr[col]; | 5531 firstdigit = ptr[col]; |