Commit graph

62 commits

Author SHA1 Message Date
Jakob Ingvast
1bae864022 Fixed selection extensions with new helper functions 2025-11-27 12:33:01 +01:00
Jakob Ingvast
608df1518a Initial attempt to fix prev and next word movement 2025-11-27 12:33:01 +01:00
5ffd34680e
refactor: make Editor.enable_selection infallible again
As a concept, it should not be possible for enable_selection to fail.
Even for inclusive selections. Having enable_selection possibly return
an error introduces lots of complexity that is not useful.
2025-11-25 12:56:45 +01:00
Igor Támara
7ae983a419 fix: hx use explicit mode on match brackets
to cases where mode renaming could potentially give unexpected
behaviour.

Reverting 891a445ed43590f3a40b4058786a1405d6e2f077.
2025-11-18 15:40:41 +01:00
Igor Támara
fd3401748e refactor: identify mode inside hx on bracket matching 2025-11-18 10:48:07 +01:00
Igor Támara
4b3e71408a feat: [hx] maw and maW support 2025-11-18 10:48:07 +01:00
Igor Támara
878aef9926 feat: [hx] miw and miW support 2025-11-18 10:48:07 +01:00
Igor Támara
f6d1f27337 feat: [hx] mm match brackets support 2025-11-17 18:43:42 +01:00
Igor Támara
b7d1f15eb5 feat: [hx] Alt+s Add cursors with selections for selected lines 2025-11-07 13:51:59 +01:00
76952a7d1b
fix: check clipboard is not empty before pasting in helix mode 2025-11-04 14:09:20 +01:00
Igor Támara
8d2355dcb8 refactor: [hx] move and extend word sharing common code 2025-11-03 22:48:20 +01:00
Igor Támara
a8c056c211 feat: hx extend word to right 2025-11-03 22:48:20 +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
63745f1e6b refactor: use @memcpy to splat replacement string
Also, don't leak replacement string.
2025-10-30 22:40:53 +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
8246f2b0ba feat: [hx] r to replace with a character
If no selection, the character under the cursor is replaced, if
selection, each character is replaced by the typed character.
2025-10-30 22:40:53 +01:00
Igor Támara
131d9db5ce feat: [hx] match clipboard behaviour on delete 2025-10-30 19:14:08 +01:00
Igor Támara
e76c47e1a6 feat: bar status shows extend or select when on helix mode 2025-10-29 20:58:40 +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
151f108b80 feat: [hx] add group function to move cursor beyond eol
In Helix, F, T, t, f bring the cursor to the character being
searched for, if not found, the cursor is not moved at all.
2025-10-29 20:58:40 +01:00
Igor Támara
b07cd859fe refactor: hx removing commented test code and unused constant 2025-10-15 10:12:34 +02:00
Igor Támara
eb05939b81 refactor: use flow clipboard in hx mode
hx users will envy flow clipboard history :P, fortunately it's possible
to use F4 to shift modes
2025-10-15 10:12:34 +02: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
acb0e16621
feat: add helix mode support for clipboard history changes 2025-10-13 19:49:20 +02:00
b7343219c1
fix: memory leaks in operations that call cut_selection or cut_to 2025-10-13 13:24:10 +02:00
fac4eda72c
fix: formatting 2025-10-10 09:46:41 +02:00
c7b46856bb refactor: explicity publish internal helix functions for unittests only
We don't want internal functions in the mode specific extention modules becoming
shared code. To avoid this, mark the functions as private and publish only through
a structure marked clearly as for testing only.

If these functions are useful as shared code they can be moved to the editor module
or else where.
2025-10-10 09:35:44 +02:00
Igor Támara
a6f5ffcdc5 hx: add tests for some Helix mode movements 2025-10-10 09:35:44 +02:00
Igor Támara
a64d7c3afa hx: attempt to add tests in separate file 2025-10-10 09:35:44 +02:00
Igor Támara
90c08c4287 fix: helix copy now delegates properly memory to editor 2025-10-10 07:38:25 +02:00
Igor Támara
f201728457 hx: Fix closing other buffers and improve user messages 2025-10-06 21:16:33 +02:00
Igor Támara
d3e601e774 Show feedback to user when trying to quit with dirty buffers 2025-10-06 21:16:33 +02:00
Igor Támara
552417091d feat: add helix mode close other buffers and reload all
* x and x! have expected behaviour in Helix mode
2025-10-06 21:16:33 +02:00
2992b0f520
Merge branch 'master' into zig-0.15 2025-09-29 18:19:38 +02:00
Igor Támara
d695d69383 feat: closing and saving including multiple in helix mode
Review of devlogs to use internal functions to also:

* select next and prev word
* select to start en of doc
* delete to end of line
* Add Cursor to next line
* Show diagnostics
* Show references
2025-09-28 00:06:48 +02:00
b8d2679cbc
Merge branch 'master' into zig-0.15 2025-09-27 23:29:42 +02:00
Igor Támara
2390590279 feat: add shorcuts for buffers in helix mode
## Added Behaviour for buffers

:n create a new buffer - Uses language selection from flow <3
:bc close current buffer
:bn next buffer
:bp previous buffer
:rl reload current buffer
:qa! abandon without saving any buffer
2025-09-25 22:24:00 +02:00
Igor Támara
9db6bf56c1 feat: add :x alias for :wq in helix mode 2025-09-25 22:24:00 +02:00
bf0d4402ea
refactor: lots more writergate fixes - first successful build 2025-09-25 22:01:29 +02:00
bcf4babd9f
fix: allow helix mode paste_after command to work at the end of the file
closes #288
2025-08-23 19:00:11 +02:00
5286975257
fix: move internal clipboard from buffer local to session wide
closes #287
2025-08-22 22:18:57 +02:00
ivel.santos
17f0faed68 Fix insert_line 2025-04-13 14:18:54 +02:00
ivel.santos
ccaeded0c8 Fix pasting line 2025-04-13 14:18:54 +02:00
ivel.santos
7778512c35 Correcting selection after paste 2025-04-10 06:42:58 +02:00
ivel.santos
e59cd32ed8 copy and paste improvs and inclusive selection correction 2025-04-10 06:42:58 +02:00
ivel.santos
f58babf2e7 Extend_line_below: integer parameter 2025-04-09 07:09:08 +02:00
Levi
3ce4aaf33a
fix: move_next_word_end (#225) 2025-04-08 20:01:37 +02:00
41339b05e4
fix: merge build failure in helix.move_next_word_end and add repeat support 2025-04-08 19:32:00 +02:00