diff options
author | pommicket <pommicket@gmail.com> | 2023-09-11 22:21:18 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-11 22:21:18 -0400 |
commit | 5370505f95b2539ab979e1daddae4a3b843f8d62 (patch) | |
tree | 3d5967f4d709c43047d4c9682dbbc542b2da5006 | |
parent | 9abc5c5602a0611f8d8dca4fd706bab9aa3e4fa4 (diff) |
clear diagnostics if buffer_lsp becomes NULL
-rw-r--r-- | buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3380,7 +3380,7 @@ bool buffer_cursor_move_to_matching_bracket(TextBuffer *buffer) { void buffer_render(TextBuffer *buffer, Rect r) { const Settings *settings = buffer_settings(buffer); - buffer_lsp(buffer); // this will send didOpen/didClose if the buffer's LSP changed + LSP *lsp = buffer_lsp(buffer); // this will send didOpen/didClose if the buffer's LSP changed if (r.size.x < 1 || r.size.y < 1) { // rectangle less than 1 pixel @@ -3421,7 +3421,7 @@ void buffer_render(TextBuffer *buffer, Rect r) { float render_start_y = y1 - (float)(buffer->scroll_y - start_line) * char_height; // where the 1st line is rendered - if (!settings->show_diagnostics) { + if (!settings->show_diagnostics || !lsp) { buffer_diagnostics_clear(buffer); } |