MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / GetOffset

Method GetOffset

CodeFormatServer/src/Lib/LineIndex/LineTypes.cpp:43–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43std::size_t LineOffset::GetOffset(std::size_t colNum) {
44 std::size_t colOffset = 0;
45 std::size_t num = colNum;
46 for (auto &uc: CharsOffsets) {
47 if (num > uc.CharsNum) {
48 num -= uc.CharsNum;
49 colOffset += uc.TotalLen;
50 } else {
51 colOffset += num * uc.Unit;
52 break;
53 }
54 }
55 return Start + colOffset;
56}

Callers 4

RangeReformatMethod · 0.45
CompleteMissTokenMethod · 0.45
FormatLineMethod · 0.45
UpdateFileMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected