summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-03-28 21:08:56 +0000
committerBram Moolenaar <Bram@vim.org>2006-03-28 21:08:56 +0000
commitd2cec5b043361ee798a0522244135f4ea87838f6 (patch)
tree3ad43aed8a8c373f85a2a3adf286b045c14f6cfe /src/edit.c
parent607a95ed81973faab2e1c3d9c91822082694fdc3 (diff)
downloadvim-git-d2cec5b043361ee798a0522244135f4ea87838f6.tar.gz
updated for version 7.0c02v7.0c02
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/edit.c b/src/edit.c
index c22bb39ef..5159a34fc 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -726,8 +726,8 @@ edit(cmdchar, startln, count)
continue;
}
- /* Pressing Enter selects the current match. */
- if (c == CAR || c == K_KENTER || c == NL)
+ /* Pressing CTRL-Y selects the current match. */
+ if (c == Ctrl_Y)
{
ins_compl_delete();
ins_compl_insert();
@@ -3274,11 +3274,23 @@ ins_compl_prep(c)
auto_format(FALSE, TRUE);
- /* if the popup menu is displayed hitting Enter means accepting
+ /* If the popup menu is displayed pressing CTRL-Y means accepting
* the selection without inserting anything. */
- if ((c == CAR || c == K_KENTER || c == NL) && pum_visible())
+ if (c == Ctrl_Y && pum_visible())
retval = TRUE;
+ /* CTRL-E means completion is Ended, go back to the typed text. */
+ if (c == Ctrl_E)
+ {
+ ins_compl_delete();
+ if (compl_leader != NULL)
+ ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
+ else if (compl_first_match != NULL)
+ ins_bytes(compl_first_match->cp_str
+ + curwin->w_cursor.col - compl_col);
+ retval = TRUE;
+ }
+
ins_compl_free();
compl_started = FALSE;
compl_matches = 0;