summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-05 16:49:17 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-05 16:49:17 -0500
commitedbad154a65f47dc77dbb901801651e28c4f5e55 (patch)
tree544d1e29f7507622a0a58c906fea0ddf500393af /main.c
parente37ef801a6304f602fdff195b2c46098cf7f5994 (diff)
fix :shell with no files open, write cwd to session
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/main.c b/main.c
index de8f3ce..1fe6266 100644
--- a/main.c
+++ b/main.c
@@ -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