mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 08:10:10 +00:00
Fix matching multiple consecutive quoted strings
This commit is contained in:
parent
7f55fca625
commit
b19b2fbb38
1 changed files with 4 additions and 2 deletions
|
|
@ -38,10 +38,12 @@ namespace PluralKit.Bot.CommandSystem
|
||||||
return _cmd.Substring(start, end - start).Trim();
|
return _cmd.Substring(start, end - start).Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Remainder() => _cmd.Substring(_ptr).Trim();
|
public string Remainder() => _cmd.Substring(Math.Min(_ptr, _cmd.Length)).Trim();
|
||||||
public string FullCommand => _cmd;
|
public string FullCommand => _cmd;
|
||||||
|
|
||||||
// Returns tuple of (startpos, endpos, advanceafter)
|
// Returns tuple of (startpos, endpos, advanceafter)
|
||||||
|
// advanceafter is how much to move the pointer afterwards to point it
|
||||||
|
// at the start of the next word
|
||||||
private ValueTuple<int, int, int>? NextWordPosition()
|
private ValueTuple<int, int, int>? NextWordPosition()
|
||||||
{
|
{
|
||||||
// Is this the end of the string?
|
// Is this the end of the string?
|
||||||
|
|
@ -65,7 +67,7 @@ namespace PluralKit.Bot.CommandSystem
|
||||||
return (_ptr, _cmd.Length, 0);
|
return (_ptr, _cmd.Length, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (_ptr + 1, endQuotePosition, 1);
|
return (_ptr + 1, endQuotePosition, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue