mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
@@ -3808,8 +3808,9 @@ current_quote(
|
|||||||
}
|
}
|
||||||
|
|
||||||
vis_bef_curs = lt(VIsual, curwin->w_cursor);
|
vis_bef_curs = lt(VIsual, curwin->w_cursor);
|
||||||
|
vis_empty = equalpos(VIsual, curwin->w_cursor);
|
||||||
if (*p_sel == 'e') {
|
if (*p_sel == 'e') {
|
||||||
if (!vis_bef_curs) {
|
if (!vis_bef_curs && !vis_empty) {
|
||||||
// VIsual needs to be start of Visual selection.
|
// VIsual needs to be start of Visual selection.
|
||||||
pos_T t = curwin->w_cursor;
|
pos_T t = curwin->w_cursor;
|
||||||
|
|
||||||
@@ -3819,9 +3820,9 @@ current_quote(
|
|||||||
restore_vis_bef = true;
|
restore_vis_bef = true;
|
||||||
}
|
}
|
||||||
dec_cursor();
|
dec_cursor();
|
||||||
}
|
|
||||||
vis_empty = equalpos(VIsual, curwin->w_cursor);
|
vis_empty = equalpos(VIsual, curwin->w_cursor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!vis_empty) {
|
if (!vis_empty) {
|
||||||
/* Check if the existing selection exactly spans the text inside
|
/* Check if the existing selection exactly spans the text inside
|
||||||
|
@@ -65,6 +65,7 @@ typedef struct tag_pointers {
|
|||||||
char_u *tagkind_end; // end of tagkind
|
char_u *tagkind_end; // end of tagkind
|
||||||
char_u *user_data; // user_data string
|
char_u *user_data; // user_data string
|
||||||
char_u *user_data_end; // end of user_data
|
char_u *user_data_end; // end of user_data
|
||||||
|
linenr_T tagline; // "line:" value
|
||||||
} tagptrs_T;
|
} tagptrs_T;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2545,6 +2546,7 @@ parse_match(
|
|||||||
|
|
||||||
tagp->tagkind = NULL;
|
tagp->tagkind = NULL;
|
||||||
tagp->user_data = NULL;
|
tagp->user_data = NULL;
|
||||||
|
tagp->tagline = 0;
|
||||||
tagp->command_end = NULL;
|
tagp->command_end = NULL;
|
||||||
|
|
||||||
if (retval == OK) {
|
if (retval == OK) {
|
||||||
@@ -2564,6 +2566,8 @@ parse_match(
|
|||||||
tagp->tagkind = p + 5;
|
tagp->tagkind = p + 5;
|
||||||
} else if (STRNCMP(p, "user_data:", 10) == 0) {
|
} else if (STRNCMP(p, "user_data:", 10) == 0) {
|
||||||
tagp->user_data = p + 10;
|
tagp->user_data = p + 10;
|
||||||
|
} else if (STRNCMP(p, "line:", 5) == 0) {
|
||||||
|
tagp->tagline = atoi((char *)p + 5);
|
||||||
}
|
}
|
||||||
if (tagp->tagkind != NULL && tagp->user_data != NULL) {
|
if (tagp->tagkind != NULL && tagp->user_data != NULL) {
|
||||||
break;
|
break;
|
||||||
@@ -2811,7 +2815,13 @@ static int jumpto_tag(
|
|||||||
p_ic = FALSE; /* don't ignore case now */
|
p_ic = FALSE; /* don't ignore case now */
|
||||||
p_scs = FALSE;
|
p_scs = FALSE;
|
||||||
save_lnum = curwin->w_cursor.lnum;
|
save_lnum = curwin->w_cursor.lnum;
|
||||||
curwin->w_cursor.lnum = 0; /* start search before first line */
|
if (tagp.tagline > 0) {
|
||||||
|
// start search before line from "line:" field
|
||||||
|
curwin->w_cursor.lnum = tagp.tagline - 1;
|
||||||
|
} else {
|
||||||
|
// start search before first line
|
||||||
|
curwin->w_cursor.lnum = 0;
|
||||||
|
}
|
||||||
if (do_search(NULL, pbuf[0], pbuf + 1, (long)1,
|
if (do_search(NULL, pbuf[0], pbuf + 1, (long)1,
|
||||||
search_options, NULL)) {
|
search_options, NULL)) {
|
||||||
retval = OK;
|
retval = OK;
|
||||||
|
@@ -320,6 +320,19 @@ func Test_zz_Numbers()
|
|||||||
\ ])
|
\ ])
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Affix flags
|
||||||
|
func Test_zz_affix_flags()
|
||||||
|
call LoadAffAndDic(g:test_data_aff10, g:test_data_dic10)
|
||||||
|
call RunGoodBad("drink drinkable drinkables drinktable drinkabletable",
|
||||||
|
\ "bad: drinks drinkstable drinkablestable",
|
||||||
|
\ ["drink", "drinkable", "drinkables", "table"],
|
||||||
|
\ [['bad', []],
|
||||||
|
\ ['drinks', ['drink']],
|
||||||
|
\ ['drinkstable', ['drinktable', 'drinkable', 'drink table']],
|
||||||
|
\ ['drinkablestable', ['drinkabletable', 'drinkables table', 'drinkable table']],
|
||||||
|
\ ])
|
||||||
|
endfunc
|
||||||
|
|
||||||
function FirstSpellWord()
|
function FirstSpellWord()
|
||||||
call feedkeys("/^start:\n", 'tx')
|
call feedkeys("/^start:\n", 'tx')
|
||||||
normal ]smm
|
normal ]smm
|
||||||
@@ -751,6 +764,21 @@ let g:test_data_dic9 = [
|
|||||||
\"foo",
|
\"foo",
|
||||||
\"bar",
|
\"bar",
|
||||||
\ ]
|
\ ]
|
||||||
|
let g:test_data_aff10 = [
|
||||||
|
\"COMPOUNDRULE se",
|
||||||
|
\"COMPOUNDPERMITFLAG p",
|
||||||
|
\"",
|
||||||
|
\"SFX A Y 1",
|
||||||
|
\"SFX A 0 able/Mp .",
|
||||||
|
\"",
|
||||||
|
\"SFX M Y 1",
|
||||||
|
\"SFX M 0 s .",
|
||||||
|
\ ]
|
||||||
|
let g:test_data_dic10 = [
|
||||||
|
\"1234",
|
||||||
|
\"drink/As",
|
||||||
|
\"table/e",
|
||||||
|
\ ]
|
||||||
let g:test_data_aff_sal = [
|
let g:test_data_aff_sal = [
|
||||||
\"SET ISO8859-1",
|
\"SET ISO8859-1",
|
||||||
\"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
|
\"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
|
||||||
|
@@ -466,4 +466,28 @@ func Test_tag_line_toolong()
|
|||||||
let &verbose = old_vbs
|
let &verbose = old_vbs
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_tagline()
|
||||||
|
call writefile([
|
||||||
|
\ 'provision Xtest.py /^ def provision(self, **kwargs):$/;" m line:1 language:Python class:Foo',
|
||||||
|
\ 'provision Xtest.py /^ def provision(self, **kwargs):$/;" m line:3 language:Python class:Bar',
|
||||||
|
\], 'Xtags')
|
||||||
|
call writefile([
|
||||||
|
\ ' def provision(self, **kwargs):',
|
||||||
|
\ ' pass',
|
||||||
|
\ ' def provision(self, **kwargs):',
|
||||||
|
\ ' pass',
|
||||||
|
\], 'Xtest.py')
|
||||||
|
|
||||||
|
set tags=Xtags
|
||||||
|
|
||||||
|
1tag provision
|
||||||
|
call assert_equal(line('.'), 1)
|
||||||
|
2tag provision
|
||||||
|
call assert_equal(line('.'), 3)
|
||||||
|
|
||||||
|
call delete('Xtags')
|
||||||
|
call delete('Xtest.py')
|
||||||
|
set tags&
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -48,6 +48,9 @@ func Test_quote_selection_selection_exclusive()
|
|||||||
set selection=exclusive
|
set selection=exclusive
|
||||||
exe "norm! fdvhi'y"
|
exe "norm! fdvhi'y"
|
||||||
call assert_equal('bcde', @")
|
call assert_equal('bcde', @")
|
||||||
|
let @"='dummy'
|
||||||
|
exe "norm! $gevi'y"
|
||||||
|
call assert_equal('bcde', @")
|
||||||
set selection&vim
|
set selection&vim
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
Reference in New Issue
Block a user