mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.2332: missing file in refactoring
Problem: Missing file in refactoring.
Solution: Update missing file.
556ae8ea28
This commit is contained in:
parent
e2a2efc432
commit
15e5acada9
@ -7173,46 +7173,6 @@ int get_sts_value(void)
|
|||||||
return (int)result;
|
return (int)result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check matchpairs option for "*initc".
|
|
||||||
/// If there is a match set "*initc" to the matching character and "*findc" to
|
|
||||||
/// the opposite character. Set "*backwards" to the direction.
|
|
||||||
/// When "switchit" is true swap the direction.
|
|
||||||
void find_mps_values(int *initc, int *findc, int *backwards, int switchit)
|
|
||||||
{
|
|
||||||
char_u *ptr = curbuf->b_p_mps;
|
|
||||||
|
|
||||||
while (*ptr != NUL) {
|
|
||||||
if (utf_ptr2char(ptr) == *initc) {
|
|
||||||
if (switchit) {
|
|
||||||
*findc = *initc;
|
|
||||||
*initc = utf_ptr2char(ptr + utfc_ptr2len(ptr) + 1);
|
|
||||||
*backwards = true;
|
|
||||||
} else {
|
|
||||||
*findc = utf_ptr2char(ptr + utfc_ptr2len(ptr) + 1);
|
|
||||||
*backwards = false;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
char_u *prev = ptr;
|
|
||||||
ptr += utfc_ptr2len(ptr) + 1;
|
|
||||||
if (utf_ptr2char(ptr) == *initc) {
|
|
||||||
if (switchit) {
|
|
||||||
*findc = *initc;
|
|
||||||
*initc = utf_ptr2char(prev);
|
|
||||||
*backwards = false;
|
|
||||||
} else {
|
|
||||||
*findc = utf_ptr2char(prev);
|
|
||||||
*backwards = true;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ptr += utfc_ptr2len(ptr);
|
|
||||||
if (*ptr == ',') {
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This is called when 'breakindentopt' is changed and when a window is
|
/// This is called when 'breakindentopt' is changed and when a window is
|
||||||
/// initialized
|
/// initialized
|
||||||
static bool briopt_check(win_T *wp)
|
static bool briopt_check(win_T *wp)
|
||||||
|
@ -1658,6 +1658,48 @@ static bool find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos)
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Check matchpairs option for "*initc".
|
||||||
|
/// If there is a match set "*initc" to the matching character and "*findc" to
|
||||||
|
/// the opposite character. Set "*backwards" to the direction.
|
||||||
|
/// When "switchit" is true swap the direction.
|
||||||
|
static void find_mps_values(int *initc, int *findc, bool *backwards,
|
||||||
|
bool switchit)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
|
{
|
||||||
|
char_u *ptr = curbuf->b_p_mps;
|
||||||
|
|
||||||
|
while (*ptr != NUL) {
|
||||||
|
if (utf_ptr2char(ptr) == *initc) {
|
||||||
|
if (switchit) {
|
||||||
|
*findc = *initc;
|
||||||
|
*initc = utf_ptr2char(ptr + utfc_ptr2len(ptr) + 1);
|
||||||
|
*backwards = true;
|
||||||
|
} else {
|
||||||
|
*findc = utf_ptr2char(ptr + utfc_ptr2len(ptr) + 1);
|
||||||
|
*backwards = false;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
char_u *prev = ptr;
|
||||||
|
ptr += utfc_ptr2len(ptr) + 1;
|
||||||
|
if (utf_ptr2char(ptr) == *initc) {
|
||||||
|
if (switchit) {
|
||||||
|
*findc = *initc;
|
||||||
|
*initc = utf_ptr2char(prev);
|
||||||
|
*backwards = false;
|
||||||
|
} else {
|
||||||
|
*findc = utf_ptr2char(prev);
|
||||||
|
*backwards = true;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ptr += utfc_ptr2len(ptr);
|
||||||
|
if (*ptr == ',') {
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* findmatchlimit -- find the matching paren or brace, if it exists within
|
* findmatchlimit -- find the matching paren or brace, if it exists within
|
||||||
* maxtravel lines of the cursor. A maxtravel of 0 means search until falling
|
* maxtravel lines of the cursor. A maxtravel of 0 means search until falling
|
||||||
@ -1684,7 +1726,7 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
static pos_T pos; // current search position
|
static pos_T pos; // current search position
|
||||||
int findc = 0; // matching brace
|
int findc = 0; // matching brace
|
||||||
int count = 0; // cumulative number of braces
|
int count = 0; // cumulative number of braces
|
||||||
int backwards = false; // init for gcc
|
bool backwards = false; // init for gcc
|
||||||
bool raw_string = false; // search for raw string
|
bool raw_string = false; // search for raw string
|
||||||
bool inquote = false; // true when inside quotes
|
bool inquote = false; // true when inside quotes
|
||||||
char_u *ptr;
|
char_u *ptr;
|
||||||
@ -1729,9 +1771,10 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
raw_string = (initc == 'R');
|
raw_string = (initc == 'R');
|
||||||
initc = NUL;
|
initc = NUL;
|
||||||
} else if (initc != '#' && initc != NUL) {
|
} else if (initc != '#' && initc != NUL) {
|
||||||
find_mps_values(&initc, &findc, &backwards, TRUE);
|
find_mps_values(&initc, &findc, &backwards, true);
|
||||||
if (findc == NUL)
|
if (findc == NUL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Either initc is '#', or no initc was given and we need to look
|
* Either initc is '#', or no initc was given and we need to look
|
||||||
@ -1759,20 +1802,20 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
else if (linep[pos.col] == '/') {
|
else if (linep[pos.col] == '/') {
|
||||||
if (linep[pos.col + 1] == '*') {
|
if (linep[pos.col + 1] == '*') {
|
||||||
comment_dir = FORWARD;
|
comment_dir = FORWARD;
|
||||||
backwards = FALSE;
|
backwards = false;
|
||||||
pos.col++;
|
pos.col++;
|
||||||
} else if (pos.col > 0 && linep[pos.col - 1] == '*') {
|
} else if (pos.col > 0 && linep[pos.col - 1] == '*') {
|
||||||
comment_dir = BACKWARD;
|
comment_dir = BACKWARD;
|
||||||
backwards = TRUE;
|
backwards = true;
|
||||||
pos.col--;
|
pos.col--;
|
||||||
}
|
}
|
||||||
} else if (linep[pos.col] == '*') {
|
} else if (linep[pos.col] == '*') {
|
||||||
if (linep[pos.col + 1] == '/') {
|
if (linep[pos.col + 1] == '/') {
|
||||||
comment_dir = BACKWARD;
|
comment_dir = BACKWARD;
|
||||||
backwards = TRUE;
|
backwards = true;
|
||||||
} else if (pos.col > 0 && linep[pos.col - 1] == '/') {
|
} else if (pos.col > 0 && linep[pos.col - 1] == '/') {
|
||||||
comment_dir = FORWARD;
|
comment_dir = FORWARD;
|
||||||
backwards = FALSE;
|
backwards = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1794,9 +1837,10 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
if (initc == NUL)
|
if (initc == NUL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
find_mps_values(&initc, &findc, &backwards, FALSE);
|
find_mps_values(&initc, &findc, &backwards, false);
|
||||||
if (findc)
|
if (findc) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
pos.col += utfc_ptr2len(linep + pos.col);
|
pos.col += utfc_ptr2len(linep + pos.col);
|
||||||
}
|
}
|
||||||
if (!findc) {
|
if (!findc) {
|
||||||
|
Loading…
Reference in New Issue
Block a user