Minor fixes and optimizations

This commit is contained in:
2025-12-26 22:13:11 +00:00
parent 655f0e7d77
commit a38ba1f813
6 changed files with 59 additions and 48 deletions
+4
View File
@@ -611,6 +611,10 @@ void editor_lsp_handle(Editor *editor, json msg) {
json d = diagnostics[i];
VWarn w;
w.line = d["range"]["start"]["line"];
w.start = d["range"]["start"]["character"];
uint32_t end = d["range"]["end"]["character"];
if (d["range"]["end"]["line"] == w.line)
w.end = end;
std::string text = d["message"].get<std::string>();
auto pos = text.find('\n');
w.text = (pos == std::string::npos) ? text : text.substr(0, pos);