aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/filetype.vim3
-rw-r--r--src/nvim/diff.c16
-rw-r--r--src/nvim/eval.c5
-rw-r--r--src/nvim/ex_cmds.c8
-rw-r--r--src/nvim/version.c20
5 files changed, 35 insertions, 17 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index c9686b8502..5dbd1a9a19 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1393,7 +1393,7 @@ else
au BufNewFile,BufRead *.pl call s:FTpl()
endif
au BufNewFile,BufRead *.plx,*.al setf perl
-au BufNewFile,BufRead *.p6,*.pm6 setf perl6
+au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6
func! s:FTpl()
if exists("g:filetype_pl")
@@ -1422,6 +1422,7 @@ au BufNewFile,BufRead *.pm
" Perl POD
au BufNewFile,BufRead *.pod setf pod
+au BufNewFile,BufRead *.pod6 setf pod6
" Php, php3, php4, etc.
" Also Phtml (was used for PHP 2 in the past)
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index d311588ab4..ce79158050 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -1007,6 +1007,7 @@ theend:
void ex_diffsplit(exarg_T *eap)
{
win_T *old_curwin = curwin;
+ buf_T *old_curbuf = curbuf;
// don't use a new tab page, each tab page has its own diffs
cmdmod.tab = 0;
@@ -1020,8 +1021,19 @@ void ex_diffsplit(exarg_T *eap)
// split must have worked
if (curwin != old_curwin) {
// Set 'diff', 'scrollbind' on and 'wrap' off.
- diff_win_options(curwin, TRUE);
- diff_win_options(old_curwin, TRUE);
+ diff_win_options(curwin, true);
+ if (win_valid(old_curwin)) {
+ diff_win_options(old_curwin, true);
+
+ if (buf_valid(old_curbuf)) {
+ // Move the cursor position to that of the old window.
+ curwin->w_cursor.lnum = diff_get_corresponding_line(
+ old_curbuf,
+ old_curwin->w_cursor.lnum,
+ curbuf,
+ curwin->w_cursor.lnum);
+ }
+ }
}
}
}
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index a1321d0227..7ac51d7bd7 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -19793,7 +19793,10 @@ void ex_function(exarg_T *eap)
/* insert the new function in the function list */
STRCPY(fp->uf_name, name);
- hash_add(&func_hashtab, UF2HIKEY(fp));
+ if (hash_add(&func_hashtab, UF2HIKEY(fp)) == FAIL) {
+ xfree(fp);
+ goto erret;
+ }
}
fp->uf_refcount = 1;
fp->uf_args = newargs;
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 29cff5a2b2..b1ae6520b1 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -495,10 +495,12 @@ void ex_sort(exarg_T *eap)
s = ml_get(nrs[eap->forceit ? count - i - 1 : i].lnum);
if (!unique || i == 0
|| (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0) {
- if (ml_append(lnum++, s, (colnr_T)0, FALSE) == FAIL)
+ // Copy the line into a buffer, it may become invalid in
+ // ml_append(). And it's needed for "unique".
+ STRCPY(sortbuf1, s);
+ if (ml_append(lnum++, sortbuf1, (colnr_T)0, false) == FAIL) {
break;
- if (unique)
- STRCPY(sortbuf1, s);
+ }
}
fast_breakcheck();
if (got_int)
diff --git a/src/nvim/version.c b/src/nvim/version.c
index d0a2771a19..95e8cb2d26 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -135,32 +135,32 @@ static int included_patches[] = {
// 992 NA
// 991,
// 990 NA
- // 989,
+ 989,
// 988 NA
// 987 NA
// 986 NA
// 985 NA
// 984,
// 983,
- // 982,
+ // 982 NA
// 981,
// 980,
// 979 NA
// 978,
// 977,
// 976 NA
- // 975,
+ 975,
// 974,
// 973,
- // 972,
- // 971,
- // 970,
+ 972,
+ // 971 NA
+ // 970 NA
// 969,
- // 968,
+ // 968 NA
// 967 NA
// 966 NA
// 965 NA
- // 964,
+ // 964 NA
// 963,
// 962 NA
// 961,
@@ -169,7 +169,7 @@ static int included_patches[] = {
// 958,
// 957,
// 956,
- // 955,
+ 955,
// 954 NA
953,
// 952,
@@ -346,7 +346,7 @@ static int included_patches[] = {
781,
// 780 NA
// 779,
- // 778 NA
+ // 778,
// 777 NA
776,
775,