Mercurial > vim
comparison src/edit.c @ 10859:64ccb8029e06 v8.0.0319
patch 8.0.0319: insert mode completion does not respect 'backspace'
commit https://github.com/vim/vim/commit/190b04cdd936f4696c22466b7f077f9371d96580
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 9 17:37:03 2017 +0100
patch 8.0.0319: insert mode completion does not respect 'backspace'
Problem: Insert mode completion does not respect "start" in 'backspace'.
Solution: Check whether backspace can go before where insert started.
(Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Feb 2017 17:45:03 +0100 |
parents | 265268ea1adc |
children | 5780bd3a5a7e |
comparison
equal
deleted
inserted
replaced
10858:c2b6fecdbb04 | 10859:64ccb8029e06 |
---|---|
3465 line = ml_get_curline(); | 3465 line = ml_get_curline(); |
3466 p = line + curwin->w_cursor.col; | 3466 p = line + curwin->w_cursor.col; |
3467 mb_ptr_back(line, p); | 3467 mb_ptr_back(line, p); |
3468 | 3468 |
3469 /* Stop completion when the whole word was deleted. For Omni completion | 3469 /* Stop completion when the whole word was deleted. For Omni completion |
3470 * allow the word to be deleted, we won't match everything. */ | 3470 * allow the word to be deleted, we won't match everything. |
3471 * Respect the 'backspace' option. */ | |
3471 if ((int)(p - line) - (int)compl_col < 0 | 3472 if ((int)(p - line) - (int)compl_col < 0 |
3472 || ((int)(p - line) - (int)compl_col == 0 | 3473 || ((int)(p - line) - (int)compl_col == 0 |
3473 && ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL) | 3474 && ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL |
3475 || (!can_bs(BS_START) && (int)(p - line) - (int)compl_col | |
3476 - compl_length < 0)) | |
3474 return K_BS; | 3477 return K_BS; |
3475 | 3478 |
3476 /* Deleted more than what was used to find matches or didn't finish | 3479 /* Deleted more than what was used to find matches or didn't finish |
3477 * finding all matches: need to look for matches all over again. */ | 3480 * finding all matches: need to look for matches all over again. */ |
3478 if (curwin->w_cursor.col <= compl_col + compl_length | 3481 if (curwin->w_cursor.col <= compl_col + compl_length |