mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
Merge pull request #13818 from janlazo/vim-8.2.2379
vim-patch:8.2.{2375,2379,2384,2385}
This commit is contained in:
@@ -1733,8 +1733,13 @@ au BufNewFile,BufRead *.tli setf tli
|
||||
" Telix Salt
|
||||
au BufNewFile,BufRead *.slt setf tsalt
|
||||
|
||||
" Tera Term Language
|
||||
au BufRead,BufNewFile *.ttl setf teraterm
|
||||
" Tera Term Language or Turtle
|
||||
au BufRead,BufNewFile *.ttl
|
||||
\ if getline(1) =~ '^@\?\(prefix\|base\)' |
|
||||
\ setf turtle |
|
||||
\ else |
|
||||
\ setf teraterm |
|
||||
\ endif
|
||||
|
||||
" Terminfo
|
||||
au BufNewFile,BufRead *.ti setf terminfo
|
||||
|
@@ -3978,16 +3978,19 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
|
||||
curwin->w_curswant -= width2;
|
||||
} else {
|
||||
// to previous line
|
||||
|
||||
// Move to the start of a closed fold. Don't do that when
|
||||
// 'foldopen' contains "all": it will open in a moment.
|
||||
if (!(fdo_flags & FDO_ALL)) {
|
||||
(void)hasFolding(curwin->w_cursor.lnum,
|
||||
&curwin->w_cursor.lnum, NULL);
|
||||
}
|
||||
if (curwin->w_cursor.lnum == 1) {
|
||||
retval = false;
|
||||
break;
|
||||
}
|
||||
--curwin->w_cursor.lnum;
|
||||
/* Move to the start of a closed fold. Don't do that when
|
||||
* 'foldopen' contains "all": it will open in a moment. */
|
||||
if (!(fdo_flags & FDO_ALL))
|
||||
(void)hasFolding(curwin->w_cursor.lnum,
|
||||
&curwin->w_cursor.lnum, NULL);
|
||||
curwin->w_cursor.lnum--;
|
||||
|
||||
linelen = linetabsize(get_cursor_line_ptr());
|
||||
if (linelen > width1) {
|
||||
int w = (((linelen - width1 - 1) / width2) + 1) * width2;
|
||||
@@ -6708,11 +6711,8 @@ static void nv_g_cmd(cmdarg_T *cap)
|
||||
*/
|
||||
case 'j':
|
||||
case K_DOWN:
|
||||
/* with 'nowrap' it works just like the normal "j" command; also when
|
||||
* in a closed fold */
|
||||
if (!curwin->w_p_wrap
|
||||
|| hasFolding(curwin->w_cursor.lnum, NULL, NULL)
|
||||
) {
|
||||
// with 'nowrap' it works just like the normal "j" command.
|
||||
if (!curwin->w_p_wrap) {
|
||||
oap->motion_type = kMTLineWise;
|
||||
i = cursor_down(cap->count1, oap->op_type == OP_NOP);
|
||||
} else
|
||||
@@ -6723,11 +6723,8 @@ static void nv_g_cmd(cmdarg_T *cap)
|
||||
|
||||
case 'k':
|
||||
case K_UP:
|
||||
/* with 'nowrap' it works just like the normal "k" command; also when
|
||||
* in a closed fold */
|
||||
if (!curwin->w_p_wrap
|
||||
|| hasFolding(curwin->w_cursor.lnum, NULL, NULL)
|
||||
) {
|
||||
// with 'nowrap' it works just like the normal "k" command.
|
||||
if (!curwin->w_p_wrap) {
|
||||
oap->motion_type = kMTLineWise;
|
||||
i = cursor_up(cap->count1, oap->op_type == OP_NOP);
|
||||
} else
|
||||
|
@@ -3123,6 +3123,7 @@ spell_find_suggest (
|
||||
static bool expr_busy = false;
|
||||
int c;
|
||||
langp_T *lp;
|
||||
bool did_intern = false;
|
||||
|
||||
// Set the info in "*su".
|
||||
memset(su, 0, sizeof(suginfo_T));
|
||||
@@ -3206,14 +3207,16 @@ spell_find_suggest (
|
||||
spell_suggest_expr(su, buf + 5);
|
||||
expr_busy = false;
|
||||
}
|
||||
} else if (STRNCMP(buf, "file:", 5) == 0)
|
||||
} else if (STRNCMP(buf, "file:", 5) == 0) {
|
||||
// Use list of suggestions in a file.
|
||||
spell_suggest_file(su, buf + 5);
|
||||
else {
|
||||
// Use internal method.
|
||||
} else if (!did_intern) {
|
||||
// Use internal method once.
|
||||
spell_suggest_intern(su, interactive);
|
||||
if (sps_flags & SPS_DOUBLE)
|
||||
if (sps_flags & SPS_DOUBLE) {
|
||||
do_combine = true;
|
||||
}
|
||||
did_intern = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -692,6 +692,23 @@ func Test_ts_file()
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_ttl_file()
|
||||
filetype on
|
||||
|
||||
call writefile(['@base <http://example.org/> .'], 'Xfile.ttl')
|
||||
split Xfile.ttl
|
||||
call assert_equal('turtle', &filetype)
|
||||
bwipe!
|
||||
|
||||
call writefile(['looks like Tera Term Language'], 'Xfile.ttl')
|
||||
split Xfile.ttl
|
||||
call assert_equal('teraterm', &filetype)
|
||||
bwipe!
|
||||
|
||||
call delete('Xfile.ttl')
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_pp_file()
|
||||
filetype on
|
||||
|
||||
|
@@ -822,4 +822,39 @@ func Test_fold_create_delete()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_fold_relative_move()
|
||||
enew!
|
||||
set fdm=indent sw=2 wrap tw=80
|
||||
|
||||
let content = [ ' foo', ' bar', ' baz',
|
||||
\ repeat('x', 100),
|
||||
\ ' foo', ' bar', ' baz'
|
||||
\ ]
|
||||
call append(0, content)
|
||||
|
||||
normal zM
|
||||
|
||||
call cursor(3, 1)
|
||||
call assert_true(foldclosed(line('.')))
|
||||
normal gj
|
||||
call assert_equal(2, winline())
|
||||
|
||||
call cursor(2, 1)
|
||||
call assert_true(foldclosed(line('.')))
|
||||
normal 2gj
|
||||
call assert_equal(3, winline())
|
||||
|
||||
call cursor(5, 1)
|
||||
call assert_true(foldclosed(line('.')))
|
||||
normal gk
|
||||
call assert_equal(3, winline())
|
||||
|
||||
call cursor(6, 1)
|
||||
call assert_true(foldclosed(line('.')))
|
||||
normal 2gk
|
||||
call assert_equal(2, winline())
|
||||
|
||||
set fdm& sw& wrap& tw&
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
source view_util.vim
|
||||
source screendump.vim
|
||||
source check.vim
|
||||
|
||||
func Test_highlight()
|
||||
" basic test if ":highlight" doesn't crash
|
||||
@@ -610,3 +611,16 @@ func Test_1_highlight_Normalgroup_exists()
|
||||
call assert_match('hi Normal\s*font=.*', hlNormal)
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Test for using RGB color values in a highlight group
|
||||
func Test_xxlast_highlight_RGB_color()
|
||||
CheckCanRunGui
|
||||
gui -f
|
||||
hi MySearch guifg=#110000 guibg=#001100 guisp=#000011
|
||||
call assert_equal('#110000', synIDattr(synIDtrans(hlID('MySearch')), 'fg#'))
|
||||
call assert_equal('#001100', synIDattr(synIDtrans(hlID('MySearch')), 'bg#'))
|
||||
call assert_equal('#000011', synIDattr(synIDtrans(hlID('MySearch')), 'sp#'))
|
||||
hi clear
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user