diff options
author | oni-link <knil.ino@gmail.com> | 2014-05-31 17:45:34 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-06-04 06:57:37 +0000 |
commit | b09334d5716f249a145f5f20e0dd9e7311283e31 (patch) | |
tree | 674f1b0fa8835ca332fb1e49048d17c805136c96 /src | |
parent | 1fb20575f1c3a6fb8a648a0bd8669a774da7b887 (diff) | |
download | rneovim-b09334d5716f249a145f5f20e0dd9e7311283e31.tar.gz rneovim-b09334d5716f249a145f5f20e0dd9e7311283e31.tar.bz2 rneovim-b09334d5716f249a145f5f20e0dd9e7311283e31.zip |
vim-patch:7.4.277
Problem: Using ":sign unplace *" may leave the cursor in the wrong position
(Christian Brabandt)
Solution: Update the cursor position when removing all signs.
https://code.google.com/p/vim/source/detail?r=373204662d82e894b27ee76bc3319bc62c91f6ae
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer.c | 19 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index de2cb64d59..d5681eabec 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -4360,6 +4360,8 @@ void buf_addsign( return; } +// For an existing, placed sign "markId" change the type to "typenr". +// Returns the line number of the sign, or zero if the sign is not found. linenr_T buf_change_sign_type( buf_T *buf, /* buffer to store sign in */ int markId, /* sign ID */ @@ -4480,6 +4482,15 @@ void buf_delete_signs(buf_T *buf) { signlist_T *next; + // When deleting the last sign need to redraw the windows to remove the + // sign column. + if (buf->b_signlist != NULL) { + redraw_buf_later(buf, NOT_VALID); + // TODO(oni-link): Is this call necessary if curwin is not a viewport + // for buf? + changed_cline_bef_curs(); + } + while (buf->b_signlist != NULL) { next = buf->b_signlist->next; free(buf->b_signlist); @@ -4495,11 +4506,9 @@ void buf_delete_all_signs() buf_T *buf; /* buffer we are checking for signs */ for (buf = firstbuf; buf != NULL; buf = buf->b_next) { - if (buf->b_signlist != NULL) { - /* Need to redraw the windows to remove the sign column. */ - redraw_buf_later(buf, NOT_VALID); - buf_delete_signs(buf); - } + if (buf->b_signlist != NULL) { + buf_delete_signs(buf); + } } } diff --git a/src/nvim/version.c b/src/nvim/version.c index 3deb9eb7c6..6354306a08 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -210,7 +210,7 @@ static int included_patches[] = { //280, //279, //278, - //277, + 277, //276, //275, 274, |