summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-22 13:50:54 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-22 13:50:54 -0500
commitb1c548187c65471d1e59bc4099337ae49e2f4536 (patch)
treef07c59563ccb94b41267b499759edbad19a34917
parent1631f38d4dba64577c8f064225599273148ad83d (diff)
fix automatic horizontal scrolling
-rw-r--r--buffer.c2
-rw-r--r--main.c3
-rw-r--r--menu.c1
3 files changed, 3 insertions, 3 deletions
diff --git a/buffer.c b/buffer.c
index e00377e..08d40df 100644
--- a/buffer.c
+++ b/buffer.c
@@ -711,7 +711,7 @@ void buffer_text_dimensions(TextBuffer *buffer, u32 *lines, u32 *columns) {
// which line on screen is the longest?
for (u32 l = buffer->first_line_on_screen; l <= buffer->last_line_on_screen && l < buffer->nlines; ++l) {
Line *line = &buffer->lines[l];
- longest_line = max_u32(longest_line, line->len);
+ longest_line = max_u32(longest_line, buffer_index_to_column(buffer, l, line->len));
}
*columns = longest_line;
}
diff --git a/main.c b/main.c
index 4a0f420..aeef6c1 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,5 @@
// @TODO:
-// - fix automatic horizontal scrolling
-
+// - improve word movement
// - goto line
// - :run -- if .html file, open in browser, otherwise figure out a way of sending a command to shell
diff --git a/menu.c b/menu.c
index e9c9488..284b0e9 100644
--- a/menu.c
+++ b/menu.c
@@ -48,6 +48,7 @@ static void menu_close(Ted *ted) {
break;
}
ted->menu = MENU_NONE;
+ ted->selector_open = NULL;
}
static void menu_escape(Ted *ted) {