Skip to content
This repository was archived by the owner on May 31, 2022. It is now read-only.

Commit ee81b3a

Browse files
author
Allen Webster
committed
boundary backspace/delete with utf8
1 parent 4e59330 commit ee81b3a

File tree

4 files changed

+103
-94
lines changed

4 files changed

+103
-94
lines changed

custom/4coder_base_commands.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,16 @@ CUSTOM_COMMAND_SIG(backspace_alpha_numeric_boundary)
155155
CUSTOM_DOC("Delete characters between the cursor position and the first alphanumeric boundary to the left.")
156156
{
157157
Scratch_Block scratch(app);
158-
current_view_boundary_delete(app, Scan_Backward, push_boundary_list(scratch, boundary_alpha_numeric));
158+
current_view_boundary_delete(app, Scan_Backward,
159+
push_boundary_list(scratch, boundary_alpha_numeric_unicode));
159160
}
160161

161162
CUSTOM_COMMAND_SIG(delete_alpha_numeric_boundary)
162163
CUSTOM_DOC("Delete characters between the cursor position and the first alphanumeric boundary to the right.")
163164
{
164165
Scratch_Block scratch(app);
165-
current_view_boundary_delete(app, Scan_Forward, push_boundary_list(scratch, boundary_alpha_numeric));
166+
current_view_boundary_delete(app, Scan_Forward,
167+
push_boundary_list(scratch, boundary_alpha_numeric_unicode));
166168
}
167169

168170
function void

custom/4coder_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ boundary_alpha_numeric(Application_Links *app, Buffer_ID buffer, Side side, Scan
565565

566566
function i64
567567
boundary_alpha_numeric_unicode(Application_Links *app, Buffer_ID buffer, Side side, Scan_Direction direction, i64 pos){
568-
return(boundary_predicate(app, buffer, side, direction, pos, &character_predicate_alpha_numeric_underscore_utf8));
568+
return(boundary_predicate(app, buffer, side, direction, pos, &character_predicate_alpha_numeric_utf8));
569569
}
570570

571571
function i64

custom/4coder_helper.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ global Character_Predicate character_predicate_utf8_byte = { {
109109
255, 255, 255, 255, 255, 255, 255, 255,
110110
} };
111111

112+
global Character_Predicate character_predicate_alpha_numeric_utf8 = { {
113+
0, 0, 0, 0, 0, 0, 255, 3,
114+
254, 255, 255, 7, 254, 255, 255, 7,
115+
255, 255, 255, 255, 255, 255, 255, 255,
116+
255, 255, 255, 255, 255, 255, 255, 255,
117+
} };
118+
112119
global Character_Predicate character_predicate_alpha_numeric_underscore_utf8 = { {
113120
0, 0, 0, 0, 0, 0, 255, 3,
114121
254, 255, 255, 135, 254, 255, 255, 7,

0 commit comments

Comments
 (0)