4.0.9 features complete

master
Allen Webster 2016-07-05 09:11:26 -04:00
parent 98fa9e1952
commit 08d183eb9a
5 changed files with 44 additions and 34 deletions

View File

@ -1139,18 +1139,6 @@ the range [1,16].</div></div><hr>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>cmdid_open_debug opens the debug information viewer mode.</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>cmdid_open_panel_vsplit</span></span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>cmdid_open_panel_vsplit splits the current panel into two with a vertical divider.</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>cmdid_open_panel_hsplit</span></span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>cmdid_open_panel_hsplit splits the current panel into two with a horizontal divider.</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>cmdid_close_panel</span></span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>cmdid_close_panel closes the active panel.</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>cmdid_count</span></span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'></div></div>
</div>

View File

@ -357,7 +357,7 @@ default_keys(Bind_Helper *context){
bind(context, 'g', MDFR_CTRL, goto_line);
bind(context, 'h', MDFR_CTRL, cmdid_history_backward);
bind(context, 'H', MDFR_CTRL, cmdid_history_forward);
bind(context, 'j', MDFR_CTRL, cmdid_to_lowercase);
bind(context, 'j', MDFR_CTRL, to_lowercase);
bind(context, 'K', MDFR_CTRL, cmdid_kill_buffer);
bind(context, 'l', MDFR_CTRL, toggle_line_wrap);
bind(context, 'm', MDFR_CTRL, cursor_mark_swap);
@ -366,7 +366,7 @@ default_keys(Bind_Helper *context){
bind(context, 'r', MDFR_CTRL, reverse_search);
bind(context, 's', MDFR_ALT, show_scrollbar);
bind(context, 's', MDFR_CTRL, cmdid_save);
bind(context, 'u', MDFR_CTRL, cmdid_to_uppercase);
bind(context, 'u', MDFR_CTRL, to_uppercase);
bind(context, 'U', MDFR_CTRL, rewrite_as_single_caps);
bind(context, 'v', MDFR_CTRL, paste);
bind(context, 'V', MDFR_CTRL, paste_next);

View File

@ -394,6 +394,44 @@ CUSTOM_COMMAND_SIG(paste_next){
}
}
//
// Fancy Editing
//
CUSTOM_COMMAND_SIG(to_uppercase){
View_Summary view = app->get_active_view(app, AccessOpen);
Buffer_Summary buffer = app->get_buffer(app, view.buffer_id, AccessOpen);
Range range = get_range(&view);
int size = range.max - range.min;
if (size <= app->memory_size){
char *mem = (char*)app->memory;
app->buffer_read_range(app, &buffer, range.min, range.max, mem);
for (int i = 0; i < size; ++i){
mem[i] = char_to_upper(mem[i]);
}
app->buffer_replace_range(app, &buffer, range.min, range.max, mem, size);
}
}
CUSTOM_COMMAND_SIG(to_lowercase){
View_Summary view = app->get_active_view(app, AccessOpen);
Buffer_Summary buffer = app->get_buffer(app, view.buffer_id, AccessOpen);
Range range = get_range(&view);
int size = range.max - range.min;
if (size <= app->memory_size){
char *mem = (char*)app->memory;
app->buffer_read_range(app, &buffer, range.min, range.max, mem);
for (int i = 0; i < size; ++i){
mem[i] = char_to_lower(mem[i]);
}
app->buffer_replace_range(app, &buffer, range.min, range.max, mem, size);
}
}
//
// Various Forms of Seek
//

View File

@ -67,11 +67,6 @@ ENUM(uint64_t, Command_ID){
/* DOC(cmdid_history_forward unperforms the previous cmdid_history_backward step if possib.e) */
cmdid_history_forward,
/* DOC(cmdid_to_uppercase makes all the alphabetic characters in the cursor/mark range uppercase.) */
cmdid_to_uppercase,
/* DOC(cmdid_to_uppercase makes all the alphabetic characters in the cursor/mark range lowercase.) */
cmdid_to_lowercase,
/* DOC(cmdid_clean_all_lines deletes extra whitespace out the currently active buffer.) */
cmdid_clean_all_lines,
@ -101,15 +96,6 @@ ENUM(uint64_t, Command_ID){
/* DOC(cmdid_open_debug opens the debug information viewer mode.) */
cmdid_open_debug,
#if 0
/* DOC(cmdid_open_panel_vsplit splits the current panel into two with a vertical divider.) */
cmdid_open_panel_vsplit,
/* DOC(cmdid_open_panel_hsplit splits the current panel into two with a horizontal divider.) */
cmdid_open_panel_hsplit,
/* DOC(cmdid_close_panel closes the active panel.) */
cmdid_close_panel,
#endif
// count
cmdid_count
};

10
4ed.cpp
View File

@ -1028,15 +1028,13 @@ setup_command_table(){
SET(interactive_new);
SET(interactive_open);
SET(reopen);
SET(save);
SET(save_as);
SET(interactive_switch_buffer);
SET(interactive_kill_buffer);
SET(kill_buffer);
SET(save_as);
SET(to_uppercase);
SET(to_lowercase);
SET(reopen);
SET(save);
SET(kill_buffer);
SET(clean_all_lines);