diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-05 16:49:17 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-05 16:49:17 -0500 |
commit | edbad154a65f47dc77dbb901801651e28c4f5e55 (patch) | |
tree | 544d1e29f7507622a0a58c906fea0ddf500393af /main.c | |
parent | e37ef801a6304f602fdff195b2c46098cf7f5994 (diff) |
fix :shell with no files open, write cwd to session
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -779,7 +779,7 @@ int main(int argc, char **argv) { strcpy(ted->window_title, "ted"); - if (ted->nodes_used[0]) { + { float const padding = settings->padding; float x1 = padding, y = window_height-padding, x2 = window_width-padding; Node *node = &ted->nodes[0]; @@ -796,15 +796,18 @@ int main(int argc, char **argv) { y -= padding; } - float y1 = padding; - node_frame(ted, node, rect4(x1, y1, x2, y)); - if (ted->autocomplete) { - autocomplete_frame(ted); + if (ted->nodes_used[0]) { + float y1 = padding; + node_frame(ted, node, rect4(x1, y1, x2, y)); + if (ted->autocomplete) { + autocomplete_frame(ted); + } + } else { + ted->autocomplete = false; + text_utf8_anchored(font, "Press Ctrl+O to open a file or Ctrl+N to create a new one.", + window_width * 0.5f, window_height * 0.5f, colors[COLOR_TEXT_SECONDARY], ANCHOR_MIDDLE); + text_render(font); } - } else { - text_utf8_anchored(font, "Press Ctrl+O to open a file or Ctrl+N to create a new one.", - window_width * 0.5f, window_height * 0.5f, colors[COLOR_TEXT_SECONDARY], ANCHOR_MIDDLE); - text_render(font); } // stop dragging tab if mouse was released |