summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-09-28 00:07:58 -0400
committerpommicket <pommicket@gmail.com>2025-09-28 00:07:58 -0400
commitbe834b2cb8007c51092a5a106089548a57ba9fb1 (patch)
treef9574091ed33f15fa521154bf4f3a4ec70cbebfd
parent306ddb06a7bb7e46348a1b7487117eccf5398b09 (diff)
Don't screw up cursor pos on reload
-rw-r--r--buffer.c2
-rw-r--r--main.c10
2 files changed, 12 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 587c681..e56c18e 100644
--- a/buffer.c
+++ b/buffer.c
@@ -3180,6 +3180,7 @@ Status buffer_load_file(TextBuffer *buffer, const char *path) {
file_contents[file_size] = 0;
if (success) {
bool prev_view_only = buffer->view_only;
+ BufferPos prev_cursor_pos = buffer->cursor_pos;
buffer->view_only = false;
buffer_start_edit_chain(buffer);
buffer_delete_all(buffer);
@@ -3188,6 +3189,7 @@ Status buffer_load_file(TextBuffer *buffer, const char *path) {
buffer_end_edit_chain(buffer);
nlines = buffer_line_count(buffer);
buffer->view_only = prev_view_only;
+ buffer_cursor_move_to_pos(buffer, prev_cursor_pos);
}
}
if (success && !reload) {
diff --git a/main.c b/main.c
index b8e8528..1cbbf67 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,15 @@
/*
+TODO:
+- syntax highlighting for Python t-strings
+- fix <foo-bar> html highlighting
+- don't autocomplete when tab is pressed if there is text selected
+- highlight <https://example.org> correctly in Markdown
+- highlight (https://example.org) correctly in Markdown (exactly which characters are allowed in links?)
+ - what did I mean by this
+- LSP "actions"
+
FUTURE FEATURES:
+- wrap-text command
- path-specific extensions
- more tests
- config variables