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:
parent
9daae6baa6
commit
ebcaffbae9
7 changed files with 204 additions and 24 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue