Commit graph

87 commits

Author SHA1 Message Date
5e292e75b5
fix: store redo metadata along with undo metadata and restore it on redo
This commit refactors undo storage and handling significantly.

The undo/redo chaining in Buffer is much simpler and clearer.

The metadata generated by Editor now contains the pre and post change
states. The pre-state is restored on undo and the post-state is restored
on redo.

closes #348
2025-11-04 15:32:43 +01:00
8d0f333ad8
refactor: simplify Buffer.write_state 2025-11-03 22:14:15 +01:00
30b1329d10
refactor: move auto_save flag from Editor to Buffer 2025-11-03 22:13:54 +01:00
a0fa079a13
fix: remove workaround for Buffer.store_to_file_const bug on non-linux platforms
This bug was fixed in the previous commit.
2025-10-30 18:06:43 +01:00
ab4d1cdfa5
fix: always use std.Io.Writer.writeAll to avoid write underflow 2025-10-30 18:04:37 +01:00
b556c1da61
fix: add workaround for Buffer.store_to_file_const bug on non-linux platforms 2025-10-30 16:54:10 +01:00
78cc4b2d24
fix(wsl): save without copying file mode if statFile fails 2025-10-07 10:25:55 +02:00
2f89dcba8d
fix: improve Buffer writer impl 2025-09-29 22:29:45 +02:00
f90d486eae
fix: update Buffer.store_to_string for zig-0.15 2025-09-26 21:05:16 +02:00
8f1375745d
fix: simplify and update Buffer.get_byte_pos for zig-0.15 2025-09-26 21:04:42 +02:00
2867fc9a8e
fix: update Buffer.get_line function for zig-0.15 2025-09-26 21:03:57 +02:00
0f560ed3bc
fix: Buffer.rebalance on zig-0.15 2025-09-26 15:36:25 +02:00
dfdb82ca20
refactor: move write_range to Buffer 2025-09-26 15:04:17 +02:00
705ff49ae8
fix: remove bogus assert in Buffer drain function 2025-09-26 13:17:04 +02:00
bf0d4402ea
refactor: lots more writergate fixes - first successful build 2025-09-25 22:01:29 +02:00
e6b39c274c
refactor: lots and lots of writergate changes 2025-09-24 22:30:18 +02:00
96e8100373
Merge branch 'master' into zig-0.15 2025-09-24 18:33:33 +02:00
935b178d89
feat: add Buffer.Node.byte_offset_to_line_and_col and testcase 2025-09-17 22:17:00 +02:00
f958aa3039
Merge branch 'master' into zig-0.15 2025-09-13 16:16:51 +02:00
3d90b199ad
fix: do not return zero width codepoints from egc_at
Skip them and return the next non-zero width codepoint. This makes more sense and
prevents endless loops in code that scans by egc width using egc_at, like
Cursor.move_right_until for example.
2025-09-13 15:45:17 +02:00
54a43264bb
Merge branch 'master' into zig-0.15.0 2025-08-08 21:58:15 +02:00
68a5de5aa7
refactor: move lsp_version field to Buffer 2025-08-08 21:02:16 +02:00
dd2601b627
feat: store/restore buffer dirty state 2025-08-08 13:16:17 +02:00
f2a3075d58
fix: correct restore of buffer meta data 2025-08-08 13:11:36 +02:00
991c47f3b3
feat: restore buffer manager state on restart 2025-08-07 18:02:55 +02:00
1babf86ce4
fix: crash in Buffer.set_file_path 2025-08-06 19:46:38 +02:00
6e6d6daed9
Merge branch 'master' into zig-0.15.0 2025-08-05 20:10:49 +02:00
c88e2dd975
fix: don't leak Buffer.file_path 2025-08-05 15:24:18 +02:00
3cace58049
feat: add Buffer.reset_from_string_and_update function 2025-08-05 15:07:08 +02:00
652db7d9b9
refactor: add Buffer.mark_dirty() function 2025-08-05 13:41:48 +02:00
5b099b0b10
Merge branch 'master' into zig-0.15.0 2025-07-21 10:22:42 +02:00
efdad96054
refactor: improve create pattern to avoid leaks 2025-07-19 00:03:30 +02:00
724dc9200d
Merge branch 'master' into zig-0.15.0 2025-07-15 18:41:19 +02:00
b0096bed74
feat: create parent directories if needed when saving new files
closes #84
2025-07-15 18:07:15 +02:00
6fb364d64b
zig: update to zig-0.15.0-dev.703+597dd328e 2025-06-04 22:37:21 +02:00
1258d76986
refactor: convert local ArrayList to ArrayListUnmanaged in editor 2025-05-27 21:43:57 +02:00
9023109b21
refactor: convert Buffer.MetaWriter to an ArrayListUnmanaged 2025-05-27 20:47:13 +02:00
Robert Burnett
fcbb377237 removed mark related code 2025-05-13 18:16:33 +02:00
Robert Burnett
d88b15ce04 began support vim mark system 2025-05-13 18:16:33 +02:00
4aca7063f2
feat: add reload_file command 2025-04-09 19:14:02 +02:00
a959563bc7
Merge branch 'master' into zig-0.14 2025-03-04 21:15:14 +01:00
e285099253
refactor: fix spelling of egc_at function 2025-03-04 18:50:38 +01:00
0cd48c5eaa
Merge branch 'master' into zig-0.14 2025-02-11 13:32:11 +01:00
d305e7844d
feat(buffer): restore eol_mode in undo/redo/reset operations 2025-02-11 11:49:20 +01:00
02ba05c500
feat(buffer): restore previous file type when switching buffers 2025-02-11 11:31:16 +01:00
53045123c6
build: update to zig 0.14.0-dev.3039 2025-02-04 22:59:18 +01:00
09e622f032
refactor(buffer): add Buffer.mark_not_ephemeral function 2025-01-30 14:04:00 +01:00
ecca2d0b4c
feat(buffers): add support for buffer metadata 2025-01-29 20:43:31 +01:00
939537ed84
feat(buffers): add support for ephemeral buffers
Ephemeral buffers are not hidden and kept when closed. Ephemeral buffers
can be turned into regular buffers by saving them with save_as.
2025-01-27 18:59:13 +01:00
304a62dfdc
feat(tasks): mark task buffers as clean when task exits 2025-01-26 21:06:52 +01:00