diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-01-19 17:30:39 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-01-19 17:30:39 -0500 |
commit | 8d93bc1a4ed890e2aef01b850f5146401ed6f1c0 (patch) | |
tree | 4b8b0d7fe267d3a934e815ab5dc6130c941733f4 | |
parent | 617c00bd49c2bdb05c8ef31f94e206ba3f80f694 (diff) | |
parent | 1d5222985ccad4cd31c4b7498810ff2968dd33a2 (diff) | |
download | rneovim-8d93bc1a4ed890e2aef01b850f5146401ed6f1c0.tar.gz rneovim-8d93bc1a4ed890e2aef01b850f5146401ed6f1c0.tar.bz2 rneovim-8d93bc1a4ed890e2aef01b850f5146401ed6f1c0.zip |
Merge pull request #1848 from Hinidu/vim-7.4.492
vim-patch:7.4.492
-rw-r--r-- | src/nvim/edit.c | 8 | ||||
-rw-r--r-- | src/nvim/version.c | 2 | ||||
-rw-r--r-- | test/functional/legacy/004_bufenter_with_modelines_spec.lua | 11 |
3 files changed, 17 insertions, 4 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 4c00547daa..f6ca11761a 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -5751,8 +5751,12 @@ stop_insert ( } if (curwin->w_cursor.lnum != tpos.lnum) curwin->w_cursor = tpos; - else if (cc != NUL) - ++curwin->w_cursor.col; /* put cursor back on the NUL */ + else { + tpos.col++; + if (cc != NUL && gchar_pos(&tpos) == NUL) { + ++curwin->w_cursor.col; // put cursor back on the NUL + } + } /* <C-S-Right> may have started Visual mode, adjust the position for * deleted characters. */ diff --git a/src/nvim/version.c b/src/nvim/version.c index e34db7f40a..5e3331317d 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -253,7 +253,7 @@ static int included_patches[] = { //495 NA 494, 493, - //492, + 492, 491, 490, 489, diff --git a/test/functional/legacy/004_bufenter_with_modelines_spec.lua b/test/functional/legacy/004_bufenter_with_modelines_spec.lua index 6f009b52dd..34e702b798 100644 --- a/test/functional/legacy/004_bufenter_with_modelines_spec.lua +++ b/test/functional/legacy/004_bufenter_with_modelines_spec.lua @@ -46,6 +46,12 @@ describe('BufEnter with modelines', function() -- Include Xxx in the current file feed('G:r Xxx<CR>') + -- Vim issue #57 do not move cursor on <c-o> when autoindent is set + execute('set fo+=r') + feed('G') + feed('o# abcdef<Esc>2hi<CR><c-o>d0<Esc>') + feed('o# abcdef<Esc>2hi<c-o>d0<Esc>') + expect([[ startstart start of test file Xxx @@ -63,7 +69,10 @@ describe('BufEnter with modelines', function() this is a test this is a test this should be in column 1 - end of test file Xxx]]) + end of test file Xxx + # abc + def + def]]) end) teardown(function() |