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.
This commit is contained in:
CJ van den Berg 2025-10-10 09:32:20 +02:00
parent a6f5ffcdc5
commit c7b46856bb
2 changed files with 20 additions and 10 deletions

View file

@ -12,22 +12,22 @@ fn apply_movements(movements: []const u8, root: Buffer.Root, cursor: *Cursor, th
for (movements) |move| {
switch (move) {
'W' => {
try helix.move_cursor_long_word_right(root, cursor, the_metrics);
try helix.test_internal.move_cursor_long_word_right(root, cursor, the_metrics);
},
'B' => {
try helix.move_cursor_long_word_left(root, cursor, the_metrics);
try helix.test_internal.move_cursor_long_word_left(root, cursor, the_metrics);
},
'E' => {
try helix.move_cursor_long_word_right_end(root, cursor, the_metrics);
try helix.test_internal.move_cursor_long_word_right_end(root, cursor, the_metrics);
},
'w' => {
try Editor.move_cursor_word_right_vim(root, cursor, the_metrics);
},
'b' => {
try helix.move_cursor_word_left_helix(root, cursor, the_metrics);
try helix.test_internal.move_cursor_word_left_helix(root, cursor, the_metrics);
},
'e' => {
try helix.move_cursor_word_right_end_helix(root, cursor, the_metrics);
try helix.test_internal.move_cursor_word_right_end_helix(root, cursor, the_metrics);
},
else => {},
}