summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-22 12:36:50 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-22 12:36:50 -0500
commit1631f38d4dba64577c8f064225599273148ad83d (patch)
tree740747615e12e0d45681875cdb2e2d4f9f681e77 /main.c
parent37ce64c167e12c0d652442b2ff3deb9327d1317d (diff)
go to definition menu
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/main.c b/main.c
index 0de7610..4a0f420 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,4 @@
// @TODO:
-// - Ctrl+D = :find-definition --- tag menu (see all tags, select one)
// - fix automatic horizontal scrolling
// - goto line
@@ -65,10 +64,10 @@ no_warn_end
bool tag_goto(Ted *ted, char const *tag);
#include "buffer.c"
#include "ted.c"
-#include "tags.c"
#include "ui.c"
#include "find.c"
#include "node.c"
+#include "tags.c"
#include "menu.c"
#include "build.c"
#include "command.c"
@@ -588,6 +587,10 @@ int main(int argc, char **argv) {
buffer_scroll(active_buffer, +scroll_amount_x, 0);
}
+ if (ted->menu) {
+ menu_update(ted);
+ }
+
ted_update_window_dimensions(ted);
float window_width = ted->window_width, window_height = ted->window_height;
@@ -607,6 +610,7 @@ int main(int argc, char **argv) {
// default window title
strcpy(ted->window_title, "ted");
+
if (ted->active_node) {
float const padding = settings->padding;
float x1 = padding, y = window_height-padding, x2 = window_width-padding;
@@ -632,12 +636,10 @@ int main(int argc, char **argv) {
text_render(font);
}
- Menu menu = ted->menu;
- if (menu) {
- menu_frame(ted, menu);
+ if (ted->menu) {
+ menu_render(ted);
}
-
if (text_has_err()) {
ted_seterr(ted, "Couldn't render text: %s", text_get_err());
}
@@ -742,6 +744,7 @@ int main(int argc, char **argv) {
SDL_DestroyWindow(window);
SDL_Quit();
find_close(ted);
+ tag_selector_close(ted);
for (u16 i = 0; i < TED_MAX_BUFFERS; ++i)
if (ted->buffers_used[i])
buffer_free(&ted->buffers[i]);