Deeply reorganizing code from seek.cpp; more 'enclose' operations
parent
24e025cf29
commit
0516c94afc
|
@ -270,14 +270,6 @@ the last sync point .) */
|
|||
DirtyState_UnsavedChangesAndUnloadedChanges = 3,
|
||||
};
|
||||
|
||||
/* DOC(A Seek_Boundary_Flag field specifies a set of "boundary" types used in seeks for the beginning or end of different types of words.) */
|
||||
ENUM(u32, Seek_Boundary_Flag){
|
||||
BoundaryWhitespace = 0x1,
|
||||
BoundaryToken = 0x2,
|
||||
BoundaryAlphanumeric = 0x4,
|
||||
BoundaryCamelCase = 0x8
|
||||
};
|
||||
|
||||
/* DOC(A Command_Line_Interface_Flag field specifies the behavior of a call to a command line interface.) */
|
||||
ENUM(u32, Command_Line_Interface_Flag){
|
||||
/* DOC(If CLI_OverlapWithConflict is set if output buffer of the new command is already in use by another command which is still executing, the older command relinquishes control of the buffer and both operate simultaneously with only the newer command outputting to the buffer.) */
|
||||
|
|
|
@ -198,52 +198,48 @@ buffer_seek_whitespace_down(Application_Links *app, Buffer_Summary *buffer, i32
|
|||
|
||||
static i32
|
||||
buffer_seek_whitespace_right(Application_Links *app, Buffer_Summary *buffer, i32 pos){
|
||||
return(buffer==0?0:buffer_seek_whitespace_right(app, buffer->buffer_id, pos));
|
||||
return(buffer==0?0:scan_to_word_boundary(app, buffer->buffer_id, pos,
|
||||
Scan_Forward, &character_predicate_non_whitespace));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_whitespace_left(Application_Links *app, Buffer_Summary *buffer, i32 pos){
|
||||
return(buffer==0?0:buffer_seek_whitespace_left(app, buffer->buffer_id, pos));
|
||||
return(buffer==0?0:scan_to_word_boundary(app, buffer->buffer_id, pos,
|
||||
Scan_Backward, &character_predicate_non_whitespace));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_right(Application_Links *app, Buffer_Summary *buffer, i32 pos){
|
||||
return(buffer==0?0:buffer_seek_alphanumeric_right(app, buffer->buffer_id, pos));
|
||||
return(buffer==0?0:scan_to_word_boundary(app, buffer->buffer_id, pos,
|
||||
Scan_Forward, &character_predicate_alpha_numeric));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_left(Application_Links *app, Buffer_Summary *buffer, i32 pos){
|
||||
return(buffer==0?0:buffer_seek_alphanumeric_left(app, buffer->buffer_id, pos));
|
||||
return(buffer==0?0:scan_to_word_boundary(app, buffer->buffer_id, pos,
|
||||
Scan_Backward, &character_predicate_alpha_numeric));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_or_underscore_right(Application_Links *app, Buffer_Summary *buffer, i32 pos){
|
||||
return(buffer==0?0:buffer_seek_alphanumeric_or_underscore_right(app, buffer->buffer_id, pos));
|
||||
return(buffer==0?0:scan_to_word_boundary(app, buffer->buffer_id, pos, Scan_Forward,
|
||||
&character_predicate_alpha_numeric_underscore));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_or_underscore_left(Application_Links *app, Buffer_Summary *buffer, i32 pos){
|
||||
return(buffer==0?0:buffer_seek_alphanumeric_or_underscore_left(app, buffer->buffer_id, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_range_camel_right(Application_Links *app, Buffer_Summary *buffer, i32 pos, i32 an_pos){
|
||||
return(buffer==0?0:buffer_seek_range_camel_right(app, buffer->buffer_id, pos, an_pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_range_camel_left(Application_Links *app, Buffer_Summary *buffer, i32 pos, i32 an_pos){
|
||||
return(buffer==0?0:buffer_seek_range_camel_left(app, buffer->buffer_id, pos, an_pos));
|
||||
return(buffer==0?0:scan_to_word_boundary(app, buffer->buffer_id, pos, Scan_Backward,
|
||||
&character_predicate_alpha_numeric_underscore));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_or_camel_right(Application_Links *app, Buffer_Summary *buffer, i32 pos){
|
||||
return(buffer==0?0:buffer_seek_alphanumeric_or_camel_right(app, buffer->buffer_id, pos));
|
||||
return(buffer==0?0:scan_to_alpha_numeric_camel_forward(app, buffer->buffer_id, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_or_camel_left(Application_Links *app, Buffer_Summary *buffer, i32 pos){
|
||||
return(buffer==0?0:buffer_seek_alphanumeric_or_camel_left(app, buffer->buffer_id, pos));
|
||||
return(buffer==0?0:scan_to_alpha_numeric_camel_backward(app, buffer->buffer_id, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
|
@ -260,11 +256,6 @@ buffer_get_all_tokens(Application_Links *app, Arena *arena, Buffer_Summary *buff
|
|||
return(result);
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_boundary_seek(Application_Links *app, Buffer_Summary *buffer, Arena *arena, i32 start_pos, b32 seek_forward, Seek_Boundary_Flag flags){
|
||||
return(buffer==0?0:buffer_boundary_seek(app, buffer->buffer_id, arena, start_pos, seek_forward, flags));
|
||||
}
|
||||
|
||||
static void
|
||||
buffer_seek_delimiter_forward(Application_Links *app, Buffer_Summary *buffer, i32 pos, char delim, i32 *result){
|
||||
if (buffer != 0){
|
||||
|
@ -324,7 +315,11 @@ read_identifier_at_pos(Application_Links *app, Buffer_Summary *buffer, i32 pos,
|
|||
String result = {};
|
||||
if (buffer != 0){
|
||||
Scratch_Block scratch(app);
|
||||
String_Const_u8 string = read_identifier_at_pos(app, scratch, buffer->buffer_id, pos, range_out);
|
||||
Range range = pos_range_enclose_alpha_numeric_underscore(app, buffer->buffer_id, make_range(pos));
|
||||
String_Const_u8 string = push_buffer_range(app, scratch, buffer->buffer_id, range);
|
||||
if (range_out != 0){
|
||||
*range_out = range;
|
||||
}
|
||||
i32 size = (i32)string.size;
|
||||
size = clamp_top(size, max);
|
||||
block_copy(space, string.str, size);
|
||||
|
@ -335,27 +330,7 @@ read_identifier_at_pos(Application_Links *app, Buffer_Summary *buffer, i32 pos,
|
|||
|
||||
static i32
|
||||
buffer_boundary_seek(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, i32 dir, Seek_Boundary_Flag flags){
|
||||
return(buffer==0?0:buffer_boundary_seek(app, buffer->buffer_id, start_pos, dir, flags));
|
||||
}
|
||||
|
||||
static void
|
||||
view_buffer_boundary_seek_set_pos(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, i32 dir, u32 flags){
|
||||
view_buffer_boundary_seek_set_pos(app, view==0?0:view->view_id, buffer==0?0:buffer->buffer_id, dir, flags);
|
||||
}
|
||||
|
||||
static void
|
||||
view_boundary_seek_set_pos(Application_Links *app, View_Summary *view, i32 dir, u32 flags){
|
||||
view_boundary_seek_set_pos(app, view==0?0:view->view_id, dir, flags);
|
||||
}
|
||||
|
||||
static Range
|
||||
view_buffer_boundary_range(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, i32 dir, u32 flags){
|
||||
return(view_buffer_boundary_range(app, view==0?0:view->view_id, buffer==0?0:buffer->buffer_id, dir, flags));
|
||||
}
|
||||
|
||||
static Range
|
||||
view_buffer_snipe_range(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, i32 dir, u32 flags){
|
||||
return(view_buffer_snipe_range(app, view==0?0:view->view_id, buffer==0?0:buffer->buffer_id, dir, flags));
|
||||
return(buffer==0?0:scan_to_word_boundary(app, buffer->buffer_id, start_pos, dir, flags));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1018,6 +993,11 @@ view_get_line_number(Application_Links *app, View_ID view, i32 pos){
|
|||
return(cursor.line);
|
||||
}
|
||||
|
||||
static void
|
||||
current_view_boundary_seek_set_pos(Application_Links *app, Scan_Direction direction, u32 flags){
|
||||
current_view_move_to_word_boundary(app, direction, flags);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// BOTTOM
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// TOP
|
||||
|
||||
static Hard_Start_Result
|
||||
internal Hard_Start_Result
|
||||
buffer_find_hard_start(Application_Links *app, Buffer_ID buffer, i32 line_start, i32 tab_width){
|
||||
i32 tab_additional_width = tab_width - 1;
|
||||
|
||||
|
@ -49,7 +49,7 @@ buffer_find_hard_start(Application_Links *app, Buffer_ID buffer, i32 line_start,
|
|||
return(result);
|
||||
}
|
||||
|
||||
static Buffer_Batch_Edit
|
||||
internal Buffer_Batch_Edit
|
||||
make_batch_from_indent_marks(Application_Links *app, Arena *arena, Buffer_ID buffer,
|
||||
i32 first_line, i32 one_past_last_line, i32 *indent_marks,
|
||||
Indent_Options opts){
|
||||
|
@ -116,7 +116,7 @@ make_batch_from_indent_marks(Application_Links *app, Arena *arena, Buffer_ID buf
|
|||
return(result);
|
||||
}
|
||||
|
||||
static void
|
||||
internal void
|
||||
set_line_indents(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 first_line, i32 one_past_last_line, i32 *indent_marks, Indent_Options opts){
|
||||
Buffer_Batch_Edit batch = make_batch_from_indent_marks(app, arena, buffer, first_line, one_past_last_line, indent_marks, opts);
|
||||
if (batch.edit_count > 0){
|
||||
|
@ -124,7 +124,7 @@ set_line_indents(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 fir
|
|||
}
|
||||
}
|
||||
|
||||
static Cpp_Token*
|
||||
internal Cpp_Token*
|
||||
seek_matching_token_backwards(Cpp_Token_Array tokens, Cpp_Token *token,
|
||||
Cpp_Token_Type open_type, Cpp_Token_Type close_type){
|
||||
if (token <= tokens.tokens){
|
||||
|
@ -151,7 +151,7 @@ seek_matching_token_backwards(Cpp_Token_Array tokens, Cpp_Token *token,
|
|||
return(token);
|
||||
}
|
||||
|
||||
static Indent_Anchor_Position
|
||||
internal Indent_Anchor_Position
|
||||
find_anchor_token(Application_Links *app, Buffer_ID buffer, Cpp_Token_Array tokens, i32 line_start, i32 tab_width){
|
||||
Indent_Anchor_Position anchor = {};
|
||||
if (tokens.count > 0){
|
||||
|
@ -228,7 +228,7 @@ find_anchor_token(Application_Links *app, Buffer_ID buffer, Cpp_Token_Array toke
|
|||
return(anchor);
|
||||
}
|
||||
|
||||
static i32*
|
||||
internal i32*
|
||||
get_indentation_marks(Application_Links *app, Arena *arena, Buffer_ID buffer,
|
||||
Cpp_Token_Array tokens, i32 first_line, i32 one_past_last_line,
|
||||
b32 exact_align, i32 tab_width){
|
||||
|
@ -496,7 +496,7 @@ get_indentation_marks(Application_Links *app, Arena *arena, Buffer_ID buffer,
|
|||
return(indent_marks);
|
||||
}
|
||||
|
||||
static void
|
||||
internal void
|
||||
get_indent_lines_minimum(Application_Links *app, Buffer_ID buffer, i32 start_pos, i32 end_pos, i32 *line_start_out, i32 *line_end_out){
|
||||
i32 line_start = get_line_number_from_pos(app, buffer, start_pos);
|
||||
i32 line_end = get_line_number_from_pos(app, buffer, end_pos) + 1;
|
||||
|
@ -504,7 +504,7 @@ get_indent_lines_minimum(Application_Links *app, Buffer_ID buffer, i32 start_pos
|
|||
*line_end_out = line_end;
|
||||
}
|
||||
|
||||
static void
|
||||
internal void
|
||||
get_indent_lines_whole_tokens(Application_Links *app, Buffer_ID buffer, Cpp_Token_Array tokens, i32 start_pos, i32 end_pos, i32 *line_start_out, i32 *line_end_out){
|
||||
i32 line_start = get_line_number_from_pos(app, buffer, start_pos);
|
||||
i32 line_end = get_line_number_from_pos(app, buffer, end_pos);
|
||||
|
@ -541,7 +541,7 @@ get_indent_lines_whole_tokens(Application_Links *app, Buffer_ID buffer, Cpp_Toke
|
|||
*line_end_out = line_end;
|
||||
}
|
||||
|
||||
static b32
|
||||
internal b32
|
||||
buffer_auto_indent(Application_Links *app, Arena *scratch, Buffer_ID buffer, i32 start, i32 end, i32 tab_width, Auto_Indent_Flag flags){
|
||||
b32 result = false;
|
||||
if (buffer_exists(app, buffer) && buffer_tokens_are_ready(app, buffer)){
|
||||
|
@ -585,7 +585,7 @@ buffer_auto_indent(Application_Links *app, Arena *scratch, Buffer_ID buffer, i32
|
|||
return(result);
|
||||
}
|
||||
|
||||
static b32
|
||||
internal b32
|
||||
buffer_auto_indent(Application_Links *app, Buffer_ID buffer, i32 start, i32 end, i32 tab_width, Auto_Indent_Flag flags){
|
||||
Arena *scratch = context_get_arena(app);
|
||||
return(buffer_auto_indent(app, scratch, buffer, start, end, tab_width, flags));
|
||||
|
|
|
@ -166,6 +166,61 @@ CUSTOM_DOC("Deletes the text in the range between the cursor and the mark.")
|
|||
buffer_replace_range(app, buffer, range, string_u8_litexpr(""));
|
||||
}
|
||||
|
||||
static void
|
||||
current_view_boundary_delete(Application_Links *app, Scan_Direction direction, Seek_Boundary_Flag flags){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessOpen, &view);
|
||||
Buffer_ID buffer = 0;
|
||||
view_get_buffer(app, view, AccessOpen, &buffer);
|
||||
Range range = {};
|
||||
view_get_cursor_pos(app, view, &range.first);
|
||||
range.one_past_last = scan_to_word_boundary(app, buffer, range.first, direction, flags);
|
||||
range = rectify(range);
|
||||
buffer_replace_range(app, buffer, range, string_u8_litexpr(""));
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(backspace_alpha_numeric_boundary)
|
||||
CUSTOM_DOC("Delete characters between the cursor position and the first alphanumeric boundary to the left.")
|
||||
{
|
||||
current_view_boundary_delete(app, Scan_Backward, BoundaryAlphanumeric);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(delete_alpha_numeric_boundary)
|
||||
CUSTOM_DOC("Delete characters between the cursor position and the first alphanumeric boundary to the right.")
|
||||
{
|
||||
current_view_boundary_delete(app, Scan_Forward, BoundaryAlphanumeric);
|
||||
}
|
||||
|
||||
#define backspace_word backspace_alpha_numeric_boundary
|
||||
#define delete_word delete_alpha_numeric_boundary
|
||||
|
||||
static void
|
||||
current_view_snipe_delete(Application_Links *app, Scan_Direction direction, Seek_Boundary_Flag flags){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessOpen, &view);
|
||||
Buffer_ID buffer = 0;
|
||||
view_get_buffer(app, view, AccessOpen, &buffer);
|
||||
i32 pos = 0;
|
||||
view_get_cursor_pos(app, view, &pos);
|
||||
Range range = get_snipe_range(app, buffer, pos, direction, flags);
|
||||
buffer_replace_range(app, buffer, range, string_u8_litexpr(""));
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(snipe_backward_whitespace_or_token_boundary)
|
||||
CUSTOM_DOC("Delete a single, whole token on or to the left of the cursor and post it to the clipboard.")
|
||||
{
|
||||
current_view_snipe_delete(app, Scan_Backward, BoundaryToken|BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(snipe_forward_whitespace_or_token_boundary)
|
||||
CUSTOM_DOC("Delete a single, whole token on or to the right of the cursor and post it to the clipboard.")
|
||||
{
|
||||
current_view_snipe_delete(app, Scan_Forward, BoundaryToken|BoundaryWhitespace);
|
||||
}
|
||||
|
||||
#define snipe_token_or_word snipe_backward_whitespace_or_token_boundary
|
||||
#define snipe_token_or_word_right snipe_forward_whitespace_or_token_boundary
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
CUSTOM_COMMAND_SIG(center_view)
|
||||
|
@ -415,7 +470,60 @@ CUSTOM_DOC("Scrolls the view down one view height and moves the cursor down one
|
|||
move_vertical(app, page_jump);
|
||||
}
|
||||
|
||||
////////////////
|
||||
internal void
|
||||
seek_blank_line__generic(Application_Links *app, Scan_Direction direction, b32 skip_lead_whitespace){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessProtected, &view);
|
||||
Buffer_ID buffer_id = 0;
|
||||
view_get_buffer(app, view, AccessProtected, &buffer_id);
|
||||
i32 pos = 0;
|
||||
view_get_cursor_pos(app, view, &pos);
|
||||
i32 new_pos = get_pos_of_blank_line_grouped(app, buffer_id, direction, pos);
|
||||
if (skip_lead_whitespace){
|
||||
new_pos = get_pos_past_lead_whitespace(app, buffer_id, new_pos);
|
||||
}
|
||||
view_set_cursor(app, view, seek_pos(new_pos), true);
|
||||
no_mark_snap_to_cursor_if_shift(app, view);
|
||||
}
|
||||
|
||||
internal void
|
||||
seek_blank_line(Application_Links *app, Scan_Direction direction){
|
||||
seek_blank_line__generic(app, direction, false);
|
||||
}
|
||||
|
||||
internal void
|
||||
seek_blank_line_skip_leading_whitespace(Application_Links *app, Scan_Direction direction){
|
||||
seek_blank_line__generic(app, direction, true);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_up_to_blank_line)
|
||||
CUSTOM_DOC("Seeks the cursor up to the next blank line.")
|
||||
{
|
||||
seek_blank_line(app, Scan_Backward);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_down_to_blank_line)
|
||||
CUSTOM_DOC("Seeks the cursor down to the next blank line.")
|
||||
{
|
||||
seek_blank_line(app, Scan_Forward);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_up_to_blank_line_end)
|
||||
CUSTOM_DOC("Seeks the cursor up to the next blank line and places it at the end of the line.")
|
||||
{
|
||||
seek_blank_line_skip_leading_whitespace(app, Scan_Backward);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_down_to_blank_line_end)
|
||||
CUSTOM_DOC("Seeks the cursor down to the next blank line and places it at the end of the line.")
|
||||
{
|
||||
seek_blank_line_skip_leading_whitespace(app, Scan_Forward);
|
||||
}
|
||||
|
||||
#define seek_whitespace_up move_up_to_blank_line
|
||||
#define seek_whitespace_down move_down_to_blank_line
|
||||
#define seek_whitespace_up_end_line move_up_to_blank_line_end
|
||||
#define seek_whitespace_down_end_line move_down_to_blank_line_end
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_left)
|
||||
CUSTOM_DOC("Moves the cursor one character to the left.")
|
||||
|
@ -445,6 +553,92 @@ CUSTOM_DOC("Moves the cursor one character to the right.")
|
|||
no_mark_snap_to_cursor_if_shift(app, view);
|
||||
}
|
||||
|
||||
static void
|
||||
current_view_move_to_word_boundary(Application_Links *app, Scan_Direction direction, u32 flags){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessProtected, &view);
|
||||
Buffer_ID buffer = 0;
|
||||
view_get_buffer(app, view, AccessProtected, &buffer);
|
||||
i32 cursor_pos = 0;
|
||||
view_get_cursor_pos(app, view, &cursor_pos);
|
||||
i32 pos = scan_to_word_boundary(app, buffer, cursor_pos, direction, flags);
|
||||
view_set_cursor(app, view, seek_pos(pos), true);
|
||||
no_mark_snap_to_cursor_if_shift(app, view);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_right_whitespace_boundary)
|
||||
CUSTOM_DOC("Seek right for the next boundary between whitespace and non-whitespace.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Forward, BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_left_whitespace_boundary)
|
||||
CUSTOM_DOC("Seek left for the next boundary between whitespace and non-whitespace.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Backward, BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_right_token_boundary)
|
||||
CUSTOM_DOC("Seek right for the next end of a token.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Forward, BoundaryToken);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_left_token_boundary)
|
||||
CUSTOM_DOC("Seek left for the next beginning of a token.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Backward, BoundaryToken);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_right_whitespace_or_token_boundary)
|
||||
CUSTOM_DOC("Seek right for the next end of a token or boundary between whitespace and non-whitespace.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Forward, BoundaryToken|BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_left_whitespace_or_token_boundary)
|
||||
CUSTOM_DOC("Seek left for the next end of a token or boundary between whitespace and non-whitespace.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Backward, BoundaryToken|BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_right_alpha_numeric_boundary)
|
||||
CUSTOM_DOC("Seek right for boundary between alphanumeric characters and non-alphanumeric characters.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Forward, BoundaryAlphanumeric);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_left_alpha_numeric_boundary)
|
||||
CUSTOM_DOC("Seek left for boundary between alphanumeric characters and non-alphanumeric characters.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Backward, BoundaryAlphanumeric);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_right_alpha_numeric_or_camel_boundary)
|
||||
CUSTOM_DOC("Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Forward, BoundaryAlphanumeric|BoundaryCamelCase);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(move_left_alpha_numeric_or_camel_boundary)
|
||||
CUSTOM_DOC("Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.")
|
||||
{
|
||||
current_view_move_to_word_boundary(app, Scan_Backward, BoundaryAlphanumeric|BoundaryCamelCase);
|
||||
}
|
||||
|
||||
#define seek_whitespace_right move_right_whitespace_boundary
|
||||
#define seek_whitespace_left move_left_whitespace_boundary
|
||||
#define seek_token_right move_right_token_boundary
|
||||
#define seek_token_left move_left_token_boundary
|
||||
#define seek_white_or_token_right move_right_whitespace_or_token_boundary
|
||||
#define seek_white_or_token_left move_left_whitespace_or_token_boundary
|
||||
#define seek_alphanumeric_right move_right_alpha_numeric_boundary
|
||||
#define seek_alphanumeric_left move_left_alpha_numeric_boundary
|
||||
#define seek_alphanumeric_or_camel_right move_right_alpha_numeric_or_camel_boundary
|
||||
#define seek_alphanumeric_or_camel_left move_left_alpha_numeric_or_camel_boundary
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
CUSTOM_COMMAND_SIG(select_all)
|
||||
CUSTOM_DOC("Puts the cursor at the top of the file, and the mark at the bottom of the file.")
|
||||
{
|
||||
|
@ -1025,7 +1219,7 @@ CUSTOM_DOC("Begins an incremental search down through the current buffer for the
|
|||
i32 pos = 0;
|
||||
view_get_cursor_pos(app, view, &pos);
|
||||
Scratch_Block scratch(app);
|
||||
String_Const_u8 query = read_identifier_at_pos(app, scratch, buffer_id, pos, 0);
|
||||
String_Const_u8 query = push_alpha_numeric_underscore_word_at_pos(app, scratch, buffer_id, pos);
|
||||
isearch(app, false, query, true);
|
||||
}
|
||||
|
||||
|
@ -1039,7 +1233,7 @@ CUSTOM_DOC("Begins an incremental search up through the current buffer for the w
|
|||
i32 pos = 0;
|
||||
view_get_cursor_pos(app, view, &pos);
|
||||
Scratch_Block scratch(app);
|
||||
String_Const_u8 query = read_identifier_at_pos(app, scratch, buffer_id, pos, 0);
|
||||
String_Const_u8 query = push_alpha_numeric_underscore_word_at_pos(app, scratch, buffer_id, pos);
|
||||
isearch(app, true, query, true);
|
||||
}
|
||||
|
||||
|
@ -1192,14 +1386,14 @@ CUSTOM_DOC("Queries the user for a string, and incrementally replace every occur
|
|||
{
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessOpen, &view);
|
||||
Buffer_ID buffer_id = 0;
|
||||
view_get_buffer(app, view, AccessOpen, &buffer_id);
|
||||
if (buffer_id != 0){
|
||||
Buffer_ID buffer = 0;
|
||||
view_get_buffer(app, view, AccessOpen, &buffer);
|
||||
if (buffer != 0){
|
||||
i32 pos = 0;
|
||||
view_get_cursor_pos(app, view, &pos);
|
||||
Range range = {};
|
||||
Scratch_Block scratch(app);
|
||||
String_Const_u8 replace = read_identifier_at_pos(app, scratch, buffer_id, pos, &range);
|
||||
Range range = pos_range_enclose_alpha_numeric_underscore(app, buffer, make_range(pos));
|
||||
String_Const_u8 replace = push_buffer_range(app, scratch, buffer, range);
|
||||
if (replace.size != 0){
|
||||
query_replace_parameter(app, replace, range.min, true);
|
||||
}
|
||||
|
|
|
@ -1994,6 +1994,23 @@ union_of(f32_Rect a, f32_Rect b){
|
|||
|
||||
////////////////////////////////
|
||||
|
||||
internal Scan_Direction
|
||||
flip_direction(Scan_Direction direction){
|
||||
switch (direction){
|
||||
case Scan_Forward:
|
||||
{
|
||||
direction = Scan_Backward;
|
||||
}break;
|
||||
case Scan_Backward:
|
||||
{
|
||||
direction = Scan_Forward;
|
||||
}break;
|
||||
}
|
||||
return(direction);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
#if defined(Migrating__Arena)
|
||||
|
||||
static void*
|
||||
|
|
|
@ -1575,7 +1575,7 @@ CUSTOM_COMMAND_SIG(binding_name) \
|
|||
DEFINE_MODAL_KEY(modal_space, set_mark);
|
||||
DEFINE_MODAL_KEY(modal_back_slash, casey_clean_and_save);
|
||||
DEFINE_MODAL_KEY(modal_single_quote, casey_call_keyboard_macro);
|
||||
DEFINE_MODAL_KEY(modal_comma, seek_whitespace_down);
|
||||
DEFINE_MODAL_KEY(modal_comma, move_down_to_blank_line);
|
||||
DEFINE_MODAL_KEY(modal_period, casey_fill_paragraph);
|
||||
DEFINE_MODAL_KEY(modal_forward_slash, change_active_panel);
|
||||
DEFINE_MODAL_KEY(modal_semicolon, seek_white_or_token_right);
|
||||
|
@ -1615,7 +1615,7 @@ DEFINE_MODAL_KEY(modal_4, write_character); // TODO(casey): Available
|
|||
DEFINE_MODAL_KEY(modal_5, toggle_bright_mode); // TODO(casey): Available
|
||||
DEFINE_MODAL_KEY(modal_6, auto_tab_range); // TODO(casey): Available
|
||||
DEFINE_MODAL_KEY(modal_7, write_character); // TODO(casey): Available
|
||||
DEFINE_MODAL_KEY(modal_8, seek_whitespace_up); // TODO(casey): Available
|
||||
DEFINE_MODAL_KEY(modal_8, move_up_to_blank_line); // TODO(casey): Available
|
||||
DEFINE_MODAL_KEY(modal_9, write_character); // TODO(casey): Available
|
||||
DEFINE_MODAL_KEY(modal_0, kill_buffer);
|
||||
DEFINE_MODAL_KEY(modal_minus, write_character); // TODO(casey): Available
|
||||
|
@ -1629,8 +1629,8 @@ DEFINE_BIMODAL_KEY(modal_right, seek_white_or_token_right, move_right);
|
|||
DEFINE_BIMODAL_KEY(modal_delete, casey_delete_token_right, delete_char);
|
||||
DEFINE_BIMODAL_KEY(modal_home, casey_seek_beginning_of_line, casey_seek_beginning_of_line_and_tab);
|
||||
DEFINE_BIMODAL_KEY(modal_end, seek_end_of_line, seek_end_of_line);
|
||||
DEFINE_BIMODAL_KEY(modal_page_up, page_up, seek_whitespace_up);
|
||||
DEFINE_BIMODAL_KEY(modal_page_down, page_down, seek_whitespace_down);
|
||||
DEFINE_BIMODAL_KEY(modal_page_up, page_up, move_up_to_blank_line);
|
||||
DEFINE_BIMODAL_KEY(modal_page_down, page_down, move_down_to_blank_line);
|
||||
DEFINE_BIMODAL_KEY(modal_tab, word_complete, word_complete);
|
||||
|
||||
OPEN_FILE_HOOK_SIG(casey_file_settings)
|
||||
|
|
|
@ -696,9 +696,9 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View
|
|||
|
||||
u32 token_flags = BoundaryToken|BoundaryWhitespace;
|
||||
i32 pos0 = cursor_pos;
|
||||
i32 pos1 = buffer_boundary_seek(app, buffer_id, pos0, DirLeft , token_flags);
|
||||
i32 pos1 = scan_to_word_boundary(app, buffer_id, pos0, Scan_Backward , token_flags);
|
||||
if (pos1 >= 0){
|
||||
i32 pos2 = buffer_boundary_seek(app, buffer_id, pos1, DirRight, token_flags);
|
||||
i32 pos2 = scan_to_word_boundary(app, buffer_id, pos1, Scan_Forward, token_flags);
|
||||
i32 buffer_size = 0;
|
||||
buffer_get_size(app, buffer_id, &buffer_size);
|
||||
if (pos2 <= buffer_size){
|
||||
|
|
|
@ -13,8 +13,10 @@
|
|||
// REMOVE_OLD_STRING -> does not include the old 4coder_string.h library.
|
||||
// NOTE: You can only remove "old string" if you first remove the transition helper.
|
||||
|
||||
#if 0
|
||||
#define REMOVE_TRANSITION_HELPER_31
|
||||
#define REMOVE_OLD_STRING
|
||||
#endif
|
||||
|
||||
#include "4coder_API/4coder_custom.h"
|
||||
|
||||
|
|
|
@ -10,30 +10,12 @@
|
|||
#endif
|
||||
#if defined(CUSTOM_COMMAND_SIG)
|
||||
CUSTOM_COMMAND_SIG(replace_all_occurrences);
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_up);
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_down);
|
||||
CUSTOM_COMMAND_SIG(seek_beginning_of_textual_line);
|
||||
CUSTOM_COMMAND_SIG(seek_end_of_textual_line);
|
||||
CUSTOM_COMMAND_SIG(seek_beginning_of_line);
|
||||
CUSTOM_COMMAND_SIG(seek_end_of_line);
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_up_end_line);
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_down_end_line);
|
||||
CUSTOM_COMMAND_SIG(goto_beginning_of_file);
|
||||
CUSTOM_COMMAND_SIG(goto_end_of_file);
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_right);
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_left);
|
||||
CUSTOM_COMMAND_SIG(seek_token_right);
|
||||
CUSTOM_COMMAND_SIG(seek_token_left);
|
||||
CUSTOM_COMMAND_SIG(seek_white_or_token_right);
|
||||
CUSTOM_COMMAND_SIG(seek_white_or_token_left);
|
||||
CUSTOM_COMMAND_SIG(seek_alphanumeric_right);
|
||||
CUSTOM_COMMAND_SIG(seek_alphanumeric_left);
|
||||
CUSTOM_COMMAND_SIG(seek_alphanumeric_or_camel_right);
|
||||
CUSTOM_COMMAND_SIG(seek_alphanumeric_or_camel_left);
|
||||
CUSTOM_COMMAND_SIG(backspace_word);
|
||||
CUSTOM_COMMAND_SIG(delete_word);
|
||||
CUSTOM_COMMAND_SIG(snipe_token_or_word);
|
||||
CUSTOM_COMMAND_SIG(snipe_token_or_word_right);
|
||||
CUSTOM_COMMAND_SIG(change_active_panel);
|
||||
CUSTOM_COMMAND_SIG(change_active_panel_backwards);
|
||||
CUSTOM_COMMAND_SIG(open_panel_vsplit);
|
||||
|
@ -55,6 +37,10 @@ CUSTOM_COMMAND_SIG(backspace_char);
|
|||
CUSTOM_COMMAND_SIG(set_mark);
|
||||
CUSTOM_COMMAND_SIG(cursor_mark_swap);
|
||||
CUSTOM_COMMAND_SIG(delete_range);
|
||||
CUSTOM_COMMAND_SIG(backspace_alpha_numeric_boundary);
|
||||
CUSTOM_COMMAND_SIG(delete_alpha_numeric_boundary);
|
||||
CUSTOM_COMMAND_SIG(snipe_backward_whitespace_or_token_boundary);
|
||||
CUSTOM_COMMAND_SIG(snipe_forward_whitespace_or_token_boundary);
|
||||
CUSTOM_COMMAND_SIG(center_view);
|
||||
CUSTOM_COMMAND_SIG(left_adjust_view);
|
||||
CUSTOM_COMMAND_SIG(click_set_cursor_and_mark);
|
||||
|
@ -69,8 +55,22 @@ CUSTOM_COMMAND_SIG(move_down_10);
|
|||
CUSTOM_COMMAND_SIG(move_down_textual);
|
||||
CUSTOM_COMMAND_SIG(page_up);
|
||||
CUSTOM_COMMAND_SIG(page_down);
|
||||
CUSTOM_COMMAND_SIG(move_up_to_blank_line);
|
||||
CUSTOM_COMMAND_SIG(move_down_to_blank_line);
|
||||
CUSTOM_COMMAND_SIG(move_up_to_blank_line_end);
|
||||
CUSTOM_COMMAND_SIG(move_down_to_blank_line_end);
|
||||
CUSTOM_COMMAND_SIG(move_left);
|
||||
CUSTOM_COMMAND_SIG(move_right);
|
||||
CUSTOM_COMMAND_SIG(move_right_whitespace_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_left_whitespace_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_right_token_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_left_token_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_right_whitespace_or_token_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_left_whitespace_or_token_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_right_alpha_numeric_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_left_alpha_numeric_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_right_alpha_numeric_or_camel_boundary);
|
||||
CUSTOM_COMMAND_SIG(move_left_alpha_numeric_or_camel_boundary);
|
||||
CUSTOM_COMMAND_SIG(select_all);
|
||||
CUSTOM_COMMAND_SIG(to_uppercase);
|
||||
CUSTOM_COMMAND_SIG(to_lowercase);
|
||||
|
@ -256,30 +256,12 @@ int32_t line_number;
|
|||
};
|
||||
static Command_Metadata fcoder_metacmd_table[234] = {
|
||||
{ PROC_LINKS(replace_all_occurrences, 0), "replace_all_occurrences", 23, "Queries the user for two strings, and replaces all occurrences of the first string with the second string in all open buffers.", 126, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 806 },
|
||||
{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\4coder_seek.cpp", 27, 611 },
|
||||
{ PROC_LINKS(seek_whitespace_down, 0), "seek_whitespace_down", 20, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 27, 617 },
|
||||
{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\4coder_seek.cpp", 27, 623 },
|
||||
{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\4coder_seek.cpp", 27, 629 },
|
||||
{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\4coder_seek.cpp", 27, 635 },
|
||||
{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\4coder_seek.cpp", 27, 641 },
|
||||
{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\4coder_seek.cpp", 27, 647 },
|
||||
{ PROC_LINKS(seek_whitespace_down_end_line, 0), "seek_whitespace_down_end_line", 29, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\4coder_seek.cpp", 27, 653 },
|
||||
{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 27, 659 },
|
||||
{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 27, 668 },
|
||||
{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\4coder_seek.cpp", 27, 683 },
|
||||
{ PROC_LINKS(seek_whitespace_left, 0), "seek_whitespace_left", 20, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\4coder_seek.cpp", 27, 689 },
|
||||
{ PROC_LINKS(seek_token_right, 0), "seek_token_right", 16, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 27, 695 },
|
||||
{ PROC_LINKS(seek_token_left, 0), "seek_token_left", 15, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\4coder_seek.cpp", 27, 701 },
|
||||
{ PROC_LINKS(seek_white_or_token_right, 0), "seek_white_or_token_right", 25, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\4coder_seek.cpp", 27, 707 },
|
||||
{ PROC_LINKS(seek_white_or_token_left, 0), "seek_white_or_token_left", 24, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\4coder_seek.cpp", 27, 713 },
|
||||
{ PROC_LINKS(seek_alphanumeric_right, 0), "seek_alphanumeric_right", 23, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\4coder_seek.cpp", 27, 719 },
|
||||
{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\4coder_seek.cpp", 27, 725 },
|
||||
{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\4coder_seek.cpp", 27, 731 },
|
||||
{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\4coder_seek.cpp", 27, 737 },
|
||||
{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\4coder_seek.cpp", 27, 745 },
|
||||
{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\4coder_seek.cpp", 27, 751 },
|
||||
{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\4coder_seek.cpp", 27, 757 },
|
||||
{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\4coder_seek.cpp", 27, 763 },
|
||||
{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\4coder_seek.cpp", 27, 235 },
|
||||
{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\4coder_seek.cpp", 27, 241 },
|
||||
{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\4coder_seek.cpp", 27, 247 },
|
||||
{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\4coder_seek.cpp", 27, 253 },
|
||||
{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 27, 259 },
|
||||
{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 27, 268 },
|
||||
{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 206 },
|
||||
{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 217 },
|
||||
{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 228 },
|
||||
|
@ -301,76 +283,94 @@ static Command_Metadata fcoder_metacmd_table[234] = {
|
|||
{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 134 },
|
||||
{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 145 },
|
||||
{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 158 },
|
||||
{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 171 },
|
||||
{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 189 },
|
||||
{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 214 },
|
||||
{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 233 },
|
||||
{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 250 },
|
||||
{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 269 },
|
||||
{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 286 },
|
||||
{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 362 },
|
||||
{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 368 },
|
||||
{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 374 },
|
||||
{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 380 },
|
||||
{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 386 },
|
||||
{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 400 },
|
||||
{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 409 },
|
||||
{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 420 },
|
||||
{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 434 },
|
||||
{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 448 },
|
||||
{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 464 },
|
||||
{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 484 },
|
||||
{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 504 },
|
||||
{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 574 },
|
||||
{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 583 },
|
||||
{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 593 },
|
||||
{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 601 },
|
||||
{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 609 },
|
||||
{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 617 },
|
||||
{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 625 },
|
||||
{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 635 },
|
||||
{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 647 },
|
||||
{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 653 },
|
||||
{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 665 },
|
||||
{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 677 },
|
||||
{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 691 },
|
||||
{ PROC_LINKS(mouse_wheel_change_face_size, 0), "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 705 },
|
||||
{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 722 },
|
||||
{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 734 },
|
||||
{ PROC_LINKS(toggle_line_numbers, 0), "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 744 },
|
||||
{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 750 },
|
||||
{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 760 },
|
||||
{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 770 },
|
||||
{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 778 },
|
||||
{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1006 },
|
||||
{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1012 },
|
||||
{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1018 },
|
||||
{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1032 },
|
||||
{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1046 },
|
||||
{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1167 },
|
||||
{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1190 },
|
||||
{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1209 },
|
||||
{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1253 },
|
||||
{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1278 },
|
||||
{ PROC_LINKS(save_to_query, 0), "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1318 },
|
||||
{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1356 },
|
||||
{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1399 },
|
||||
{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1422 },
|
||||
{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1487 },
|
||||
{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1509 },
|
||||
{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1527 },
|
||||
{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1619 },
|
||||
{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1657 },
|
||||
{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1672 },
|
||||
{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1687 },
|
||||
{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1732 },
|
||||
{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1742 },
|
||||
{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1756 },
|
||||
{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1820 },
|
||||
{ PROC_LINKS(redo, 0), "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1836 },
|
||||
{ PROC_LINKS(undo_all_buffers, 0), "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1854 },
|
||||
{ PROC_LINKS(redo_all_buffers, 0), "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1933 },
|
||||
{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 2043 },
|
||||
{ PROC_LINKS(backspace_alpha_numeric_boundary, 0), "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 182 },
|
||||
{ PROC_LINKS(delete_alpha_numeric_boundary, 0), "delete_alpha_numeric_boundary", 29, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 188 },
|
||||
{ PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 209 },
|
||||
{ PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 215 },
|
||||
{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 226 },
|
||||
{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 244 },
|
||||
{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 269 },
|
||||
{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 288 },
|
||||
{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 305 },
|
||||
{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 324 },
|
||||
{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 341 },
|
||||
{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 417 },
|
||||
{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 423 },
|
||||
{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 429 },
|
||||
{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 435 },
|
||||
{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 441 },
|
||||
{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 455 },
|
||||
{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 464 },
|
||||
{ PROC_LINKS(move_up_to_blank_line, 0), "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 499 },
|
||||
{ PROC_LINKS(move_down_to_blank_line, 0), "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 505 },
|
||||
{ PROC_LINKS(move_up_to_blank_line_end, 0), "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 511 },
|
||||
{ PROC_LINKS(move_down_to_blank_line_end, 0), "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 517 },
|
||||
{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 528 },
|
||||
{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 542 },
|
||||
{ PROC_LINKS(move_right_whitespace_boundary, 0), "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 569 },
|
||||
{ PROC_LINKS(move_left_whitespace_boundary, 0), "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 575 },
|
||||
{ PROC_LINKS(move_right_token_boundary, 0), "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 581 },
|
||||
{ PROC_LINKS(move_left_token_boundary, 0), "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 587 },
|
||||
{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 593 },
|
||||
{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 599 },
|
||||
{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 605 },
|
||||
{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 611 },
|
||||
{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 617 },
|
||||
{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 623 },
|
||||
{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 642 },
|
||||
{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 658 },
|
||||
{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 678 },
|
||||
{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 698 },
|
||||
{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 768 },
|
||||
{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 777 },
|
||||
{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 787 },
|
||||
{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 795 },
|
||||
{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 803 },
|
||||
{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 811 },
|
||||
{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 819 },
|
||||
{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 829 },
|
||||
{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 841 },
|
||||
{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 847 },
|
||||
{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 859 },
|
||||
{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 871 },
|
||||
{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 885 },
|
||||
{ PROC_LINKS(mouse_wheel_change_face_size, 0), "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 899 },
|
||||
{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 916 },
|
||||
{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 928 },
|
||||
{ PROC_LINKS(toggle_line_numbers, 0), "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 938 },
|
||||
{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 944 },
|
||||
{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 954 },
|
||||
{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 964 },
|
||||
{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 972 },
|
||||
{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1200 },
|
||||
{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1206 },
|
||||
{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1212 },
|
||||
{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1226 },
|
||||
{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1240 },
|
||||
{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1361 },
|
||||
{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1384 },
|
||||
{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1403 },
|
||||
{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1447 },
|
||||
{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1472 },
|
||||
{ PROC_LINKS(save_to_query, 0), "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1512 },
|
||||
{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1550 },
|
||||
{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1593 },
|
||||
{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1616 },
|
||||
{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1681 },
|
||||
{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1703 },
|
||||
{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1721 },
|
||||
{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1813 },
|
||||
{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1851 },
|
||||
{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1866 },
|
||||
{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1881 },
|
||||
{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1926 },
|
||||
{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1936 },
|
||||
{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1950 },
|
||||
{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 2014 },
|
||||
{ PROC_LINKS(redo, 0), "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 2030 },
|
||||
{ PROC_LINKS(undo_all_buffers, 0), "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 2048 },
|
||||
{ PROC_LINKS(redo_all_buffers, 0), "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 2127 },
|
||||
{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 2237 },
|
||||
{ PROC_LINKS(lister__quit, 0), "lister__quit", 12, "A lister mode command that quits the list without executing any actions.", 72, "w:\\4ed\\code\\4coder_lists.cpp", 28, 8 },
|
||||
{ PROC_LINKS(lister__activate, 0), "lister__activate", 16, "A lister mode command that activates the list's action on the highlighted item.", 79, "w:\\4ed\\code\\4coder_lists.cpp", 28, 16 },
|
||||
{ PROC_LINKS(lister__write_character, 0), "lister__write_character", 23, "A lister mode command that dispatches to the lister's write character handler.", 78, "w:\\4ed\\code\\4coder_lists.cpp", 28, 32 },
|
||||
|
@ -491,67 +491,67 @@ static Command_Metadata fcoder_metacmd_table[234] = {
|
|||
{ PROC_LINKS(write_explicit_enum_flags, 0), "write_explicit_enum_flags", 25, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in to give each a unique power of 2 value, starting from 1. Existing values are overwritten.", 194, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 739 },
|
||||
};
|
||||
static int32_t fcoder_metacmd_ID_replace_all_occurrences = 0;
|
||||
static int32_t fcoder_metacmd_ID_seek_whitespace_up = 1;
|
||||
static int32_t fcoder_metacmd_ID_seek_whitespace_down = 2;
|
||||
static int32_t fcoder_metacmd_ID_seek_beginning_of_textual_line = 3;
|
||||
static int32_t fcoder_metacmd_ID_seek_end_of_textual_line = 4;
|
||||
static int32_t fcoder_metacmd_ID_seek_beginning_of_line = 5;
|
||||
static int32_t fcoder_metacmd_ID_seek_end_of_line = 6;
|
||||
static int32_t fcoder_metacmd_ID_seek_whitespace_up_end_line = 7;
|
||||
static int32_t fcoder_metacmd_ID_seek_whitespace_down_end_line = 8;
|
||||
static int32_t fcoder_metacmd_ID_goto_beginning_of_file = 9;
|
||||
static int32_t fcoder_metacmd_ID_goto_end_of_file = 10;
|
||||
static int32_t fcoder_metacmd_ID_seek_whitespace_right = 11;
|
||||
static int32_t fcoder_metacmd_ID_seek_whitespace_left = 12;
|
||||
static int32_t fcoder_metacmd_ID_seek_token_right = 13;
|
||||
static int32_t fcoder_metacmd_ID_seek_token_left = 14;
|
||||
static int32_t fcoder_metacmd_ID_seek_white_or_token_right = 15;
|
||||
static int32_t fcoder_metacmd_ID_seek_white_or_token_left = 16;
|
||||
static int32_t fcoder_metacmd_ID_seek_alphanumeric_right = 17;
|
||||
static int32_t fcoder_metacmd_ID_seek_alphanumeric_left = 18;
|
||||
static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_right = 19;
|
||||
static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_left = 20;
|
||||
static int32_t fcoder_metacmd_ID_backspace_word = 21;
|
||||
static int32_t fcoder_metacmd_ID_delete_word = 22;
|
||||
static int32_t fcoder_metacmd_ID_snipe_token_or_word = 23;
|
||||
static int32_t fcoder_metacmd_ID_snipe_token_or_word_right = 24;
|
||||
static int32_t fcoder_metacmd_ID_change_active_panel = 25;
|
||||
static int32_t fcoder_metacmd_ID_change_active_panel_backwards = 26;
|
||||
static int32_t fcoder_metacmd_ID_open_panel_vsplit = 27;
|
||||
static int32_t fcoder_metacmd_ID_open_panel_hsplit = 28;
|
||||
static int32_t fcoder_metacmd_ID_suppress_mouse = 29;
|
||||
static int32_t fcoder_metacmd_ID_allow_mouse = 30;
|
||||
static int32_t fcoder_metacmd_ID_toggle_mouse = 31;
|
||||
static int32_t fcoder_metacmd_ID_set_mode_to_original = 32;
|
||||
static int32_t fcoder_metacmd_ID_set_mode_to_notepad_like = 33;
|
||||
static int32_t fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 34;
|
||||
static int32_t fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 35;
|
||||
static int32_t fcoder_metacmd_ID_toggle_paren_matching_helper = 36;
|
||||
static int32_t fcoder_metacmd_ID_toggle_fullscreen = 37;
|
||||
static int32_t fcoder_metacmd_ID_remap_interactive = 38;
|
||||
static int32_t fcoder_metacmd_ID_write_character = 39;
|
||||
static int32_t fcoder_metacmd_ID_write_underscore = 40;
|
||||
static int32_t fcoder_metacmd_ID_delete_char = 41;
|
||||
static int32_t fcoder_metacmd_ID_backspace_char = 42;
|
||||
static int32_t fcoder_metacmd_ID_set_mark = 43;
|
||||
static int32_t fcoder_metacmd_ID_cursor_mark_swap = 44;
|
||||
static int32_t fcoder_metacmd_ID_delete_range = 45;
|
||||
static int32_t fcoder_metacmd_ID_center_view = 46;
|
||||
static int32_t fcoder_metacmd_ID_left_adjust_view = 47;
|
||||
static int32_t fcoder_metacmd_ID_click_set_cursor_and_mark = 48;
|
||||
static int32_t fcoder_metacmd_ID_click_set_cursor = 49;
|
||||
static int32_t fcoder_metacmd_ID_click_set_cursor_if_lbutton = 50;
|
||||
static int32_t fcoder_metacmd_ID_click_set_mark = 51;
|
||||
static int32_t fcoder_metacmd_ID_mouse_wheel_scroll = 52;
|
||||
static int32_t fcoder_metacmd_ID_move_up = 53;
|
||||
static int32_t fcoder_metacmd_ID_move_down = 54;
|
||||
static int32_t fcoder_metacmd_ID_move_up_10 = 55;
|
||||
static int32_t fcoder_metacmd_ID_move_down_10 = 56;
|
||||
static int32_t fcoder_metacmd_ID_move_down_textual = 57;
|
||||
static int32_t fcoder_metacmd_ID_page_up = 58;
|
||||
static int32_t fcoder_metacmd_ID_page_down = 59;
|
||||
static int32_t fcoder_metacmd_ID_move_left = 60;
|
||||
static int32_t fcoder_metacmd_ID_move_right = 61;
|
||||
static int32_t fcoder_metacmd_ID_seek_beginning_of_textual_line = 1;
|
||||
static int32_t fcoder_metacmd_ID_seek_end_of_textual_line = 2;
|
||||
static int32_t fcoder_metacmd_ID_seek_beginning_of_line = 3;
|
||||
static int32_t fcoder_metacmd_ID_seek_end_of_line = 4;
|
||||
static int32_t fcoder_metacmd_ID_goto_beginning_of_file = 5;
|
||||
static int32_t fcoder_metacmd_ID_goto_end_of_file = 6;
|
||||
static int32_t fcoder_metacmd_ID_change_active_panel = 7;
|
||||
static int32_t fcoder_metacmd_ID_change_active_panel_backwards = 8;
|
||||
static int32_t fcoder_metacmd_ID_open_panel_vsplit = 9;
|
||||
static int32_t fcoder_metacmd_ID_open_panel_hsplit = 10;
|
||||
static int32_t fcoder_metacmd_ID_suppress_mouse = 11;
|
||||
static int32_t fcoder_metacmd_ID_allow_mouse = 12;
|
||||
static int32_t fcoder_metacmd_ID_toggle_mouse = 13;
|
||||
static int32_t fcoder_metacmd_ID_set_mode_to_original = 14;
|
||||
static int32_t fcoder_metacmd_ID_set_mode_to_notepad_like = 15;
|
||||
static int32_t fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 16;
|
||||
static int32_t fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 17;
|
||||
static int32_t fcoder_metacmd_ID_toggle_paren_matching_helper = 18;
|
||||
static int32_t fcoder_metacmd_ID_toggle_fullscreen = 19;
|
||||
static int32_t fcoder_metacmd_ID_remap_interactive = 20;
|
||||
static int32_t fcoder_metacmd_ID_write_character = 21;
|
||||
static int32_t fcoder_metacmd_ID_write_underscore = 22;
|
||||
static int32_t fcoder_metacmd_ID_delete_char = 23;
|
||||
static int32_t fcoder_metacmd_ID_backspace_char = 24;
|
||||
static int32_t fcoder_metacmd_ID_set_mark = 25;
|
||||
static int32_t fcoder_metacmd_ID_cursor_mark_swap = 26;
|
||||
static int32_t fcoder_metacmd_ID_delete_range = 27;
|
||||
static int32_t fcoder_metacmd_ID_backspace_alpha_numeric_boundary = 28;
|
||||
static int32_t fcoder_metacmd_ID_delete_alpha_numeric_boundary = 29;
|
||||
static int32_t fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 30;
|
||||
static int32_t fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 31;
|
||||
static int32_t fcoder_metacmd_ID_center_view = 32;
|
||||
static int32_t fcoder_metacmd_ID_left_adjust_view = 33;
|
||||
static int32_t fcoder_metacmd_ID_click_set_cursor_and_mark = 34;
|
||||
static int32_t fcoder_metacmd_ID_click_set_cursor = 35;
|
||||
static int32_t fcoder_metacmd_ID_click_set_cursor_if_lbutton = 36;
|
||||
static int32_t fcoder_metacmd_ID_click_set_mark = 37;
|
||||
static int32_t fcoder_metacmd_ID_mouse_wheel_scroll = 38;
|
||||
static int32_t fcoder_metacmd_ID_move_up = 39;
|
||||
static int32_t fcoder_metacmd_ID_move_down = 40;
|
||||
static int32_t fcoder_metacmd_ID_move_up_10 = 41;
|
||||
static int32_t fcoder_metacmd_ID_move_down_10 = 42;
|
||||
static int32_t fcoder_metacmd_ID_move_down_textual = 43;
|
||||
static int32_t fcoder_metacmd_ID_page_up = 44;
|
||||
static int32_t fcoder_metacmd_ID_page_down = 45;
|
||||
static int32_t fcoder_metacmd_ID_move_up_to_blank_line = 46;
|
||||
static int32_t fcoder_metacmd_ID_move_down_to_blank_line = 47;
|
||||
static int32_t fcoder_metacmd_ID_move_up_to_blank_line_end = 48;
|
||||
static int32_t fcoder_metacmd_ID_move_down_to_blank_line_end = 49;
|
||||
static int32_t fcoder_metacmd_ID_move_left = 50;
|
||||
static int32_t fcoder_metacmd_ID_move_right = 51;
|
||||
static int32_t fcoder_metacmd_ID_move_right_whitespace_boundary = 52;
|
||||
static int32_t fcoder_metacmd_ID_move_left_whitespace_boundary = 53;
|
||||
static int32_t fcoder_metacmd_ID_move_right_token_boundary = 54;
|
||||
static int32_t fcoder_metacmd_ID_move_left_token_boundary = 55;
|
||||
static int32_t fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 56;
|
||||
static int32_t fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 57;
|
||||
static int32_t fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 58;
|
||||
static int32_t fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 59;
|
||||
static int32_t fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 60;
|
||||
static int32_t fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 61;
|
||||
static int32_t fcoder_metacmd_ID_select_all = 62;
|
||||
static int32_t fcoder_metacmd_ID_to_uppercase = 63;
|
||||
static int32_t fcoder_metacmd_ID_to_lowercase = 64;
|
||||
|
|
|
@ -75,20 +75,20 @@ bind(context, key_page_up, MDFR_CTRL|MDFR_SHIFT, goto_beginning_of_file);
|
|||
bind(context, key_page_down, MDFR_CTRL|MDFR_SHIFT, goto_end_of_file);
|
||||
bind(context, key_page_up, MDFR_SHIFT, page_up);
|
||||
bind(context, key_page_down, MDFR_SHIFT, page_down);
|
||||
bind(context, key_up, MDFR_CTRL, seek_whitespace_up_end_line);
|
||||
bind(context, key_down, MDFR_CTRL, seek_whitespace_down_end_line);
|
||||
bind(context, key_left, MDFR_CTRL, seek_whitespace_left);
|
||||
bind(context, key_right, MDFR_CTRL, seek_whitespace_right);
|
||||
bind(context, key_up, MDFR_CTRL|MDFR_SHIFT, seek_whitespace_up_end_line);
|
||||
bind(context, key_down, MDFR_CTRL|MDFR_SHIFT, seek_whitespace_down_end_line);
|
||||
bind(context, key_left, MDFR_CTRL|MDFR_SHIFT, seek_whitespace_left);
|
||||
bind(context, key_right, MDFR_CTRL|MDFR_SHIFT, seek_whitespace_right);
|
||||
bind(context, key_up, MDFR_CTRL, move_up_to_blank_line_end);
|
||||
bind(context, key_down, MDFR_CTRL, move_down_to_blank_line_end);
|
||||
bind(context, key_left, MDFR_CTRL, move_left_whitespace_boundary);
|
||||
bind(context, key_right, MDFR_CTRL, move_right_whitespace_boundary);
|
||||
bind(context, key_up, MDFR_CTRL|MDFR_SHIFT, move_up_to_blank_line_end);
|
||||
bind(context, key_down, MDFR_CTRL|MDFR_SHIFT, move_down_to_blank_line_end);
|
||||
bind(context, key_left, MDFR_CTRL|MDFR_SHIFT, move_left_whitespace_boundary);
|
||||
bind(context, key_right, MDFR_CTRL|MDFR_SHIFT, move_right_whitespace_boundary);
|
||||
bind(context, key_up, MDFR_ALT, move_line_up);
|
||||
bind(context, key_down, MDFR_ALT, move_line_down);
|
||||
bind(context, key_back, MDFR_CTRL, backspace_word);
|
||||
bind(context, key_del, MDFR_CTRL, delete_word);
|
||||
bind(context, key_back, MDFR_ALT, snipe_token_or_word);
|
||||
bind(context, key_del, MDFR_ALT, snipe_token_or_word_right);
|
||||
bind(context, key_back, MDFR_CTRL, backspace_alpha_numeric_boundary);
|
||||
bind(context, key_del, MDFR_CTRL, delete_alpha_numeric_boundary);
|
||||
bind(context, key_back, MDFR_ALT, snipe_backward_whitespace_or_token_boundary);
|
||||
bind(context, key_del, MDFR_ALT, snipe_forward_whitespace_or_token_boundary);
|
||||
bind(context, ' ', MDFR_CTRL, set_mark);
|
||||
bind(context, 'a', MDFR_CTRL, replace_in_range);
|
||||
bind(context, 'c', MDFR_CTRL, copy);
|
||||
|
@ -127,10 +127,10 @@ bind(context, ' ', MDFR_SHIFT, write_character);
|
|||
end_map(context);
|
||||
begin_map(context, default_code_map);
|
||||
inherit_map(context, mapid_file);
|
||||
bind(context, key_left, MDFR_CTRL, seek_alphanumeric_or_camel_left);
|
||||
bind(context, key_right, MDFR_CTRL, seek_alphanumeric_or_camel_right);
|
||||
bind(context, key_left, MDFR_ALT, seek_alphanumeric_left);
|
||||
bind(context, key_right, MDFR_ALT, seek_alphanumeric_right);
|
||||
bind(context, key_left, MDFR_CTRL, move_left_alpha_numeric_or_camel_boundary);
|
||||
bind(context, key_right, MDFR_CTRL, move_right_alpha_numeric_or_camel_boundary);
|
||||
bind(context, key_left, MDFR_ALT, move_left_alpha_numeric_boundary);
|
||||
bind(context, key_right, MDFR_ALT, move_right_alpha_numeric_boundary);
|
||||
bind(context, '\n', MDFR_NONE, write_and_auto_tab);
|
||||
bind(context, '\n', MDFR_SHIFT, write_and_auto_tab);
|
||||
bind(context, '}', MDFR_NONE, write_and_auto_tab);
|
||||
|
@ -261,20 +261,20 @@ bind(context, key_page_up, MDFR_CTRL|MDFR_SHIFT, goto_beginning_of_file);
|
|||
bind(context, key_page_down, MDFR_CTRL|MDFR_SHIFT, goto_end_of_file);
|
||||
bind(context, key_page_up, MDFR_SHIFT, page_up);
|
||||
bind(context, key_page_down, MDFR_SHIFT, page_down);
|
||||
bind(context, key_up, MDFR_CMND, seek_whitespace_up_end_line);
|
||||
bind(context, key_down, MDFR_CMND, seek_whitespace_down_end_line);
|
||||
bind(context, key_left, MDFR_CMND, seek_whitespace_left);
|
||||
bind(context, key_right, MDFR_CMND, seek_whitespace_right);
|
||||
bind(context, key_up, MDFR_CMND|MDFR_SHIFT, seek_whitespace_up_end_line);
|
||||
bind(context, key_down, MDFR_CMND|MDFR_SHIFT, seek_whitespace_down_end_line);
|
||||
bind(context, key_left, MDFR_CMND|MDFR_SHIFT, seek_whitespace_left);
|
||||
bind(context, key_right, MDFR_CMND|MDFR_SHIFT, seek_whitespace_right);
|
||||
bind(context, key_up, MDFR_CMND, move_up_to_blank_line_end);
|
||||
bind(context, key_down, MDFR_CMND, move_down_to_blank_line_end);
|
||||
bind(context, key_left, MDFR_CMND, move_left_whitespace_boundary);
|
||||
bind(context, key_right, MDFR_CMND, move_right_whitespace_boundary);
|
||||
bind(context, key_up, MDFR_CMND|MDFR_SHIFT, move_up_to_blank_line_end);
|
||||
bind(context, key_down, MDFR_CMND|MDFR_SHIFT, move_down_to_blank_line_end);
|
||||
bind(context, key_left, MDFR_CMND|MDFR_SHIFT, move_left_whitespace_boundary);
|
||||
bind(context, key_right, MDFR_CMND|MDFR_SHIFT, move_right_whitespace_boundary);
|
||||
bind(context, key_up, MDFR_ALT, move_line_up);
|
||||
bind(context, key_down, MDFR_ALT, move_line_down);
|
||||
bind(context, key_back, MDFR_CMND, backspace_word);
|
||||
bind(context, key_del, MDFR_CMND, delete_word);
|
||||
bind(context, key_back, MDFR_CTRL, snipe_token_or_word);
|
||||
bind(context, key_del, MDFR_CTRL, snipe_token_or_word_right);
|
||||
bind(context, key_back, MDFR_CMND, backspace_alpha_numeric_boundary);
|
||||
bind(context, key_del, MDFR_CMND, delete_alpha_numeric_boundary);
|
||||
bind(context, key_back, MDFR_CTRL, snipe_backward_whitespace_or_token_boundary);
|
||||
bind(context, key_del, MDFR_CTRL, snipe_forward_whitespace_or_token_boundary);
|
||||
bind(context, '/', MDFR_CMND, set_mark);
|
||||
bind(context, 'a', MDFR_CMND, replace_in_range);
|
||||
bind(context, 'c', MDFR_CMND, copy);
|
||||
|
@ -311,10 +311,10 @@ bind(context, ' ', MDFR_SHIFT, write_character);
|
|||
end_map(context);
|
||||
begin_map(context, default_code_map);
|
||||
inherit_map(context, mapid_file);
|
||||
bind(context, key_left, MDFR_CMND, seek_alphanumeric_or_camel_left);
|
||||
bind(context, key_right, MDFR_CMND, seek_alphanumeric_or_camel_right);
|
||||
bind(context, key_left, MDFR_CTRL, seek_alphanumeric_left);
|
||||
bind(context, key_right, MDFR_CTRL, seek_alphanumeric_right);
|
||||
bind(context, key_left, MDFR_CMND, move_left_alpha_numeric_or_camel_boundary);
|
||||
bind(context, key_right, MDFR_CMND, move_right_alpha_numeric_or_camel_boundary);
|
||||
bind(context, key_left, MDFR_CTRL, move_left_alpha_numeric_boundary);
|
||||
bind(context, key_right, MDFR_CTRL, move_right_alpha_numeric_boundary);
|
||||
bind(context, '\n', MDFR_NONE, write_and_auto_tab);
|
||||
bind(context, '\n', MDFR_SHIFT, write_and_auto_tab);
|
||||
bind(context, '}', MDFR_NONE, write_and_auto_tab);
|
||||
|
@ -477,20 +477,20 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_file[78] = {
|
|||
{0, 55306, 9, "goto_end_of_file", 16, LINK_PROCS(goto_end_of_file)},
|
||||
{0, 55305, 8, "page_up", 7, LINK_PROCS(page_up)},
|
||||
{0, 55306, 8, "page_down", 9, LINK_PROCS(page_down)},
|
||||
{0, 55297, 1, "seek_whitespace_up_end_line", 27, LINK_PROCS(seek_whitespace_up_end_line)},
|
||||
{0, 55298, 1, "seek_whitespace_down_end_line", 29, LINK_PROCS(seek_whitespace_down_end_line)},
|
||||
{0, 55299, 1, "seek_whitespace_left", 20, LINK_PROCS(seek_whitespace_left)},
|
||||
{0, 55300, 1, "seek_whitespace_right", 21, LINK_PROCS(seek_whitespace_right)},
|
||||
{0, 55297, 9, "seek_whitespace_up_end_line", 27, LINK_PROCS(seek_whitespace_up_end_line)},
|
||||
{0, 55298, 9, "seek_whitespace_down_end_line", 29, LINK_PROCS(seek_whitespace_down_end_line)},
|
||||
{0, 55299, 9, "seek_whitespace_left", 20, LINK_PROCS(seek_whitespace_left)},
|
||||
{0, 55300, 9, "seek_whitespace_right", 21, LINK_PROCS(seek_whitespace_right)},
|
||||
{0, 55297, 1, "move_up_to_blank_line_end", 25, LINK_PROCS(move_up_to_blank_line_end)},
|
||||
{0, 55298, 1, "move_down_to_blank_line_end", 27, LINK_PROCS(move_down_to_blank_line_end)},
|
||||
{0, 55299, 1, "move_left_whitespace_boundary", 29, LINK_PROCS(move_left_whitespace_boundary)},
|
||||
{0, 55300, 1, "move_right_whitespace_boundary", 30, LINK_PROCS(move_right_whitespace_boundary)},
|
||||
{0, 55297, 9, "move_up_to_blank_line_end", 25, LINK_PROCS(move_up_to_blank_line_end)},
|
||||
{0, 55298, 9, "move_down_to_blank_line_end", 27, LINK_PROCS(move_down_to_blank_line_end)},
|
||||
{0, 55299, 9, "move_left_whitespace_boundary", 29, LINK_PROCS(move_left_whitespace_boundary)},
|
||||
{0, 55300, 9, "move_right_whitespace_boundary", 30, LINK_PROCS(move_right_whitespace_boundary)},
|
||||
{0, 55297, 2, "move_line_up", 12, LINK_PROCS(move_line_up)},
|
||||
{0, 55298, 2, "move_line_down", 14, LINK_PROCS(move_line_down)},
|
||||
{0, 55296, 1, "backspace_word", 14, LINK_PROCS(backspace_word)},
|
||||
{0, 55301, 1, "delete_word", 11, LINK_PROCS(delete_word)},
|
||||
{0, 55296, 2, "snipe_token_or_word", 19, LINK_PROCS(snipe_token_or_word)},
|
||||
{0, 55301, 2, "snipe_token_or_word_right", 25, LINK_PROCS(snipe_token_or_word_right)},
|
||||
{0, 55296, 1, "backspace_alpha_numeric_boundary", 32, LINK_PROCS(backspace_alpha_numeric_boundary)},
|
||||
{0, 55301, 1, "delete_alpha_numeric_boundary", 29, LINK_PROCS(delete_alpha_numeric_boundary)},
|
||||
{0, 55296, 2, "snipe_backward_whitespace_or_token_boundary", 43, LINK_PROCS(snipe_backward_whitespace_or_token_boundary)},
|
||||
{0, 55301, 2, "snipe_forward_whitespace_or_token_boundary", 42, LINK_PROCS(snipe_forward_whitespace_or_token_boundary)},
|
||||
{0, 32, 1, "set_mark", 8, LINK_PROCS(set_mark)},
|
||||
{0, 97, 1, "replace_in_range", 16, LINK_PROCS(replace_in_range)},
|
||||
{0, 99, 1, "copy", 4, LINK_PROCS(copy)},
|
||||
|
@ -528,10 +528,10 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_file[78] = {
|
|||
{0, 32, 8, "write_character", 15, LINK_PROCS(write_character)},
|
||||
};
|
||||
static Meta_Key_Bind fcoder_binds_for_default_default_code_map[33] = {
|
||||
{0, 55299, 1, "seek_alphanumeric_or_camel_left", 31, LINK_PROCS(seek_alphanumeric_or_camel_left)},
|
||||
{0, 55300, 1, "seek_alphanumeric_or_camel_right", 32, LINK_PROCS(seek_alphanumeric_or_camel_right)},
|
||||
{0, 55299, 2, "seek_alphanumeric_left", 22, LINK_PROCS(seek_alphanumeric_left)},
|
||||
{0, 55300, 2, "seek_alphanumeric_right", 23, LINK_PROCS(seek_alphanumeric_right)},
|
||||
{0, 55299, 1, "move_left_alpha_numeric_or_camel_boundary", 41, LINK_PROCS(move_left_alpha_numeric_or_camel_boundary)},
|
||||
{0, 55300, 1, "move_right_alpha_numeric_or_camel_boundary", 42, LINK_PROCS(move_right_alpha_numeric_or_camel_boundary)},
|
||||
{0, 55299, 2, "move_left_alpha_numeric_boundary", 32, LINK_PROCS(move_left_alpha_numeric_boundary)},
|
||||
{0, 55300, 2, "move_right_alpha_numeric_boundary", 33, LINK_PROCS(move_right_alpha_numeric_boundary)},
|
||||
{0, 10, 0, "write_and_auto_tab", 18, LINK_PROCS(write_and_auto_tab)},
|
||||
{0, 10, 8, "write_and_auto_tab", 18, LINK_PROCS(write_and_auto_tab)},
|
||||
{0, 125, 0, "write_and_auto_tab", 18, LINK_PROCS(write_and_auto_tab)},
|
||||
|
@ -666,20 +666,20 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_file[77] = {
|
|||
{0, 55306, 9, "goto_end_of_file", 16, LINK_PROCS(goto_end_of_file)},
|
||||
{0, 55305, 8, "page_up", 7, LINK_PROCS(page_up)},
|
||||
{0, 55306, 8, "page_down", 9, LINK_PROCS(page_down)},
|
||||
{0, 55297, 4, "seek_whitespace_up_end_line", 27, LINK_PROCS(seek_whitespace_up_end_line)},
|
||||
{0, 55298, 4, "seek_whitespace_down_end_line", 29, LINK_PROCS(seek_whitespace_down_end_line)},
|
||||
{0, 55299, 4, "seek_whitespace_left", 20, LINK_PROCS(seek_whitespace_left)},
|
||||
{0, 55300, 4, "seek_whitespace_right", 21, LINK_PROCS(seek_whitespace_right)},
|
||||
{0, 55297, 12, "seek_whitespace_up_end_line", 27, LINK_PROCS(seek_whitespace_up_end_line)},
|
||||
{0, 55298, 12, "seek_whitespace_down_end_line", 29, LINK_PROCS(seek_whitespace_down_end_line)},
|
||||
{0, 55299, 12, "seek_whitespace_left", 20, LINK_PROCS(seek_whitespace_left)},
|
||||
{0, 55300, 12, "seek_whitespace_right", 21, LINK_PROCS(seek_whitespace_right)},
|
||||
{0, 55297, 4, "move_up_to_blank_line_end", 25, LINK_PROCS(move_up_to_blank_line_end)},
|
||||
{0, 55298, 4, "move_down_to_blank_line_end", 27, LINK_PROCS(move_down_to_blank_line_end)},
|
||||
{0, 55299, 4, "move_left_whitespace_boundary", 29, LINK_PROCS(move_left_whitespace_boundary)},
|
||||
{0, 55300, 4, "move_right_whitespace_boundary", 30, LINK_PROCS(move_right_whitespace_boundary)},
|
||||
{0, 55297, 12, "move_up_to_blank_line_end", 25, LINK_PROCS(move_up_to_blank_line_end)},
|
||||
{0, 55298, 12, "move_down_to_blank_line_end", 27, LINK_PROCS(move_down_to_blank_line_end)},
|
||||
{0, 55299, 12, "move_left_whitespace_boundary", 29, LINK_PROCS(move_left_whitespace_boundary)},
|
||||
{0, 55300, 12, "move_right_whitespace_boundary", 30, LINK_PROCS(move_right_whitespace_boundary)},
|
||||
{0, 55297, 2, "move_line_up", 12, LINK_PROCS(move_line_up)},
|
||||
{0, 55298, 2, "move_line_down", 14, LINK_PROCS(move_line_down)},
|
||||
{0, 55296, 4, "backspace_word", 14, LINK_PROCS(backspace_word)},
|
||||
{0, 55301, 4, "delete_word", 11, LINK_PROCS(delete_word)},
|
||||
{0, 55296, 1, "snipe_token_or_word", 19, LINK_PROCS(snipe_token_or_word)},
|
||||
{0, 55301, 1, "snipe_token_or_word_right", 25, LINK_PROCS(snipe_token_or_word_right)},
|
||||
{0, 55296, 4, "backspace_alpha_numeric_boundary", 32, LINK_PROCS(backspace_alpha_numeric_boundary)},
|
||||
{0, 55301, 4, "delete_alpha_numeric_boundary", 29, LINK_PROCS(delete_alpha_numeric_boundary)},
|
||||
{0, 55296, 1, "snipe_backward_whitespace_or_token_boundary", 43, LINK_PROCS(snipe_backward_whitespace_or_token_boundary)},
|
||||
{0, 55301, 1, "snipe_forward_whitespace_or_token_boundary", 42, LINK_PROCS(snipe_forward_whitespace_or_token_boundary)},
|
||||
{0, 47, 4, "set_mark", 8, LINK_PROCS(set_mark)},
|
||||
{0, 97, 4, "replace_in_range", 16, LINK_PROCS(replace_in_range)},
|
||||
{0, 99, 4, "copy", 4, LINK_PROCS(copy)},
|
||||
|
@ -715,10 +715,10 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_file[77] = {
|
|||
{0, 32, 8, "write_character", 15, LINK_PROCS(write_character)},
|
||||
};
|
||||
static Meta_Key_Bind fcoder_binds_for_mac_default_default_code_map[33] = {
|
||||
{0, 55299, 4, "seek_alphanumeric_or_camel_left", 31, LINK_PROCS(seek_alphanumeric_or_camel_left)},
|
||||
{0, 55300, 4, "seek_alphanumeric_or_camel_right", 32, LINK_PROCS(seek_alphanumeric_or_camel_right)},
|
||||
{0, 55299, 1, "seek_alphanumeric_left", 22, LINK_PROCS(seek_alphanumeric_left)},
|
||||
{0, 55300, 1, "seek_alphanumeric_right", 23, LINK_PROCS(seek_alphanumeric_right)},
|
||||
{0, 55299, 4, "move_left_alpha_numeric_or_camel_boundary", 41, LINK_PROCS(move_left_alpha_numeric_or_camel_boundary)},
|
||||
{0, 55300, 4, "move_right_alpha_numeric_or_camel_boundary", 42, LINK_PROCS(move_right_alpha_numeric_or_camel_boundary)},
|
||||
{0, 55299, 1, "move_left_alpha_numeric_boundary", 32, LINK_PROCS(move_left_alpha_numeric_boundary)},
|
||||
{0, 55300, 1, "move_right_alpha_numeric_boundary", 33, LINK_PROCS(move_right_alpha_numeric_boundary)},
|
||||
{0, 10, 0, "write_and_auto_tab", 18, LINK_PROCS(write_and_auto_tab)},
|
||||
{0, 10, 8, "write_and_auto_tab", 18, LINK_PROCS(write_and_auto_tab)},
|
||||
{0, 125, 0, "write_and_auto_tab", 18, LINK_PROCS(write_and_auto_tab)},
|
||||
|
|
|
@ -602,6 +602,209 @@ get_first_token_from_line(Application_Links *app, Buffer_ID buffer, Cpp_Token_Ar
|
|||
|
||||
////////////////////////////////
|
||||
|
||||
static Cpp_Token_Array
|
||||
buffer_get_all_tokens(Application_Links *app, Arena *arena, Buffer_ID buffer_id){
|
||||
Cpp_Token_Array array = {};
|
||||
if (buffer_exists(app, buffer_id)){
|
||||
b32 is_lexed = false;
|
||||
if (buffer_get_setting(app, buffer_id, BufferSetting_Lex, &is_lexed)){
|
||||
if (is_lexed){
|
||||
buffer_token_count(app, buffer_id, &array.count);
|
||||
array.max_count = array.count;
|
||||
array.tokens = push_array(arena, Cpp_Token, array.count);
|
||||
buffer_read_tokens(app, buffer_id, 0, array.count, array.tokens);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(array);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
static i32
|
||||
scan_to_word_boundary(Application_Links *app, Buffer_ID buffer, i32 pos,
|
||||
Scan_Direction direction, Character_Predicate *predicate){
|
||||
i32 result = 0;
|
||||
switch (direction){
|
||||
case Scan_Backward:
|
||||
{
|
||||
result = buffer_seek_character_class_change_0_1(app, buffer, predicate, Scan_Backward, pos);
|
||||
}break;
|
||||
case Scan_Forward:
|
||||
{
|
||||
result = buffer_seek_character_class_change_1_0(app, buffer, predicate, Scan_Forward, pos);
|
||||
}break;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
static i32
|
||||
scan_to_alpha_numeric_camel_forward(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
i32 an_pos = scan_to_word_boundary(app, buffer, pos,
|
||||
Scan_Forward, &character_predicate_alpha_numeric);
|
||||
i32 an_left_pos = scan_to_word_boundary(app, buffer, an_pos,
|
||||
Scan_Backward, &character_predicate_alpha_numeric);
|
||||
i32 cap_pos = 0;
|
||||
buffer_seek_character_class(app, buffer, &character_predicate_uppercase,
|
||||
Scan_Forward, pos, &cap_pos);
|
||||
if (cap_pos == an_left_pos){
|
||||
buffer_seek_character_class(app, buffer, &character_predicate_uppercase,
|
||||
Scan_Forward, cap_pos, &cap_pos);
|
||||
}
|
||||
return(Min(an_pos, cap_pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
scan_to_alpha_numeric_camel_backward(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
i32 an_pos = scan_to_word_boundary(app, buffer, pos,
|
||||
Scan_Backward, &character_predicate_alpha_numeric);
|
||||
i32 cap_pos = 0;
|
||||
buffer_seek_character_class(app, buffer, &character_predicate_uppercase,
|
||||
Scan_Backward, pos, &cap_pos);
|
||||
return(Max(cap_pos, an_pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
scan_to_alpha_numeric_camel(Application_Links *app, Buffer_ID buffer, i32 pos, Scan_Direction direction){
|
||||
i32 result = 0;
|
||||
switch (direction){
|
||||
case Scan_Forward:
|
||||
{
|
||||
result = scan_to_alpha_numeric_camel_forward(app, buffer, pos);
|
||||
}break;
|
||||
case Scan_Backward:
|
||||
{
|
||||
result = scan_to_alpha_numeric_camel_backward(app, buffer, pos);
|
||||
}break;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
static i32
|
||||
scan_to_token_forward(Cpp_Token_Array tokens, i32 pos, i32 buffer_size){
|
||||
if (tokens.count > 0){
|
||||
Cpp_Token *token = get_first_token_from_pos(tokens, pos);
|
||||
if (token != 0){
|
||||
pos = token->start + token->size;
|
||||
}
|
||||
else{
|
||||
pos = buffer_size;
|
||||
}
|
||||
}
|
||||
else{
|
||||
pos = buffer_size;
|
||||
}
|
||||
return(pos);
|
||||
}
|
||||
|
||||
static i32
|
||||
scan_to_token_backward(Cpp_Token_Array tokens, i32 pos){
|
||||
if (tokens.count > 0){
|
||||
Cpp_Token *token = get_first_token_from_pos(tokens, pos);
|
||||
if (token == 0){
|
||||
token = tokens.tokens + tokens.count - 1;
|
||||
pos = token->start;
|
||||
}
|
||||
else{
|
||||
if (token->start < pos){
|
||||
pos = token->start;
|
||||
}
|
||||
else{
|
||||
if (token > tokens.tokens){
|
||||
pos = (token - 1)->start;
|
||||
}
|
||||
else{
|
||||
pos = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
pos = 0;
|
||||
}
|
||||
return(pos);
|
||||
}
|
||||
|
||||
static i32
|
||||
scan_to_token(Cpp_Token_Array tokens, i32 pos, i32 buffer_size, Scan_Direction direction){
|
||||
i32 result = 0;
|
||||
switch (direction){
|
||||
case Scan_Forward:
|
||||
{
|
||||
result = scan_to_token_forward(tokens, pos, buffer_size);
|
||||
}break;
|
||||
case Scan_Backward:
|
||||
{
|
||||
result = scan_to_token_backward(tokens, pos);
|
||||
}break;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
static i32
|
||||
scan_to_word_boundary(Application_Links *app, Buffer_ID buffer, i32 start_pos,
|
||||
Scan_Direction direction, Seek_Boundary_Flag flags){
|
||||
i32 result = 0;
|
||||
|
||||
Scratch_Block scratch(app);
|
||||
if (buffer_exists(app, buffer)){
|
||||
i32 size = 0;
|
||||
buffer_get_size(app, buffer, &size);
|
||||
|
||||
i32 dummy_pos = -1;
|
||||
if (direction == Scan_Forward){
|
||||
dummy_pos = size + 1;
|
||||
}
|
||||
|
||||
i32 pos[4];
|
||||
for (i32 i = 0; i < ArrayCount(pos); ++i){
|
||||
pos[i] = dummy_pos;
|
||||
}
|
||||
start_pos = clamp(0, start_pos, size);
|
||||
|
||||
if (flags & BoundaryWhitespace){
|
||||
pos[0] = scan_to_word_boundary(app, buffer, start_pos, direction,
|
||||
&character_predicate_non_whitespace);
|
||||
}
|
||||
|
||||
if (flags & BoundaryToken){
|
||||
if (buffer_tokens_are_ready(app, buffer)){
|
||||
Cpp_Token_Array array = buffer_get_all_tokens(app, scratch, buffer);
|
||||
pos[1] = scan_to_token(array, start_pos, size, direction);
|
||||
}
|
||||
else{
|
||||
pos[1] = scan_to_word_boundary(app, buffer, start_pos, direction,
|
||||
&character_predicate_non_whitespace);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & BoundaryAlphanumeric){
|
||||
pos[2] = scan_to_word_boundary(app, buffer, start_pos, direction,
|
||||
&character_predicate_alpha_numeric);
|
||||
}
|
||||
|
||||
if (flags & BoundaryCamelCase){
|
||||
pos[3] = scan_to_alpha_numeric_camel(app, buffer, start_pos, direction);
|
||||
}
|
||||
|
||||
result = dummy_pos;
|
||||
if (direction == Scan_Forward){
|
||||
for (i32 i = 0; i < ArrayCount(pos); ++i){
|
||||
result = Min(result, pos[i]);
|
||||
}
|
||||
}
|
||||
else{
|
||||
for (i32 i = 0; i < ArrayCount(pos); ++i){
|
||||
result = Max(result, pos[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
static Range
|
||||
get_line_range_from_pos_range(Application_Links *app, Buffer_ID buffer, Range pos_range){
|
||||
Range line_range = {};
|
||||
|
@ -634,7 +837,7 @@ pos_range_enclose_whole_lines(Application_Links *app, Buffer_ID buffer, Range ra
|
|||
}
|
||||
|
||||
static Range
|
||||
pos_range_enclose_whole_tokens(Application_Links *app, Buffer_ID buffer, Cpp_Token_Array tokens, Range range){
|
||||
pos_range_enclose_whole_tokens(Application_Links *app, Cpp_Token_Array tokens, Range range){
|
||||
if (range_size(range) > 0){
|
||||
if (tokens.count > 0){
|
||||
Cpp_Token *first_token = get_first_token_from_pos(tokens, range.first);
|
||||
|
@ -650,8 +853,57 @@ pos_range_enclose_whole_tokens(Application_Links *app, Buffer_ID buffer, Cpp_Tok
|
|||
return(range);
|
||||
}
|
||||
|
||||
// NOTE(allen): range enclose operators:
|
||||
// enclose whole *** ?
|
||||
static Range
|
||||
pos_range_enclose__within_delimiter_class(Application_Links *app, Buffer_ID buffer, Range range, Character_Predicate *predicate){
|
||||
i32 new_pos = 0;
|
||||
if (buffer_seek_character_class(app, buffer, predicate, Scan_Backward, range.min + 1, &new_pos)){
|
||||
range.first = new_pos + 1;
|
||||
}
|
||||
if (buffer_seek_character_class(app, buffer, predicate, Scan_Forward, range.max - 1, &new_pos)){
|
||||
range.one_past_last = new_pos;
|
||||
}
|
||||
return(range);
|
||||
}
|
||||
|
||||
static Range
|
||||
pos_range_enclose_non_whitespace(Application_Links *app, Buffer_ID buffer, Range range){
|
||||
return(pos_range_enclose__within_delimiter_class(app, buffer, range,
|
||||
&character_predicate_whitespace));
|
||||
}
|
||||
|
||||
static Range
|
||||
pos_range_enclose_alpha_numeric(Application_Links *app, Buffer_ID buffer, Range range){
|
||||
Character_Predicate negative = character_predicate_not(&character_predicate_alpha_numeric);
|
||||
return(pos_range_enclose__within_delimiter_class(app, buffer, range, &negative));
|
||||
}
|
||||
|
||||
static Range
|
||||
pos_range_enclose_alpha_numeric_underscore(Application_Links *app, Buffer_ID buffer, Range range){
|
||||
Character_Predicate negative = character_predicate_not(&character_predicate_alpha_numeric_underscore);
|
||||
return(pos_range_enclose__within_delimiter_class(app, buffer, range, &negative));
|
||||
}
|
||||
|
||||
static Range
|
||||
get_snipe_range(Application_Links *app, Buffer_ID buffer, i32 pos, Scan_Direction direction, Seek_Boundary_Flag flags){
|
||||
Range result = {};
|
||||
i32 buffer_size = 0;
|
||||
buffer_get_size(app, buffer, &buffer_size);
|
||||
i32 pos0 = pos;
|
||||
i32 pos1 = scan_to_word_boundary(app, buffer, pos0, direction, flags);
|
||||
if (0 <= pos1 && pos1 <= buffer_size){
|
||||
i32 pos2 = scan_to_word_boundary(app, buffer, pos1, flip_direction(direction), flags);
|
||||
if (0 <= pos2 && pos2 <= buffer_size){
|
||||
if (direction == Scan_Backward){
|
||||
pos2 = clamp_bot(pos2, pos0);
|
||||
}
|
||||
else{
|
||||
pos2 = clamp_top(pos2, pos0);
|
||||
}
|
||||
result = make_range(pos1, pos2);
|
||||
}
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
|
@ -706,6 +958,30 @@ push_string_in_view_range(Application_Links *app, Arena *arena, View_ID view){
|
|||
return(push_buffer_range(app, arena, buffer, get_view_range(app, view)));
|
||||
}
|
||||
|
||||
static String_Const_u8
|
||||
push_non_whitespace_word_at_pos(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 pos){
|
||||
Range range = pos_range_enclose_non_whitespace(app, buffer, make_range(pos));
|
||||
return(push_buffer_range(app, arena, buffer, range));
|
||||
}
|
||||
|
||||
static String_Const_u8
|
||||
push_alpha_numeric_word_at_pos(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 pos){
|
||||
Range range = pos_range_enclose_alpha_numeric(app, buffer, make_range(pos));
|
||||
return(push_buffer_range(app, arena, buffer, range));
|
||||
}
|
||||
|
||||
static String_Const_u8
|
||||
push_alpha_numeric_underscore_word_at_pos(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 pos){
|
||||
Range range = pos_range_enclose_alpha_numeric_underscore(app, buffer, make_range(pos));
|
||||
return(push_buffer_range(app, arena, buffer, range));
|
||||
}
|
||||
|
||||
static String_Const_u8
|
||||
push_token_at_pos(Application_Links *app, Arena *arena, Buffer_ID buffer, Cpp_Token_Array tokens, i32 pos){
|
||||
Range range = pos_range_enclose_whole_tokens(app, tokens, make_range(pos));
|
||||
return(push_buffer_range(app, arena, buffer, range));
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
static b32
|
||||
|
@ -850,25 +1126,6 @@ get_pos_of_blank_line_grouped(Application_Links *app, Buffer_ID buffer, Scan_Dir
|
|||
|
||||
////////////////////////////////
|
||||
|
||||
static Cpp_Token_Array
|
||||
buffer_get_all_tokens(Application_Links *app, Arena *arena, Buffer_ID buffer_id){
|
||||
Cpp_Token_Array array = {};
|
||||
if (buffer_exists(app, buffer_id)){
|
||||
b32 is_lexed = false;
|
||||
if (buffer_get_setting(app, buffer_id, BufferSetting_Lex, &is_lexed)){
|
||||
if (is_lexed){
|
||||
buffer_token_count(app, buffer_id, &array.count);
|
||||
array.max_count = array.count;
|
||||
array.tokens = push_array(arena, Cpp_Token, array.count);
|
||||
buffer_read_tokens(app, buffer_id, 0, array.count, array.tokens);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(array);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
static i32
|
||||
round_down(i32 x, i32 b){
|
||||
i32 r = 0;
|
||||
|
|
|
@ -91,6 +91,13 @@ global Character_Predicate character_predicate_whitespace = { {
|
|||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
} };
|
||||
|
||||
global Character_Predicate character_predicate_non_whitespace = { {
|
||||
255, 193, 255, 255, 254, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255,
|
||||
} };
|
||||
|
||||
global Character_Predicate character_predicate_utf8_byte = { {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
@ -98,6 +105,15 @@ global Character_Predicate character_predicate_utf8_byte = { {
|
|||
255, 255, 255, 255, 255, 255, 255, 255,
|
||||
} };
|
||||
|
||||
/* DOC(A Seek_Boundary_Flag field specifies a set of "boundary" types used in seeks for the beginning or end of different types of words.) */
|
||||
typedef u32 Seek_Boundary_Flag;
|
||||
enum{
|
||||
BoundaryWhitespace = 0x1,
|
||||
BoundaryToken = 0x2,
|
||||
BoundaryAlphanumeric = 0x4,
|
||||
BoundaryCamelCase = 0x8
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
struct Stream_Chunk{
|
||||
|
|
438
4coder_seek.cpp
438
4coder_seek.cpp
|
@ -4,188 +4,6 @@
|
|||
|
||||
// TOP
|
||||
|
||||
// TODO(allen): replace everything until the END comment -- START --
|
||||
|
||||
static i32
|
||||
buffer_seek_whitespace_right(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
return(buffer_seek_character_class_change_0_1(app, buffer, &character_predicate_whitespace,
|
||||
Scan_Forward, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_whitespace_left(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
return(buffer_seek_character_class_change_1_0(app, buffer, &character_predicate_whitespace,
|
||||
Scan_Backward, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_right(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
return(buffer_seek_character_class_change_1_0(app, buffer, &character_predicate_alpha_numeric,
|
||||
Scan_Forward, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_left(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
return(buffer_seek_character_class_change_0_1(app, buffer, &character_predicate_alpha_numeric,
|
||||
Scan_Backward, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_or_underscore_right(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
return(buffer_seek_character_class_change_1_0(app, buffer,
|
||||
&character_predicate_alpha_numeric_underscore,
|
||||
Scan_Forward, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_or_underscore_left(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
return(buffer_seek_character_class_change_0_1(app, buffer,
|
||||
&character_predicate_alpha_numeric_underscore,
|
||||
Scan_Backward, pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_or_camel_right(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
i32 an_pos = buffer_seek_alphanumeric_right(app, buffer, pos);
|
||||
i32 an_left_pos = buffer_seek_alphanumeric_left(app, buffer, an_pos);
|
||||
i32 cap_pos = 0;
|
||||
buffer_seek_character_class(app, buffer, &character_predicate_uppercase,
|
||||
Scan_Forward, pos, &cap_pos);
|
||||
if (cap_pos == an_left_pos){
|
||||
buffer_seek_character_class(app, buffer, &character_predicate_uppercase,
|
||||
Scan_Forward, cap_pos, &cap_pos);
|
||||
}
|
||||
return(Min(an_pos, cap_pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_seek_alphanumeric_or_camel_left(Application_Links *app, Buffer_ID buffer, i32 pos){
|
||||
i32 an_pos = buffer_seek_alphanumeric_left(app, buffer, pos);
|
||||
i32 cap_pos = 0;
|
||||
buffer_seek_character_class(app, buffer, &character_predicate_uppercase,
|
||||
Scan_Backward, pos, &cap_pos);
|
||||
return(Max(cap_pos, an_pos));
|
||||
}
|
||||
|
||||
static i32
|
||||
seek_token_left(Cpp_Token_Array *tokens, i32 pos){
|
||||
i32 result = -1;
|
||||
i32 token_get_pos = pos - 1;
|
||||
Cpp_Get_Token_Result get = cpp_get_token(*tokens, token_get_pos);
|
||||
if (get.token_index >= 0){
|
||||
result = get.token_start;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
static i32
|
||||
seek_token_right(Cpp_Token_Array *tokens, i32 pos, i32 buffer_end){
|
||||
i32 result = buffer_end + 1;
|
||||
Cpp_Get_Token_Result get = cpp_get_token(*tokens, pos);
|
||||
if (get.in_whitespace_after_token){
|
||||
get.token_index += 1;
|
||||
if (get.token_index < tokens->count){
|
||||
Cpp_Token *token = tokens->tokens + get.token_index;
|
||||
result = token->start + token->size;
|
||||
}
|
||||
}
|
||||
else{
|
||||
result = get.token_one_past_last;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_boundary_seek(Application_Links *app, Buffer_ID buffer_id, Arena *scratch, i32 start_pos, b32 seek_forward, Seek_Boundary_Flag flags){
|
||||
i32 result = 0;
|
||||
|
||||
// TODO(allen): reduce duplication?
|
||||
Temp_Memory temp = begin_temp(scratch);
|
||||
if (buffer_exists(app, buffer_id)){
|
||||
i32 pos[4];
|
||||
i32 size = 0;
|
||||
i32 new_pos = 0;
|
||||
buffer_get_size(app, buffer_id, &size);
|
||||
|
||||
start_pos = clamp(0, start_pos, size);
|
||||
|
||||
if (seek_forward){
|
||||
for (i32 i = 0; i < ArrayCount(pos); ++i){
|
||||
pos[i] = size + 1;
|
||||
}
|
||||
|
||||
if (flags & BoundaryWhitespace){
|
||||
pos[0] = buffer_seek_whitespace_right(app, buffer_id, start_pos);
|
||||
}
|
||||
|
||||
if (flags & BoundaryToken){
|
||||
if (buffer_tokens_are_ready(app, buffer_id)){
|
||||
Cpp_Token_Array array = buffer_get_all_tokens(app, scratch, buffer_id);
|
||||
pos[1] = seek_token_right(&array, start_pos, size);
|
||||
}
|
||||
else{
|
||||
pos[1] = buffer_seek_whitespace_right(app, buffer_id, start_pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & BoundaryAlphanumeric){
|
||||
pos[2] = buffer_seek_alphanumeric_right(app, buffer_id, start_pos);
|
||||
}
|
||||
if (flags & BoundaryCamelCase){
|
||||
pos[3] = buffer_seek_alphanumeric_or_camel_right(app, buffer_id, start_pos);
|
||||
}
|
||||
|
||||
new_pos = size + 1;
|
||||
for (i32 i = 0; i < ArrayCount(pos); ++i){
|
||||
if (new_pos > pos[i]){
|
||||
new_pos = pos[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
for (i32 i = 0; i < ArrayCount(pos); ++i){
|
||||
pos[i] = -1;
|
||||
}
|
||||
|
||||
if (flags & BoundaryWhitespace){
|
||||
pos[0] = buffer_seek_whitespace_left(app, buffer_id, start_pos);
|
||||
}
|
||||
|
||||
if (flags & BoundaryToken){
|
||||
if (buffer_tokens_are_ready(app, buffer_id)){
|
||||
Cpp_Token_Array array = buffer_get_all_tokens(app, scratch, buffer_id);
|
||||
pos[1] = seek_token_left(&array, start_pos);
|
||||
}
|
||||
else{
|
||||
pos[1] = buffer_seek_whitespace_left(app, buffer_id, start_pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & BoundaryAlphanumeric){
|
||||
pos[2] = buffer_seek_alphanumeric_left(app, buffer_id, start_pos);
|
||||
}
|
||||
if (flags & BoundaryCamelCase){
|
||||
pos[3] = buffer_seek_alphanumeric_or_camel_left(app, buffer_id, start_pos);
|
||||
}
|
||||
|
||||
new_pos = -1;
|
||||
for (i32 i = 0; i < ArrayCount(pos); ++i){
|
||||
if (new_pos < pos[i]){
|
||||
new_pos = pos[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
result = new_pos;
|
||||
}
|
||||
end_temp(temp);
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
// TODO(allen): --END--
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
void
|
||||
buffer_seek_delimiter_forward(Application_Links *app, Buffer_ID buffer, i32 pos, char delim, i32 *result){
|
||||
Character_Predicate predicate = character_predicate_from_character((u8)delim);
|
||||
|
@ -387,150 +205,6 @@ buffer_seek_string(Application_Links *app, Buffer_ID buffer_id, i32 pos, i32 end
|
|||
|
||||
////////////////////////////////
|
||||
|
||||
static String_Const_u8
|
||||
read_identifier_at_pos(Application_Links *app, Arena *arena, Buffer_ID buffer_id, i32 pos, Range *range_out){
|
||||
i32 start = buffer_seek_alphanumeric_or_underscore_left(app, buffer_id, pos);
|
||||
i32 end = buffer_seek_alphanumeric_or_underscore_right(app, buffer_id, start);
|
||||
if (!(start <= pos && pos < end)){
|
||||
end = buffer_seek_alphanumeric_or_underscore_right(app, buffer_id, pos);
|
||||
start = buffer_seek_alphanumeric_or_underscore_left(app, buffer_id, end);
|
||||
}
|
||||
|
||||
String_Const_u8 result = {};
|
||||
if (start <= pos && pos < end){
|
||||
if (range_out != 0){
|
||||
*range_out = make_range(start, end);
|
||||
}
|
||||
result = push_buffer_range(app, arena, buffer_id, start, end);
|
||||
}
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
static i32
|
||||
flip_dir(i32 dir){
|
||||
if (dir == DirLeft){
|
||||
dir = DirRight;
|
||||
}
|
||||
else{
|
||||
dir = DirLeft;
|
||||
}
|
||||
return(dir);
|
||||
}
|
||||
|
||||
static i32
|
||||
buffer_boundary_seek(Application_Links *app, Buffer_ID buffer_id, i32 start_pos, i32 dir, Seek_Boundary_Flag flags){
|
||||
b32 forward = (dir != DirLeft);
|
||||
Arena *scratch = context_get_arena(app);
|
||||
return(buffer_boundary_seek(app, buffer_id, scratch, start_pos, forward, flags));
|
||||
}
|
||||
|
||||
static void
|
||||
view_buffer_boundary_seek_set_pos(Application_Links *app, View_ID view, Buffer_ID buffer_id, i32 dir, u32 flags){
|
||||
i32 cursor_pos = 0;
|
||||
view_get_cursor_pos(app, view, &cursor_pos);
|
||||
Arena *scratch = context_get_arena(app);
|
||||
i32 pos = buffer_boundary_seek(app, buffer_id, scratch, cursor_pos, dir, flags);
|
||||
view_set_cursor(app, view, seek_pos(pos), true);
|
||||
no_mark_snap_to_cursor_if_shift(app, view);
|
||||
}
|
||||
|
||||
static void
|
||||
view_boundary_seek_set_pos(Application_Links *app, View_ID view, i32 dir, u32 flags){
|
||||
Buffer_ID buffer_id = 0;
|
||||
view_get_buffer(app, view, AccessProtected, &buffer_id);
|
||||
view_buffer_boundary_seek_set_pos(app, view, buffer_id, dir, flags);
|
||||
}
|
||||
|
||||
static void
|
||||
current_view_boundary_seek_set_pos(Application_Links *app, i32 dir, u32 flags){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessProtected, &view);
|
||||
view_boundary_seek_set_pos(app, view, dir, flags);
|
||||
}
|
||||
|
||||
static Range
|
||||
view_buffer_boundary_range(Application_Links *app, View_ID view, Buffer_ID buffer_id, i32 dir, u32 flags){
|
||||
i32 pos1 = 0;
|
||||
view_get_cursor_pos(app, view, &pos1);
|
||||
i32 pos2 = buffer_boundary_seek(app, buffer_id, pos1, dir, flags);
|
||||
return(make_range(pos1, pos2));
|
||||
}
|
||||
|
||||
static Range
|
||||
view_buffer_snipe_range(Application_Links *app, View_ID view, Buffer_ID buffer_id, i32 dir, u32 flags){
|
||||
i32 buffer_size = 0;
|
||||
buffer_get_size(app, buffer_id, &buffer_size);
|
||||
Range result = {};
|
||||
i32 pos0 = 0;
|
||||
view_get_cursor_pos(app, view, &pos0);
|
||||
i32 pos1 = buffer_boundary_seek(app, buffer_id, pos0, dir, flags);
|
||||
if (0 <= pos1 && pos1 <= buffer_size){
|
||||
i32 pos2 = buffer_boundary_seek(app, buffer_id, pos1, flip_dir(dir), flags);
|
||||
if (0 <= pos2 && pos2 <= buffer_size){
|
||||
if (dir == DirLeft){
|
||||
pos2 = clamp_bot(pos2, pos0);
|
||||
}
|
||||
else{
|
||||
pos2 = clamp_top(pos2, pos0);
|
||||
}
|
||||
result = make_range(pos1, pos2);
|
||||
}
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
static void
|
||||
current_view_boundary_delete(Application_Links *app, i32 dir, u32 flags){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessOpen, &view);
|
||||
Buffer_ID buffer_id = 0;
|
||||
view_get_buffer(app, view, AccessOpen, &buffer_id);
|
||||
Range range = view_buffer_boundary_range(app, view, buffer_id, dir, flags);
|
||||
buffer_replace_range(app, buffer_id, range, string_u8_litexpr(""));
|
||||
}
|
||||
|
||||
static void
|
||||
current_view_snipe_delete(Application_Links *app, i32 dir, u32 flags){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessOpen, &view);
|
||||
Buffer_ID buffer_id = 0;
|
||||
view_get_buffer(app, view, AccessOpen, &buffer_id);
|
||||
Range range = view_buffer_snipe_range(app, view, buffer_id, dir, flags);
|
||||
buffer_replace_range(app, buffer_id, range, string_u8_litexpr(""));
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
internal void
|
||||
seek_blank_line(Application_Links *app, Scan_Direction direction){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessProtected, &view);
|
||||
Buffer_ID buffer = 0;
|
||||
view_get_buffer(app, view, AccessProtected, &buffer);
|
||||
i32 pos = 0;
|
||||
view_get_cursor_pos(app, view, &pos);
|
||||
i32 new_pos = get_pos_of_blank_line_grouped(app, buffer, direction, pos);
|
||||
view_set_cursor(app, view, seek_pos(new_pos), true);
|
||||
no_mark_snap_to_cursor_if_shift(app, view);
|
||||
}
|
||||
|
||||
internal void
|
||||
seek_blank_line_skip_leading_whitespace(Application_Links *app, Scan_Direction direction){
|
||||
View_ID view = 0;
|
||||
get_active_view(app, AccessProtected, &view);
|
||||
Buffer_ID buffer_id = 0;
|
||||
view_get_buffer(app, view, AccessProtected, &buffer_id);
|
||||
i32 pos = 0;
|
||||
view_get_cursor_pos(app, view, &pos);
|
||||
i32 new_pos = get_pos_of_blank_line_grouped(app, buffer_id, direction, pos);
|
||||
new_pos = get_pos_past_lead_whitespace(app, buffer_id, new_pos);
|
||||
view_set_cursor(app, view, seek_pos(new_pos), true);
|
||||
no_mark_snap_to_cursor_if_shift(app, view);
|
||||
}
|
||||
|
||||
internal void
|
||||
seek_pos_of_textual_line(Application_Links *app, Side side){
|
||||
View_ID view = 0;
|
||||
|
@ -558,18 +232,6 @@ seek_pos_of_visual_line(Application_Links *app, Side side){
|
|||
no_mark_snap_to_cursor_if_shift(app, view);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_up)
|
||||
CUSTOM_DOC("Seeks the cursor up to the next blank line.")
|
||||
{
|
||||
seek_blank_line(app, Scan_Backward);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_down)
|
||||
CUSTOM_DOC("Seeks the cursor down to the next blank line.")
|
||||
{
|
||||
seek_blank_line(app, Scan_Forward);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_beginning_of_textual_line)
|
||||
CUSTOM_DOC("Seeks the cursor to the beginning of the line across all text.")
|
||||
{
|
||||
|
@ -594,18 +256,6 @@ CUSTOM_DOC("Seeks the cursor to the end of the visual line.")
|
|||
seek_pos_of_visual_line(app, Side_Max);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_up_end_line)
|
||||
CUSTOM_DOC("Seeks the cursor up to the next blank line and places it at the end of the line.")
|
||||
{
|
||||
seek_blank_line_skip_leading_whitespace(app, Scan_Backward);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_down_end_line)
|
||||
CUSTOM_DOC("Seeks the cursor down to the next blank line and places it at the end of the line.")
|
||||
{
|
||||
seek_blank_line_skip_leading_whitespace(app, Scan_Forward);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(goto_beginning_of_file)
|
||||
CUSTOM_DOC("Sets the cursor to the beginning of the file.")
|
||||
{
|
||||
|
@ -628,93 +278,5 @@ CUSTOM_DOC("Sets the cursor to the end of the file.")
|
|||
no_mark_snap_to_cursor_if_shift(app, view);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_right)
|
||||
CUSTOM_DOC("Seek right for the next boundary between whitespace and non-whitespace.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirRight, BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_whitespace_left)
|
||||
CUSTOM_DOC("Seek left for the next boundary between whitespace and non-whitespace.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirLeft, BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_token_right)
|
||||
CUSTOM_DOC("Seek right for the next end of a token.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirRight, BoundaryToken);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_token_left)
|
||||
CUSTOM_DOC("Seek left for the next beginning of a token.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirLeft, BoundaryToken);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_white_or_token_right)
|
||||
CUSTOM_DOC("Seek right for the next end of a token or boundary between whitespace and non-whitespace.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirRight, BoundaryToken|BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_white_or_token_left)
|
||||
CUSTOM_DOC("Seek left for the next end of a token or boundary between whitespace and non-whitespace.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirLeft, BoundaryToken|BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_alphanumeric_right)
|
||||
CUSTOM_DOC("Seek right for boundary between alphanumeric characters and non-alphanumeric characters.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirRight, BoundaryAlphanumeric);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_alphanumeric_left)
|
||||
CUSTOM_DOC("Seek left for boundary between alphanumeric characters and non-alphanumeric characters.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirLeft, BoundaryAlphanumeric);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_alphanumeric_or_camel_right)
|
||||
CUSTOM_DOC("Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirRight, BoundaryAlphanumeric|BoundaryCamelCase);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(seek_alphanumeric_or_camel_left)
|
||||
CUSTOM_DOC("Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.")
|
||||
{
|
||||
current_view_boundary_seek_set_pos(app, DirLeft, BoundaryAlphanumeric|BoundaryCamelCase);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
CUSTOM_COMMAND_SIG(backspace_word)
|
||||
CUSTOM_DOC("Delete characters between the cursor position and the first alphanumeric boundary to the left.")
|
||||
{
|
||||
current_view_boundary_delete(app, DirLeft, BoundaryAlphanumeric);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(delete_word)
|
||||
CUSTOM_DOC("Delete characters between the cursor position and the first alphanumeric boundary to the right.")
|
||||
{
|
||||
current_view_boundary_delete(app, DirRight, BoundaryAlphanumeric);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(snipe_token_or_word)
|
||||
CUSTOM_DOC("Delete a single, whole token on or to the left of the cursor and post it to the clipboard.")
|
||||
{
|
||||
current_view_snipe_delete(app, DirLeft, BoundaryToken|BoundaryWhitespace);
|
||||
}
|
||||
|
||||
CUSTOM_COMMAND_SIG(snipe_token_or_word_right)
|
||||
CUSTOM_DOC("Delete a single, whole token on or to the right of the cursor and post it to the clipboard.")
|
||||
{
|
||||
current_view_snipe_delete(app, DirRight, BoundaryToken|BoundaryWhitespace);
|
||||
}
|
||||
|
||||
// BOTTOM
|
||||
|
||||
|
|
|
@ -10,11 +10,6 @@ enum{
|
|||
BufferSeekString_CaseInsensitive = 2,
|
||||
};
|
||||
|
||||
enum{
|
||||
DirLeft = 0,
|
||||
DirRight = 1,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// BOTTOM
|
||||
|
|
|
@ -440,7 +440,7 @@ Buffer_Seek_Character_Class(Application_Links *app, Buffer_ID buffer_id, Charact
|
|||
i32 chunk_index = 0;
|
||||
i32 chunk_pos = start_pos;
|
||||
if (start_pos != size){
|
||||
for (;(imem)(chunks.vals[chunk_index].size) < chunk_pos;){
|
||||
for (;(imem)(chunks.vals[chunk_index].size) <= chunk_pos;){
|
||||
Assert(chunk_index < chunks.count);
|
||||
chunk_pos -= (i32)chunks.vals[chunk_index].size;
|
||||
chunk_index += 1;
|
||||
|
|
|
@ -531,22 +531,22 @@ generate_remapping_code_and_data(Arena *arena){
|
|||
bind(arena, mappings, key_page_up, MDFR_SHIFT, page_up);
|
||||
bind(arena, mappings, key_page_down, MDFR_SHIFT, page_down);
|
||||
|
||||
bind(arena, mappings, key_up, MDFR_CTRL, seek_whitespace_up_end_line);
|
||||
bind(arena, mappings, key_down, MDFR_CTRL, seek_whitespace_down_end_line);
|
||||
bind(arena, mappings, key_left, MDFR_CTRL, seek_whitespace_left);
|
||||
bind(arena, mappings, key_right, MDFR_CTRL, seek_whitespace_right);
|
||||
bind(arena, mappings, key_up, MDFR_CTRL|MDFR_SHIFT, seek_whitespace_up_end_line);
|
||||
bind(arena, mappings, key_down, MDFR_CTRL|MDFR_SHIFT, seek_whitespace_down_end_line);
|
||||
bind(arena, mappings, key_left, MDFR_CTRL|MDFR_SHIFT, seek_whitespace_left);
|
||||
bind(arena, mappings, key_right, MDFR_CTRL|MDFR_SHIFT, seek_whitespace_right);
|
||||
bind(arena, mappings, key_up, MDFR_CTRL, move_up_to_blank_line_end);
|
||||
bind(arena, mappings, key_down, MDFR_CTRL, move_down_to_blank_line_end);
|
||||
bind(arena, mappings, key_left, MDFR_CTRL, move_left_whitespace_boundary);
|
||||
bind(arena, mappings, key_right, MDFR_CTRL, move_right_whitespace_boundary);
|
||||
bind(arena, mappings, key_up, MDFR_CTRL|MDFR_SHIFT, move_up_to_blank_line_end);
|
||||
bind(arena, mappings, key_down, MDFR_CTRL|MDFR_SHIFT, move_down_to_blank_line_end);
|
||||
bind(arena, mappings, key_left, MDFR_CTRL|MDFR_SHIFT, move_left_whitespace_boundary);
|
||||
bind(arena, mappings, key_right, MDFR_CTRL|MDFR_SHIFT, move_right_whitespace_boundary);
|
||||
|
||||
bind(arena, mappings, key_up, MDFR_ALT, move_line_up);
|
||||
bind(arena, mappings, key_down, MDFR_ALT, move_line_down);
|
||||
|
||||
bind(arena, mappings, key_back, MDFR_CTRL, backspace_word);
|
||||
bind(arena, mappings, key_del, MDFR_CTRL, delete_word);
|
||||
bind(arena, mappings, key_back, MDFR_ALT, snipe_token_or_word);
|
||||
bind(arena, mappings, key_del, MDFR_ALT, snipe_token_or_word_right);
|
||||
bind(arena, mappings, key_back, MDFR_CTRL, backspace_alpha_numeric_boundary);
|
||||
bind(arena, mappings, key_del, MDFR_CTRL, delete_alpha_numeric_boundary);
|
||||
bind(arena, mappings, key_back, MDFR_ALT, snipe_backward_whitespace_or_token_boundary);
|
||||
bind(arena, mappings, key_del, MDFR_ALT, snipe_forward_whitespace_or_token_boundary);
|
||||
|
||||
bind(arena, mappings, ' ', MDFR_CTRL, set_mark);
|
||||
bind(arena, mappings, 'a', MDFR_CTRL, replace_in_range);
|
||||
|
@ -593,11 +593,11 @@ generate_remapping_code_and_data(Arena *arena){
|
|||
|
||||
inherit_map(arena, mappings, mapid_file);
|
||||
|
||||
bind(arena, mappings, key_left , MDFR_CTRL, seek_alphanumeric_or_camel_left);
|
||||
bind(arena, mappings, key_right, MDFR_CTRL, seek_alphanumeric_or_camel_right);
|
||||
bind(arena, mappings, key_left , MDFR_CTRL, move_left_alpha_numeric_or_camel_boundary);
|
||||
bind(arena, mappings, key_right, MDFR_CTRL, move_right_alpha_numeric_or_camel_boundary);
|
||||
|
||||
bind(arena, mappings, key_left , MDFR_ALT, seek_alphanumeric_left);
|
||||
bind(arena, mappings, key_right, MDFR_ALT, seek_alphanumeric_right);
|
||||
bind(arena, mappings, key_left , MDFR_ALT, move_left_alpha_numeric_boundary);
|
||||
bind(arena, mappings, key_right, MDFR_ALT, move_right_alpha_numeric_boundary);
|
||||
|
||||
bind(arena, mappings, '\n', MDFR_NONE, write_and_auto_tab);
|
||||
bind(arena, mappings, '\n', MDFR_SHIFT, write_and_auto_tab);
|
||||
|
@ -760,22 +760,22 @@ generate_remapping_code_and_data(Arena *arena){
|
|||
bind(arena, mappings, key_page_up, MDFR_SHIFT, page_up);
|
||||
bind(arena, mappings, key_page_down, MDFR_SHIFT, page_down);
|
||||
|
||||
bind(arena, mappings, key_up, MDFR_CMND, seek_whitespace_up_end_line);
|
||||
bind(arena, mappings, key_down, MDFR_CMND, seek_whitespace_down_end_line);
|
||||
bind(arena, mappings, key_left, MDFR_CMND, seek_whitespace_left);
|
||||
bind(arena, mappings, key_right, MDFR_CMND, seek_whitespace_right);
|
||||
bind(arena, mappings, key_up, MDFR_CMND|MDFR_SHIFT, seek_whitespace_up_end_line);
|
||||
bind(arena, mappings, key_down, MDFR_CMND|MDFR_SHIFT, seek_whitespace_down_end_line);
|
||||
bind(arena, mappings, key_left, MDFR_CMND|MDFR_SHIFT, seek_whitespace_left);
|
||||
bind(arena, mappings, key_right, MDFR_CMND|MDFR_SHIFT, seek_whitespace_right);
|
||||
bind(arena, mappings, key_up, MDFR_CMND, move_up_to_blank_line_end);
|
||||
bind(arena, mappings, key_down, MDFR_CMND, move_down_to_blank_line_end);
|
||||
bind(arena, mappings, key_left, MDFR_CMND, move_left_whitespace_boundary);
|
||||
bind(arena, mappings, key_right, MDFR_CMND, move_right_whitespace_boundary);
|
||||
bind(arena, mappings, key_up, MDFR_CMND|MDFR_SHIFT, move_up_to_blank_line_end);
|
||||
bind(arena, mappings, key_down, MDFR_CMND|MDFR_SHIFT, move_down_to_blank_line_end);
|
||||
bind(arena, mappings, key_left, MDFR_CMND|MDFR_SHIFT, move_left_whitespace_boundary);
|
||||
bind(arena, mappings, key_right, MDFR_CMND|MDFR_SHIFT, move_right_whitespace_boundary);
|
||||
|
||||
bind(arena, mappings, key_up, MDFR_ALT, move_line_up);
|
||||
bind(arena, mappings, key_down, MDFR_ALT, move_line_down);
|
||||
|
||||
bind(arena, mappings, key_back, MDFR_CMND, backspace_word);
|
||||
bind(arena, mappings, key_del, MDFR_CMND, delete_word);
|
||||
bind(arena, mappings, key_back, MDFR_CTRL, snipe_token_or_word);
|
||||
bind(arena, mappings, key_del, MDFR_CTRL, snipe_token_or_word_right);
|
||||
bind(arena, mappings, key_back, MDFR_CMND, backspace_alpha_numeric_boundary);
|
||||
bind(arena, mappings, key_del, MDFR_CMND, delete_alpha_numeric_boundary);
|
||||
bind(arena, mappings, key_back, MDFR_CTRL, snipe_backward_whitespace_or_token_boundary);
|
||||
bind(arena, mappings, key_del, MDFR_CTRL, snipe_forward_whitespace_or_token_boundary);
|
||||
|
||||
bind(arena, mappings, '/', MDFR_CMND, set_mark);
|
||||
bind(arena, mappings, 'a', MDFR_CMND, replace_in_range);
|
||||
|
@ -820,11 +820,11 @@ generate_remapping_code_and_data(Arena *arena){
|
|||
|
||||
inherit_map(arena, mappings, mapid_file);
|
||||
|
||||
bind(arena, mappings, key_left , MDFR_CMND, seek_alphanumeric_or_camel_left);
|
||||
bind(arena, mappings, key_right, MDFR_CMND, seek_alphanumeric_or_camel_right);
|
||||
bind(arena, mappings, key_left , MDFR_CMND, move_left_alpha_numeric_or_camel_boundary);
|
||||
bind(arena, mappings, key_right, MDFR_CMND, move_right_alpha_numeric_or_camel_boundary);
|
||||
|
||||
bind(arena, mappings, key_left , MDFR_CTRL, seek_alphanumeric_left);
|
||||
bind(arena, mappings, key_right, MDFR_CTRL, seek_alphanumeric_right);
|
||||
bind(arena, mappings, key_left , MDFR_CTRL, move_left_alpha_numeric_boundary);
|
||||
bind(arena, mappings, key_right, MDFR_CTRL, move_right_alpha_numeric_boundary);
|
||||
|
||||
bind(arena, mappings, '\n', MDFR_NONE, write_and_auto_tab);
|
||||
bind(arena, mappings, '\n', MDFR_SHIFT, write_and_auto_tab);
|
||||
|
|
|
@ -19,3 +19,12 @@ standard_build_search
|
|||
execute_standard_build
|
||||
|
||||
open_all_files_in_directory_with_extension
|
||||
|
||||
buffer_seek_range_camel_right
|
||||
buffer_seek_range_camel_left
|
||||
|
||||
view_buffer_boundary_seek_set_pos
|
||||
view_boundary_seek_set_pos
|
||||
view_buffer_boundary_range
|
||||
view_buffer_snipe_range
|
||||
|
||||
|
|
Loading…
Reference in New Issue