コード例 #1
0
void clEditorConfigSection::PrintToLog()
{
    clDEBUG1() << ".editorconfig (" << filename << ") :" << clEndl;
    if(IsCharsetSet()) {
        clDEBUG1() << "charset:" << GetCharset() << clEndl;
    }
    if(IsIndentSizeSet()) {
        clDEBUG1() << "indent_size:" << GetIndentSize() << clEndl;
    }
    if(IsIndentStyleSet()) {
        clDEBUG1() << "indent_style:" << GetIndentStyle() << clEndl;
    }
    if(IsInsertFinalNewlineSet()) {
        clDEBUG1() << "insert_final_newline:" << IsInsertFinalNewline() << clEndl;
    }
    if(IsSetEndOfLineSet()) {
        clDEBUG1() << "end_of_line:" << GetEndOfLine() << clEndl;
    }
    if(IsTabWidthSet()) {
        clDEBUG1() << "tab_width:" << GetTabWidth() << clEndl;
    }
    if(IsTrimTrailingWhitespaceSet()) {
        clDEBUG1() << "trim_trailing_whitespace:" << IsTrimTrailingWhitespace() << clEndl;
    }
}
コード例 #2
0
size_t MoveDown(const std::vector<wchar_t>& chars, size_t tabSize, size_t p)
{
    size_t charsStartOfLine = GetStartOfLine(chars, p);
    size_t charsLineColumn = GetColumn(chars, charsStartOfLine, tabSize, p);
    size_t charsStartOfNextLine = GetStartOfNextLine(chars, p);
    if (charsStartOfNextLine != UINT_MAX)
    {
        size_t ret = GetOffset(chars, charsStartOfNextLine, tabSize, charsLineColumn);
        size_t charsEndOfNextLine = GetEndOfLine(chars, charsStartOfNextLine);
        if (ret > charsEndOfNextLine)
            ret = charsEndOfNextLine;
        return ret;
    }
    else
        return p;
}
コード例 #3
0
size_t GetOffset(const std::vector<wchar_t>& chars, size_t startLine, size_t tabSize, size_t column)
{
#if 0
    size_t p = startLine + column;  // TODO Needs to be fixed for tabs
    size_t end = GetEndOfLine(chars, startLine);
    if (p > end)
        p = end;
    return p;
#else
    size_t p = startLine;
    for (size_t i = 0; p < chars.size() && i < column; ++i)
    {
        if (chars[p] == L'\t')
        {
            size_t d = tabSize - (i % tabSize) - 1;
            if (i + d > column)
                break;
            i += d;
        }
        ++p;
    }
    return p;
#endif
}