Closed Lucccyo closed 1 year ago
I'm very sorry about that. I finished the PR description yesterday. This PR was still in progress, but many thanks for the review!
I'm very sorry about that. I finished the PR description yesterday.
No worries at all 🙂
The change looks good, could you also add a test to demonstrate the issue and that the patch fixes it? Possibly by re-using the example in #49:
let () =
let engine = Zed_edit.create () in
let cursor = Zed_edit.new_cursor engine in
let ctxt = Zed_edit.context engine cursor in
Zed_edit.insert ctxt (Zed_rope.of_string (Zed_string.of_utf8 "hello"));
Zed_edit.set_mark ctxt;
Zed_edit.insert ctxt (Zed_rope.of_string (Zed_string.of_utf8 " world"));
Zed_edit.goto_mark ctxt;
Zed_edit.kill_next_word ctxt
Yes, good idea!
Merging without the test, I'll have a look at the test suite in a follow up PR.
In
Zed_edit
, functiondefault_match_word
(which is used by default inZed_edit.create
) returns the next end-of-word position as relative to the current cursor. However, the users ofdefault_match_word
, such askill_next_word
,prev_word
,next_word
, etc., interpret the returned value as an absolute position.Fixes #49.