Mercurial > vim
comparison src/edit.c @ 10289:af5b6efad23f v8.0.0041
commit https://github.com/vim/vim/commit/869e35270ecffd9024958880cb03f6f0bb01ea93
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 16 15:35:47 2016 +0200
patch 8.0.0041
Problem: When using Insert mode completion but not actually inserting
anything an undo item is still created. (Tommy Allen)
Solution: Do not call stop_arrow() when not inserting anything.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 16 Oct 2016 15:45:04 +0200 |
parents | 154d5a2e7395 |
children | d9bd03a0d70f |
comparison
equal
deleted
inserted
replaced
10288:aef7866360ed | 10289:af5b6efad23f |
---|---|
2796 | 2796 |
2797 /* If already doing completions stop it. */ | 2797 /* If already doing completions stop it. */ |
2798 if (ctrl_x_mode != 0) | 2798 if (ctrl_x_mode != 0) |
2799 ins_compl_prep(' '); | 2799 ins_compl_prep(' '); |
2800 ins_compl_clear(); | 2800 ins_compl_clear(); |
2801 | |
2802 if (stop_arrow() == FAIL) | |
2803 return; | |
2804 | 2801 |
2805 compl_direction = FORWARD; | 2802 compl_direction = FORWARD; |
2806 if (startcol > curwin->w_cursor.col) | 2803 if (startcol > curwin->w_cursor.col) |
2807 startcol = curwin->w_cursor.col; | 2804 startcol = curwin->w_cursor.col; |
2808 compl_col = startcol; | 2805 compl_col = startcol; |
3874 int prev_col = curwin->w_cursor.col; | 3871 int prev_col = curwin->w_cursor.col; |
3875 | 3872 |
3876 /* put the cursor on the last char, for 'tw' formatting */ | 3873 /* put the cursor on the last char, for 'tw' formatting */ |
3877 if (prev_col > 0) | 3874 if (prev_col > 0) |
3878 dec_cursor(); | 3875 dec_cursor(); |
3879 if (stop_arrow() == OK) | 3876 /* only format when something was inserted */ |
3877 if (!arrow_used && !ins_need_undo) | |
3880 insertchar(NUL, 0, -1); | 3878 insertchar(NUL, 0, -1); |
3881 if (prev_col > 0 | 3879 if (prev_col > 0 |
3882 && ml_get_curline()[curwin->w_cursor.col] != NUL) | 3880 && ml_get_curline()[curwin->w_cursor.col] != NUL) |
3883 inc_cursor(); | 3881 inc_cursor(); |
3884 } | 3882 } |