diff options
-rw-r--r-- | runtime/doc/options.txt | 1 | ||||
-rw-r--r-- | runtime/doc/repeat.txt | 8 | ||||
-rw-r--r-- | src/ops.c | 2 | ||||
-rw-r--r-- | src/option.h | 3 | ||||
-rw-r--r-- | src/screen.c | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
6 files changed, 29 insertions, 5 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 413353c426..9b8b5e6faa 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -6528,6 +6528,7 @@ A jump table for the options with a short description can be found at |Q_op|. c don't give |ins-completion-menu| messages. For example, "-- XXX completion (YYY)", "match 1 of 2", "The only match", "Pattern not found", "Back at original", etc. + q use "recording" instead of "recording @a" This gives you the opportunity to avoid that a change between buffers requires you to hit <Enter>, but still gives as useful a message as diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index af3a5182ae..50431d352a 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -109,7 +109,13 @@ To abort this type CTRL-C twice. q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"} (uppercase to append). The 'q' command is disabled while executing a register, and it doesn't work inside - a mapping and |:normal|. {Vi: no recording} + a mapping and |:normal|. + + Note: If the register being used for recording is also + used for |y| and |p| the result is most likely not + what is expected, because the put will paste the + recorded macro and the yank will overwrite the + recorded macro. {Vi: no recording} q Stops recording. (Implementation note: The 'q' that stops recording is not stored in the register, unless @@ -1080,7 +1080,7 @@ do_record(c) retval = FAIL; else { - Recording = TRUE; + Recording = c; showmode(); regname = c; retval = OK; diff --git a/src/option.h b/src/option.h index f87283687a..c6a3e60411 100644 --- a/src/option.h +++ b/src/option.h @@ -213,7 +213,8 @@ #define SHM_ATTENTION 'A' /* no ATTENTION messages */ #define SHM_INTRO 'I' /* intro messages */ #define SHM_COMPLETIONMENU 'c' /* completion menu messages */ -#define SHM_ALL "rmfixlnwaWtToOsAIc" /* all possible flags for 'shm' */ +#define SHM_RECORDING 'q' /* short recording message */ +#define SHM_ALL "rmfixlnwaWtToOsAIcq" /* all possible flags for 'shm' */ /* characters for p_go: */ #define GO_ASEL 'a' /* autoselect */ diff --git a/src/screen.c b/src/screen.c index de9e04df68..d80ad6f96e 100644 --- a/src/screen.c +++ b/src/screen.c @@ -163,6 +163,7 @@ static void redraw_block __ARGS((int row, int end, win_T *wp)); static int win_do_lines __ARGS((win_T *wp, int row, int line_count, int mayclear, int del)); static void win_rest_invalid __ARGS((win_T *wp)); static void msg_pos_mode __ARGS((void)); +static void recording_mode __ARGS((int attr)); #if defined(FEAT_WINDOWS) static void draw_tabline __ARGS((void)); #endif @@ -10163,7 +10164,7 @@ showmode() #endif ) { - MSG_PUTS_ATTR(_("recording"), attr); + recording_mode(attr); need_clear = TRUE; } @@ -10227,11 +10228,24 @@ unshowmode(force) { msg_pos_mode(); if (Recording) - MSG_PUTS_ATTR(_("recording"), hl_attr(HLF_CM)); + recording_mode(hl_attr(HLF_CM)); msg_clr_eos(); } } + static void +recording_mode(attr) + int attr; +{ + MSG_PUTS_ATTR(_("recording"), attr); + if (!shortmess(SHM_RECORDING)) + { + char_u s[4]; + sprintf((char *)s, " @%c", Recording); + MSG_PUTS_ATTR(s, attr); + } +} + #if defined(FEAT_WINDOWS) /* * Draw the tab pages line at the top of the Vim window. diff --git a/src/version.c b/src/version.c index e3742cc9ea..5633841ed0 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 925, +/**/ 924, /**/ 923, |