From 76bf21de26340a93005deea0c2f846edc6fc3743 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 26 Dec 2015 19:17:55 -0500 Subject: vim-patch:7.4.605 Problem: The # register is not writable, it cannot be restored after jumping around. Solution: Make the # register writable. (Marcin Szamotulski) https://github.com/vim/vim/commit/3b3a9498d1eab3c28c524cce115160528a9a9297 --- src/nvim/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 762cd3efd3..f498fca6ad 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -920,7 +920,7 @@ do_buffer ( if (start == DOBUF_FIRST) { /* don't warn when deleting */ if (!unload) - EMSGN(_("E86: Buffer %" PRId64 " does not exist"), count); + EMSGN(_(e_nobufnr), count); } else if (dir == FORWARD) EMSG(_("E87: Cannot go beyond last buffer")); else -- cgit From 3fd62f961294d11fff5754a3c597e982b54ca74a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 26 Dec 2015 20:12:24 -0500 Subject: file_pat_to_reg_pat, buflist_findpat: const params file_pat_to_reg_pat() and buflist_findpat() do not modify the data of these parameters. --- src/nvim/buffer.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f498fca6ad..a6e3fedd3f 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -918,13 +918,15 @@ do_buffer ( if (buf == NULL) { /* could not find it */ if (start == DOBUF_FIRST) { - /* don't warn when deleting */ - if (!unload) + // don't warn when deleting + if (!unload) { EMSGN(_(e_nobufnr), count); - } else if (dir == FORWARD) + } + } else if (dir == FORWARD) { EMSG(_("E87: Cannot go beyond last buffer")); - else + } else { EMSG(_("E88: Cannot go before first buffer")); + } return FAIL; } @@ -1711,18 +1713,15 @@ static buf_T *buflist_findname_file_id(char_u *ffname, FileID *file_id, return NULL; } -/* - * Find file in buffer list by a regexp pattern. - * Return fnum of the found buffer. - * Return < 0 for error. - */ -int -buflist_findpat ( - char_u *pattern, - char_u *pattern_end, /* pointer to first char after pattern */ - int unlisted, /* find unlisted buffers */ - int diffmode, /* find diff-mode buffers only */ - int curtab_only /* find buffers in current tab only */ +/// Find file in buffer list by a regexp pattern. +/// Return fnum of the found buffer. +/// Return < 0 for error. +int buflist_findpat( + const char_u *pattern, + const char_u *pattern_end, // pointer to first char after pattern + int unlisted, // find unlisted buffers + int diffmode, // find diff-mode buffers only + int curtab_only // find buffers in current tab only ) { int match = -1; -- cgit