Reformat code.

This commit is contained in:
2026-02-17 13:44:36 -08:00
parent 95a588b0df
commit 337b585ba0
114 changed files with 32253 additions and 16316 deletions

View File

@@ -143,7 +143,7 @@ CppHighlighter::HighlightLineStateful(const Buffer &buf,
bool closed = false;
while (j + 1 <= n) {
if (j + 1 < n && s[j] == '*' && s[j + 1] == '/') {
j += 2;
j += 2;
closed = true;
break;
}
@@ -276,4 +276,4 @@ CppHighlighter::HighlightLineStateful(const Buffer &buf,
return state;
}
} // namespace kte
} // namespace kte

View File

@@ -32,4 +32,4 @@ private:
static bool is_ident_char(char c);
};
} // namespace kte
} // namespace kte

View File

@@ -156,4 +156,4 @@ ErlangHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highlig
++i;
}
}
} // namespace kte
} // namespace kte

View File

@@ -14,4 +14,4 @@ public:
private:
std::unordered_set<std::string> kws_;
};
} // namespace kte
} // namespace kte

View File

@@ -118,4 +118,4 @@ ForthHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highligh
++i;
}
}
} // namespace kte
} // namespace kte

View File

@@ -14,4 +14,4 @@ public:
private:
std::unordered_set<std::string> kws_;
};
} // namespace kte
} // namespace kte

View File

@@ -75,7 +75,7 @@ GoHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<HighlightSp
bool closed = false;
while (j + 1 <= n) {
if (j + 1 < n && s[j] == '*' && s[j + 1] == '/') {
j += 2;
j += 2;
closed = true;
break;
}
@@ -154,4 +154,4 @@ GoHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<HighlightSp
++i;
}
}
} // namespace kte
} // namespace kte

View File

@@ -15,4 +15,4 @@ private:
std::unordered_set<std::string> kws_;
std::unordered_set<std::string> types_;
};
} // namespace kte
} // namespace kte

View File

@@ -221,4 +221,4 @@ HighlighterEngine::PrefetchViewport(const Buffer &buf, int first_row, int row_co
ensure_worker_started();
cv_.notify_one();
}
} // namespace kte
} // namespace kte

View File

@@ -87,4 +87,4 @@ private:
void worker_loop() const;
};
} // namespace kte
} // namespace kte

View File

@@ -244,4 +244,4 @@ HighlighterRegistry::RegisterTreeSitter(std::string_view filetype,
}, /*override_existing=*/true);
}
#endif
} // namespace kte
} // namespace kte

View File

@@ -44,4 +44,4 @@ public:
const TSLanguage * (*get_language)());
#endif
};
} // namespace kte
} // namespace kte

View File

@@ -87,4 +87,4 @@ JSONHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highlight
++i;
}
}
} // namespace kte
} // namespace kte

View File

@@ -9,4 +9,4 @@ class JSONHighlighter final : public LanguageHighlighter {
public:
void HighlightLine(const Buffer &buf, int row, std::vector<HighlightSpan> &out) const override;
};
} // namespace kte
} // namespace kte

View File

@@ -48,4 +48,4 @@ public:
return true;
}
};
} // namespace kte
} // namespace kte

View File

@@ -104,4 +104,4 @@ LispHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highlight
++i;
}
}
} // namespace kte
} // namespace kte

View File

@@ -14,4 +14,4 @@ public:
private:
std::unordered_set<std::string> kws_;
};
} // namespace kte
} // namespace kte

View File

@@ -129,4 +129,4 @@ MarkdownHighlighter::HighlightLineStateful(const Buffer &buf, int row, const Lin
}
return state;
}
} // namespace kte
} // namespace kte

View File

@@ -11,4 +11,4 @@ public:
LineState HighlightLineStateful(const Buffer &buf, int row, const LineState &prev,
std::vector<HighlightSpan> &out) const override;
};
} // namespace kte
} // namespace kte

View File

@@ -14,4 +14,4 @@ NullHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highlight
return;
out.push_back({0, n, TokenKind::Default});
}
} // namespace kte
} // namespace kte

View File

@@ -8,4 +8,4 @@ class NullHighlighter final : public LanguageHighlighter {
public:
void HighlightLine(const Buffer &buf, int row, std::vector<HighlightSpan> &out) const override;
};
} // namespace kte
} // namespace kte

View File

@@ -169,4 +169,4 @@ PythonHighlighter::HighlightLineStateful(const Buffer &buf, int row, const LineS
}
return state;
}
} // namespace kte
} // namespace kte

View File

@@ -17,4 +17,4 @@ public:
private:
std::unordered_set<std::string> kws_;
};
} // namespace kte
} // namespace kte

View File

@@ -72,7 +72,7 @@ RustHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highlight
bool closed = false;
while (j + 1 <= n) {
if (j + 1 < n && s[j] == '*' && s[j + 1] == '/') {
j += 2;
j += 2;
closed = true;
break;
}
@@ -142,4 +142,4 @@ RustHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highlight
++i;
}
}
} // namespace kte
} // namespace kte

View File

@@ -15,4 +15,4 @@ private:
std::unordered_set<std::string> kws_;
std::unordered_set<std::string> types_;
};
} // namespace kte
} // namespace kte

View File

@@ -102,4 +102,4 @@ ShellHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highligh
++i;
}
}
} // namespace kte
} // namespace kte

View File

@@ -8,4 +8,4 @@ class ShellHighlighter final : public LanguageHighlighter {
public:
void HighlightLine(const Buffer &buf, int row, std::vector<HighlightSpan> &out) const override;
};
} // namespace kte
} // namespace kte

View File

@@ -75,7 +75,7 @@ SqlHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<HighlightS
bool closed = false;
while (j + 1 <= n) {
if (j + 1 < n && s[j] == '*' && s[j + 1] == '/') {
j += 2;
j += 2;
closed = true;
break;
}
@@ -153,4 +153,4 @@ SqlHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<HighlightS
++i;
}
}
} // namespace kte
} // namespace kte

View File

@@ -15,4 +15,4 @@ private:
std::unordered_set<std::string> kws_;
std::unordered_set<std::string> types_;
};
} // namespace kte
} // namespace kte

View File

@@ -44,8 +44,8 @@ CreateTreeSitterHighlighter(const char *filetype,
const void * (*get_lang)())
{
const auto *lang = reinterpret_cast<const TSLanguage *>(get_lang ? get_lang() : nullptr);
return std::make_unique < TreeSitterHighlighter > (lang, filetype ? std::string(filetype) : std::string());
return std::make_unique<TreeSitterHighlighter>(lang, filetype ? std::string(filetype) : std::string());
}
} // namespace kte
#endif // KTE_ENABLE_TREESITTER
#endif // KTE_ENABLE_TREESITTER

View File

@@ -45,4 +45,4 @@ std::unique_ptr<LanguageHighlighter> CreateTreeSitterHighlighter(const char *fil
const void * (*get_lang)());
} // namespace kte
#endif // KTE_ENABLE_TREESITTER
#endif // KTE_ENABLE_TREESITTER