Mercurial > vim
comparison src/edit.c @ 11573:c8fd52807897 v8.0.0669
patch 8.0.0669: CTRL-N at start of the buffer does not work correctly
commit https://github.com/vim/vim/commit/24a9e348aa88a6c60ae0cdf5c4a777d8c03b08ca
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 24 15:39:07 2017 +0200
patch 8.0.0669: CTRL-N at start of the buffer does not work correctly
Problem: In Insert mode, CTRL-N at start of the buffer does not work
correctly. (zuloloxi)
Solution: Wrap around the start of the buffer. (Christian Brabandt)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 24 Jun 2017 15:45:04 +0200 |
parents | 578df034735d |
children | 1d6bcb9ff291 |
comparison
equal
deleted
inserted
replaced
11572:4f9d321dbd2b | 11573:c8fd52807897 |
---|---|
4306 e_cpt++; | 4306 e_cpt++; |
4307 if (*e_cpt == '.' && !curbuf->b_scanned) | 4307 if (*e_cpt == '.' && !curbuf->b_scanned) |
4308 { | 4308 { |
4309 ins_buf = curbuf; | 4309 ins_buf = curbuf; |
4310 first_match_pos = *ini; | 4310 first_match_pos = *ini; |
4311 /* So that ^N can match word immediately after cursor */ | 4311 /* Move the cursor back one character so that ^N can match the |
4312 if (ctrl_x_mode == 0) | 4312 * word immediately after the cursor. */ |
4313 dec(&first_match_pos); | 4313 if (ctrl_x_mode == 0 && dec(&first_match_pos) < 0) |
4314 { | |
4315 /* Move the cursor to after the last character in the | |
4316 * buffer, so that word at start of buffer is found | |
4317 * correctly. */ | |
4318 first_match_pos.lnum = ins_buf->b_ml.ml_line_count; | |
4319 first_match_pos.col = | |
4320 (colnr_T)STRLEN(ml_get(first_match_pos.lnum)); | |
4321 } | |
4314 last_match_pos = first_match_pos; | 4322 last_match_pos = first_match_pos; |
4315 type = 0; | 4323 type = 0; |
4316 | 4324 |
4317 /* Remember the first match so that the loop stops when we | 4325 /* Remember the first match so that the loop stops when we |
4318 * wrap and come back there a second time. */ | 4326 * wrap and come back there a second time. */ |