Commit graph

437 commits

Author SHA1 Message Date
d52139579d
refactor: add focus/unfocus support to EditorWidget 2025-11-06 19:23:14 +01:00
9a961c8dd2
fix: check if tree-sitter Node.getParent() returns a null node in expand_selection
closes #360
2025-11-05 13:55:22 +01:00
0f7a4f25e4
fix: check for formatter executable before trying to start formatter job
closes #359
2025-11-04 21:32:18 +01:00
8be5a14eda
fix: allow indenting of blank lines if there is just one cursor 2025-11-04 15:47:45 +01:00
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
Igor Támara
8d2355dcb8 refactor: [hx] move and extend word sharing common code 2025-11-03 22:48:20 +01:00
0bef3ce2e1
fix: do not indent blank lines 2025-11-03 22:43:25 +01:00
cd1d9f3042
fix: don't clip leading whitespace based on cursor column in smart_insert_line 2025-11-03 22:37:12 +01:00
9026404d6d
fix: save file when toggling auto_save on 2025-11-03 22:18:14 +01:00
99cd7b6dc5
refactor: send auto_save state in more editor events 2025-11-03 22:16:09 +01:00
30b1329d10
refactor: move auto_save flag from Editor to Buffer 2025-11-03 22:13:54 +01:00
2d65864e74
fix: merge selections when collapsing cursors
closes #318
2025-11-03 18:31:51 +01:00
79369bf2ca
fix: also collapse cursors during mouse operations 2025-11-03 18:31:27 +01:00
1c96a45822
feat: add CurSel.merge function 2025-11-03 18:30:45 +01:00
223260887d
feat: add underlining keybinds ctrl+_, ctrl+= and ctrl+plus
ctrl+_ => select char to underline with
ctrl+= => underline with '='
ctrl+plus => underline with '=' preserving spaces

closes #350
2025-11-02 21:32:52 +01:00
7af0c7ff71
fix: improve dupe_cursel_down to correctly handle duplicating at EOF
closes #346
2025-11-02 19:24:04 +01:00
e1e82a57eb
fix: improve dupe_cursel_up to correctly handle duplicating at EOF 2025-11-02 19:23:09 +01:00
1c486ccd93
fix: support no selection special case for cut and copy commands with multiple cursors
closes #355
2025-11-02 18:18:52 +01:00
4d375d2d9b
feat: add support for groups in clipboard history
This introduces the concept of clipboard history groups. A group is created
for each high level clipboard operation. Cut, copy, etc. Single cursor
operations will create a group with just one entry. Multi-cursor operations
on the other hand will create groups with multiple clipboard history entries.
This makes for very powerful clipboard history integration with multi-cursor
support.

This commit also adds the ability to apply integer parmeters to the paste
command to select a clipboard group to paste.

Also, pasting from the system clipboard will detect if the system clipboard is
equivalent to the top most clipboard group, and if so use the group instead.
This allows much better multi-cursor support when using the system copy & paste
commands.
2025-10-31 22:53:50 +01:00
18bc89edf8 refactor: replace cursel_length with Buffer.Node.get_range
get_range is likely much faster because it only walks the buffer tree
once. Besides the performance difference it should give identical results.
2025-10-30 22:40:53 +01:00
Igor Támara
411b26d4aa feat: Add functionals with parameters
* The group of mut cursels has a new member that receives
a parameter
* Added a function to get the number of items(one visible
cell characters) within a cursel.
2025-10-30 22:40:53 +01:00
70a793d942
feat: add select_line command 2025-10-30 14:17:02 +01:00
21d1555aca
feat: add repeat argument to delete_line 2025-10-30 12:58:15 +01:00
fc8642768d
refactor: merge select_line_around_cursor into select_line_at_cursor 2025-10-30 12:46:42 +01:00
4087e0a3f9 fix: preserve cursor column and target in delete_line
This is the expected behaviour (for me at least) and makes delete_line
significantly more useful than plain `cut` with no selection.

closes #342
2025-10-30 11:45:43 +01:00
e42f3ff3a5 refactor: use select_line_at_cursor to simplify cut_internal_vim 2025-10-30 11:45:43 +01:00
772e2e7d29 refactor: use select_line_at_cursor to simplify cut command 2025-10-30 11:45:43 +01:00
c27795bc95 feat: add multi cursor support to delete_line 2025-10-30 11:45:43 +01:00
62873353b8 refactor: use an enum to select select_line_at_cursor mode 2025-10-30 11:45:43 +01:00
jmcaine
04c1ece3a8 feat: delete_line implemented 2025-10-30 11:45:43 +01:00
Igor Támara
f5efe8e94f feat: [hx] Add F, T, t, f select and extension movements 2025-10-29 20:58:40 +01:00
Igor Támara
65665fb28b feat: [hx] in Normal mode select to char right
f j in normal mode selects to the char j in the buffer if it exists,
else the cursor stays in place
2025-10-29 20:58:40 +01:00
Igor Támara
7faea783f3 refactor: hx paste(before, replace, after)
Code simplification and zig idiomatics to improve code readability.
2025-10-15 10:12:34 +02:00
Igor Támara
f288d24e13 hx: feature parity on copy paste (P before, R replace, r after) 2025-10-15 10:12:34 +02:00
ee34131ab2
feat: add clipboard history support for internal clipboard 2025-10-13 19:47:20 +02:00
276f721456
refactor: clarify which allocator is used in to_lower_cursel 2025-10-13 13:24:18 +02:00
b7343219c1
fix: memory leaks in operations that call cut_selection or cut_to 2025-10-13 13:24:10 +02:00
9c3482b899
fix: use create_scratch_buffer instead of open_scratch_buffer in dump_document_tree 2025-10-10 12:55:31 +02:00
42705867f1
fix: set ast dump file type asyncronosly to avoid tree-sitter slowdown 2025-10-10 12:33:30 +02:00
0910900a9f
feat: add dump_document_tree command 2025-10-10 12:06:15 +02:00
Igor Támara
a64d7c3afa hx: attempt to add tests in separate file 2025-10-10 09:35:44 +02:00
3c55ed876b
refactor: allow mocking of root module functions for easier unittesting 2025-10-08 14:18:03 +02:00
8476f613c2
fix: check selection before insert 2025-10-02 22:49:02 +02:00
5362706b26
fix: translate columns to byte offsets when requesting completions 2025-10-02 16:28:23 +02:00
6ae176a8ac
refactor: add selection_pos_to_width and get_replace_selection functions 2025-10-02 16:27:16 +02:00
390fbd51ff
refactor: simplify code by using Selection.from_pos 2025-10-02 16:25:48 +02:00
10bd270d89
feat: add Match.from_pos function 2025-10-02 16:23:21 +02:00
8aee0f3a4f
refactor: use Selection.is_reversed 2025-09-29 22:30:36 +02:00
32c70f0e47
fix: minor leak in editor format command 2025-09-29 22:30:18 +02:00
d6843c4fb9
Merge branch 'master' into zig-0.15 2025-09-29 21:04:55 +02:00