1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Bookmark panel tweaks

This commit is contained in:
Brian Fiete 2022-08-23 10:45:57 -07:00
parent 9daae6baa6
commit ebcaffbae9
7 changed files with 204 additions and 24 deletions

View file

@ -452,6 +452,26 @@ void BfParser::GetLineCharAtIdx(int idx, int& line, int& lineChar)
mParserData->GetLineCharAtIdx(idx, line, lineChar);
}
int BfParser::GetIndexAtLine(int line)
{
if (line == 0)
return 0;
int curLine = 0;
for (int i = 0; i < mSrcLength; i++)
{
char c = mSrc[i];
if (c == '\n')
{
curLine++;
if (line == curLine)
return i;
}
}
return -1;
}
void BfParser::Fail(const StringImpl& error, int offset)
{
mPassInstance->FailAt(error, mSourceData, mSrcIdx + offset);