diff options
author | Andrés <andmarti@gmail.com> | 2021-03-27 09:36:24 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-03-27 09:36:24 -0300 |
commit | 8f44ee1051155287292b410545edb27ba4132955 (patch) | |
tree | 79a190a70d6cc33355d3c2389aa79b1e7f2a2c68 /src | |
parent | f911c9dbf44e99ddaec35508228aaad9e28913f3 (diff) |
Adde freeze to visual mode
Diffstat (limited to 'src')
-rw-r--r-- | src/cmds.c | 1 | ||||
-rw-r--r-- | src/cmds_command.c | 6 | ||||
-rw-r--r-- | src/cmds_visual.c | 12 | ||||
-rwxr-xr-x | src/doc | 1 |
4 files changed, 19 insertions, 1 deletions
@@ -2911,6 +2911,7 @@ int is_single_command (struct block * buf, long timeout) { result = MOVEMENT_CMD; else if (buf->value == L'{' || buf->value == L'}' || + buf->value == L'f' || buf->value == L'|') result = EDITION_CMD; diff --git a/src/cmds_command.c b/src/cmds_command.c index d20b106..073f997 100644 --- a/src/cmds_command.c +++ b/src/cmds_command.c @@ -584,6 +584,8 @@ void do_commandmode(struct block * sb) { } else if ( ! wcsncmp(inputline, L"freeze ", 7) ) { wcscpy(interp_line, inputline); send_to_interp(interp_line); + center_hidden_rows = 0; + center_hidden_cols = 0; } else if ( ! wcsncmp(inputline, L"freeze", 6) ) { wcscpy(interp_line, inputline); @@ -595,6 +597,8 @@ void do_commandmode(struct block * sb) { swprintf(interp_line + wcslen(interp_line), BUFFERSIZE, L"%s%d %ls", coltoa(sr->brcol), sr->brrow, cline); } send_to_interp(interp_line); + center_hidden_rows = 0; + center_hidden_cols = 0; } else if ( ! wcsncmp(inputline, L"unfreeze", 8) ) { wcscpy(interp_line, inputline); @@ -730,7 +734,7 @@ void do_commandmode(struct block * sb) { swprintf(interp_line, BUFFERSIZE, L"strtonum %s%d:", coltoa(c), r); swprintf(interp_line + wcslen(interp_line), BUFFERSIZE, L"%s%d", coltoa(cf), rf); send_to_interp(interp_line); - + } else if ( ! wcsncmp(inputline, L"cpaste", 6) ) { swprintf(interp_line, BUFFERSIZE, L"cpaste"); send_to_interp(interp_line); diff --git a/src/cmds_visual.c b/src/cmds_visual.c index ac2ea06..768064d 100644 --- a/src/cmds_visual.c +++ b/src/cmds_visual.c @@ -53,6 +53,7 @@ #include "conf.h" #include "hide_show.h" #include "shift.h" +#include "freeze.h" #include "yank.h" #include "history.h" #include "interp.h" @@ -500,6 +501,17 @@ void do_visualmode(struct block * buf) { chg_mode('.'); ui_show_header(); + // freeze a range + } else if (buf->value == L'f') { + add_frange(lookat(r->tlrow, r->tlcol), lookat(r->brrow, r->brcol), 'a'); + center_hidden_rows = 0; + center_hidden_cols = 0; + cmd_multiplier = 0; + + exit_visualmode(); + chg_mode('.'); + ui_show_header(); + // range lock / unlock // valueize } else if ( buf->value == L'r' && (buf->pnext->value == L'l' || buf->pnext->value == L'u' || buf->pnext->value == L'v' )) { @@ -1092,6 +1092,7 @@ Commands for handling cell content: special command can be entered. Zr Zap (hides) the rows covered by the selected range. Zc Zap (hides) the columns covered by the selected range. + f Freeze the selected range Sr Show rows that are hidden and that are covered by the selected range. Sc Show columns that are hidden and that are covered by the |