summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-03-05 19:41:00 -0500
committerpommicket <pommicket@gmail.com>2025-03-05 20:48:56 -0500
commit4d7533828738401b76bab5be2e22f0d4a69e30b1 (patch)
treeab35eebf13ee0442bfc4252c2d400992e80582d2 /ted.c
parent79422182e2a244127b62dc45ed8928772dedd1b7 (diff)
Fix IDE hover
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/ted.c b/ted.c
index 0765898..7cddd68 100644
--- a/ted.c
+++ b/ted.c
@@ -826,16 +826,8 @@ void ted_press_key(Ted *ted, SDL_Keycode keycode, SDL_Keymod modifier) {
}
bool ted_get_mouse_buffer_pos(Ted *ted, TextBuffer **pbuffer, BufferPos *ppos) {
- arr_foreach_ptr(ted->buffers, TextBufferPtr, pbuf) {
- TextBuffer *buffer = *pbuf;
- BufferPos pos = {0};
- if (buffer_pixels_to_pos(buffer, ted_mouse_pos(ted), &pos)) {
- if (ppos) *ppos = pos;
- if (pbuffer) *pbuffer = buffer;
- return true;
- }
- }
- return false;
+ if (!arr_len(ted->nodes)) return false;
+ return node_pixels_to_buffer_pos(ted->nodes[0], ted_mouse_pos(ted), pbuffer, ppos);
}
void ted_flash_error_cursor(Ted *ted) {