mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-24 11:41:15 -03:00
Improvements to new parser. All functions and completions now parse.
This commit is contained in:
@@ -245,10 +245,10 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc
|
||||
const wchar_t * const cursor = buff + cursor_pos;
|
||||
|
||||
CHECK(buff,);
|
||||
|
||||
|
||||
const size_t bufflen = wcslen(buff);
|
||||
assert(cursor_pos <= bufflen);
|
||||
|
||||
|
||||
/* ap and bp are the beginning and end of the tightest command substitition found so far */
|
||||
const wchar_t *ap = buff, *bp = buff + bufflen;
|
||||
const wchar_t *pos = buff;
|
||||
@@ -260,13 +260,13 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc
|
||||
/* No subshell found, all done */
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Intrepret NULL to mean the end */
|
||||
if (end == NULL)
|
||||
{
|
||||
end = const_cast<wchar_t *>(buff) + bufflen;
|
||||
}
|
||||
|
||||
|
||||
if (begin < cursor && end >= cursor)
|
||||
{
|
||||
/* This command substitution surrounds the cursor, so it's a tighter fit */
|
||||
@@ -288,7 +288,7 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc
|
||||
assert(pos <= buff + bufflen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (a != NULL) *a = ap;
|
||||
if (b != NULL) *b = bp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user