Mercurial > vim
comparison src/ex_docmd.c @ 18297:b0b37bd807ba v8.1.2143
patch 8.1.2143: cannot see each command even when 'verbose' is set
Commit: https://github.com/vim/vim/commit/4facea310c2788c88f021b262658b847381a50a8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 12 20:17:40 2019 +0200
patch 8.1.2143: cannot see each command even when 'verbose' is set
Problem: Cannot see each command even when 'verbose' is set.
Solution: List each command when 'verbose' is at least 16.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 12 Oct 2019 20:30:03 +0200 |
parents | 59bc3cd42cf5 |
children | 34d5cd432cac |
comparison
equal
deleted
inserted
replaced
18296:fb6ec9cfb1c0 | 18297:b0b37bd807ba |
---|---|
557 need_wait_return = FALSE; | 557 need_wait_return = FALSE; |
558 msg_scroll = save_msg_scroll; | 558 msg_scroll = save_msg_scroll; |
559 } | 559 } |
560 | 560 |
561 /* | 561 /* |
562 * Print the executed command for when 'verbose' is set. | |
563 * When "lnum" is 0 only print the command. | |
564 */ | |
565 static void | |
566 msg_verbose_cmd(linenr_T lnum, char_u *cmd) | |
567 { | |
568 ++no_wait_return; | |
569 verbose_enter_scroll(); | |
570 | |
571 if (lnum == 0) | |
572 smsg(_("Executing: %s"), cmd); | |
573 else | |
574 smsg(_("line %ld: %s"), (long)lnum, cmd); | |
575 if (msg_silent == 0) | |
576 msg_puts("\n"); // don't overwrite this | |
577 | |
578 verbose_leave_scroll(); | |
579 --no_wait_return; | |
580 } | |
581 | |
582 /* | |
562 * Execute a simple command line. Used for translated commands like "*". | 583 * Execute a simple command line. Used for translated commands like "*". |
563 */ | 584 */ |
564 int | 585 int |
565 do_cmdline_cmd(char_u *cmd) | 586 do_cmdline_cmd(char_u *cmd) |
566 { | 587 { |
942 did_inc = TRUE; | 963 did_inc = TRUE; |
943 } | 964 } |
944 } | 965 } |
945 | 966 |
946 if (p_verbose >= 15 && sourcing_name != NULL) | 967 if (p_verbose >= 15 && sourcing_name != NULL) |
947 { | 968 msg_verbose_cmd(sourcing_lnum, cmdline_copy); |
948 ++no_wait_return; | |
949 verbose_enter_scroll(); | |
950 | |
951 smsg(_("line %ld: %s"), | |
952 (long)sourcing_lnum, cmdline_copy); | |
953 if (msg_silent == 0) | |
954 msg_puts("\n"); /* don't overwrite this */ | |
955 | |
956 verbose_leave_scroll(); | |
957 --no_wait_return; | |
958 } | |
959 | 969 |
960 /* | 970 /* |
961 * 2. Execute one '|' separated command. | 971 * 2. Execute one '|' separated command. |
962 * do_one_cmd() will return NULL if there is no trailing '|'. | 972 * do_one_cmd() will return NULL if there is no trailing '|'. |
963 * "cmdline_copy" can change, e.g. for '%' and '#' expansion. | 973 * "cmdline_copy" can change, e.g. for '%' and '#' expansion. |
1663 save_cmdmod = cmdmod; | 1673 save_cmdmod = cmdmod; |
1664 | 1674 |
1665 /* "#!anything" is handled like a comment. */ | 1675 /* "#!anything" is handled like a comment. */ |
1666 if ((*cmdlinep)[0] == '#' && (*cmdlinep)[1] == '!') | 1676 if ((*cmdlinep)[0] == '#' && (*cmdlinep)[1] == '!') |
1667 goto doend; | 1677 goto doend; |
1678 | |
1679 if (p_verbose >= 16) | |
1680 msg_verbose_cmd(0, *cmdlinep); | |
1668 | 1681 |
1669 /* | 1682 /* |
1670 * 1. Skip comment lines and leading white space and colons. | 1683 * 1. Skip comment lines and leading white space and colons. |
1671 * 2. Handle command modifiers. | 1684 * 2. Handle command modifiers. |
1672 */ | 1685 */ |
8532 static void | 8545 static void |
8533 ex_folddo(exarg_T *eap) | 8546 ex_folddo(exarg_T *eap) |
8534 { | 8547 { |
8535 linenr_T lnum; | 8548 linenr_T lnum; |
8536 | 8549 |
8537 #ifdef FEAT_CLIPBOARD | 8550 # ifdef FEAT_CLIPBOARD |
8538 start_global_changes(); | 8551 start_global_changes(); |
8539 #endif | 8552 # endif |
8540 | 8553 |
8541 /* First set the marks for all lines closed/open. */ | 8554 /* First set the marks for all lines closed/open. */ |
8542 for (lnum = eap->line1; lnum <= eap->line2; ++lnum) | 8555 for (lnum = eap->line1; lnum <= eap->line2; ++lnum) |
8543 if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed)) | 8556 if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed)) |
8544 ml_setmarked(lnum); | 8557 ml_setmarked(lnum); |
8545 | 8558 |
8546 /* Execute the command on the marked lines. */ | 8559 /* Execute the command on the marked lines. */ |
8547 global_exe(eap->arg); | 8560 global_exe(eap->arg); |
8548 ml_clearmarked(); /* clear rest of the marks */ | 8561 ml_clearmarked(); /* clear rest of the marks */ |
8549 #ifdef FEAT_CLIPBOARD | 8562 # ifdef FEAT_CLIPBOARD |
8550 end_global_changes(); | 8563 end_global_changes(); |
8551 #endif | 8564 # endif |
8552 } | 8565 } |
8553 #endif | 8566 #endif |
8554 | 8567 |
8555 #ifdef FEAT_QUICKFIX | 8568 #ifdef FEAT_QUICKFIX |
8556 /* | 8569 /* |
8564 return FALSE; | 8577 return FALSE; |
8565 return cmdnames[cmdidx].cmd_name[0] == 'l'; | 8578 return cmdnames[cmdidx].cmd_name[0] == 'l'; |
8566 } | 8579 } |
8567 #endif | 8580 #endif |
8568 | 8581 |
8569 # if defined(FEAT_TIMERS) || defined(PROTO) | 8582 #if defined(FEAT_TIMERS) || defined(PROTO) |
8570 int | 8583 int |
8571 get_pressedreturn(void) | 8584 get_pressedreturn(void) |
8572 { | 8585 { |
8573 return ex_pressedreturn; | 8586 return ex_pressedreturn; |
8574 } | 8587 } |