Bug Fixes and optimizations
This commit is contained in:
@@ -152,13 +152,14 @@ void CompletionBox::render(Coord pos) {
|
||||
cells[r * size.col + c].flags);
|
||||
if (session->items.size() > session->select &&
|
||||
session->items[session->select].documentation &&
|
||||
*session->items[session->select].documentation != "") {
|
||||
*session->items[session->select].documentation != "" &&
|
||||
!session->hover_dirty) {
|
||||
if (session->doc != session->select) {
|
||||
session->doc = session->select;
|
||||
session->hover.clear();
|
||||
session->hover.text = *session->items[session->select].documentation;
|
||||
session->hover.is_markup = true;
|
||||
session->hover.render_first();
|
||||
session->hover_dirty = true;
|
||||
} else {
|
||||
if ((int32_t)position.col - (int32_t)session->hover.size.col > 0) {
|
||||
session->hover.render({position.row + session->hover.size.row,
|
||||
|
||||
@@ -44,10 +44,12 @@ void HoverBox::render_first(bool scroll) {
|
||||
TSQueryCursor *cursor = ts_query_cursor_new();
|
||||
ts_query_cursor_exec(cursor, ts.query, ts_tree_root_node(ts.tree));
|
||||
TSQueryMatch match;
|
||||
auto subject_fn = [&](const TSNode *node, uint32_t *len) -> char * {
|
||||
auto subject_fn = [&](const TSNode *node, uint32_t *len,
|
||||
bool *allocated) -> char * {
|
||||
uint32_t start = ts_node_start_byte(*node);
|
||||
uint32_t end = ts_node_end_byte(*node);
|
||||
*len = end - start;
|
||||
*allocated = false;
|
||||
return text.data() + start;
|
||||
};
|
||||
while (ts_query_cursor_next_match(cursor, &match)) {
|
||||
|
||||
Reference in New Issue
Block a user