MCPcopy Create free account
hub / github.com/SpartanJ/eepp / getLineSpaces

Function getLineSpaces

src/eepp/ui/uicodeeditor.cpp:4635–4648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4633}
4634
4635static Int64 getLineSpaces( TextDocument& doc, int line, int dir, int indentSize ) {
4636 if ( line < 0 || line >= (int)doc.linesCount() )
4637 return -1;
4638 const auto& text = doc.line( line ).getText();
4639 if ( text.size() <= 1 )
4640 return -1;
4641 auto s = text.find_first_not_of( " \t\n" );
4642 if ( s == std::string::npos )
4643 return -getLineSpaces( doc, line + dir, dir, indentSize );
4644 int n = 0;
4645 for ( size_t i = 0; i < s; ++i )
4646 n += text[i] == ' ' ? 1 : indentSize;
4647 return n;
4648}
4649
4650static Int64 getLineIndentGuideSpaces( TextDocument& doc, int line, int indentSize ) {
4651 if ( doc.line( line ).getText().find_first_not_of( " \t\n" ) == std::string::npos )

Callers 1

getLineIndentGuideSpacesFunction · 0.85

Calls 4

linesCountMethod · 0.80
find_first_not_ofMethod · 0.80
getTextMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected