aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-07-23 10:05:51 +0800
committerckelsel <ckelsel@hotmail.com>2017-07-23 10:05:51 +0800
commit31c018244daa12caab3af357a368279a1f55d28c (patch)
tree1527bfa5f8338ba6b669c3e5597c8028214c0bcd
parent2c89195afdce9c66c875801753523f561ed5e4ca (diff)
parent253f6f3bbfd16b7aeb2f72714c1d5d1c88a3478a (diff)
downloadrneovim-31c018244daa12caab3af357a368279a1f55d28c.tar.gz
rneovim-31c018244daa12caab3af357a368279a1f55d28c.tar.bz2
rneovim-31c018244daa12caab3af357a368279a1f55d28c.zip
Merge remote-tracking branch 'upstream/master'
-rw-r--r--src/nvim/option.c17
-rw-r--r--src/nvim/testdir/test_alot.vim1
-rw-r--r--src/nvim/testdir/test_fileformat.vim17
-rw-r--r--src/nvim/testdir/test_matchadd_conceal.vim1
-rw-r--r--src/nvim/version.c6
-rw-r--r--src/nvim/vim.h2
6 files changed, 39 insertions, 5 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 40fae18aaf..75b56b4eb4 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -5718,7 +5718,22 @@ void buf_copy_options(buf_T *buf, int flags)
free_buf_options(buf, TRUE);
buf->b_p_ro = FALSE; /* don't copy readonly */
buf->b_p_fenc = vim_strsave(p_fenc);
- buf->b_p_ff = vim_strsave(p_ff);
+ switch (*p_ffs) {
+ case 'm':
+ buf->b_p_ff = vim_strsave((char_u *)FF_MAC);
+ break;
+ case 'd':
+ buf->b_p_ff = vim_strsave((char_u *)FF_DOS);
+ break;
+ case 'u':
+ buf->b_p_ff = vim_strsave((char_u *)FF_UNIX);
+ break;
+ default:
+ buf->b_p_ff = vim_strsave(p_ff);
+ }
+ if (buf->b_p_ff != NULL) {
+ buf->b_start_ffc = *buf->b_p_ff;
+ }
buf->b_p_bh = empty_option;
buf->b_p_bt = empty_option;
} else
diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim
index 1103778107..d55170c27c 100644
--- a/src/nvim/testdir/test_alot.vim
+++ b/src/nvim/testdir/test_alot.vim
@@ -14,6 +14,7 @@ source test_float_func.vim
source test_functions.vim
source test_goto.vim
source test_jumps.vim
+source test_fileformat.vim
source test_lambda.vim
source test_menu.vim
source test_mapping.vim
diff --git a/src/nvim/testdir/test_fileformat.vim b/src/nvim/testdir/test_fileformat.vim
new file mode 100644
index 0000000000..584f20cdfc
--- /dev/null
+++ b/src/nvim/testdir/test_fileformat.vim
@@ -0,0 +1,17 @@
+" Test behavior of fileformat after bwipeout of last buffer
+
+func Test_fileformat_after_bw()
+ bwipeout
+ set fileformat&
+ if &fileformat == 'dos'
+ let test_fileformats = 'unix'
+ elseif &fileformat == 'unix'
+ let test_fileformats = 'mac'
+ else " must be mac
+ let test_fileformats = 'dos'
+ endif
+ exec 'set fileformats='.test_fileformats
+ bwipeout!
+ call assert_equal(test_fileformats, &fileformat)
+ set fileformats&
+endfunc
diff --git a/src/nvim/testdir/test_matchadd_conceal.vim b/src/nvim/testdir/test_matchadd_conceal.vim
index c788689e33..c11f1a84a9 100644
--- a/src/nvim/testdir/test_matchadd_conceal.vim
+++ b/src/nvim/testdir/test_matchadd_conceal.vim
@@ -277,6 +277,7 @@ function! Test_matchadd_and_syn_conceal()
call assert_notequal(screenattr(1, 11) , screenattr(1, 12))
call assert_equal(screenattr(1, 11) , screenattr(1, 32))
call matchadd('CheckedByCoq', '\%<2l\%>9c\%<16c')
+ redraw!
call assert_equal(expect, s:screenline(1))
call assert_notequal(screenattr(1, 10) , screenattr(1, 11))
call assert_notequal(screenattr(1, 11) , screenattr(1, 12))
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 9b5c5eefb8..d372779c75 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -677,7 +677,7 @@ static const int included_patches[] = {
// 55 NA
// 54 NA
53,
- // 52,
+ 52,
// 51 NA
// 50 NA
49,
@@ -691,14 +691,14 @@ static const int included_patches[] = {
41,
40,
// 39 NA
- // 38,
+ 38,
37,
// 36 NA
35,
// 34,
33,
32,
- // 31,
+ 31,
// 30 NA
// 29 NA
// 28 NA
diff --git a/src/nvim/vim.h b/src/nvim/vim.h
index 5d2c27a2f4..c71ca411ea 100644
--- a/src/nvim/vim.h
+++ b/src/nvim/vim.h
@@ -319,7 +319,7 @@ enum { FOLD_TEXT_LEN = 51 }; //!< buffer size for get_foldtext()
// Lowest number used for window ID. Cannot have this many windows per tab.
#define LOWEST_WIN_ID 1000
-#if defined(__FreeBSD__) && defined(S_ISCHR)
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(S_ISCHR)
# define OPEN_CHR_FILES
#endif