Mercurial > vim
comparison src/ex_docmd.c @ 16399:47d6e874955c v8.1.1204
patch 8.1.1204: output of :command with address completion is not nice
commit https://github.com/vim/vim/commit/a561a41a70db7a9367f883c1dbb14e69b3364d08
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 25 21:27:58 2019 +0200
patch 8.1.1204: output of :command with address completion is not nice
Problem: Output of :command with address completion is not nice.
Solution: Shorten the address completion names.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 25 Apr 2019 21:30:05 +0200 |
parents | c1c25e2523a6 |
children | 5b5c5daf57de |
comparison
equal
deleted
inserted
replaced
16398:f772cb5f2d94 | 16399:47d6e874955c |
---|---|
5913 #if defined(FEAT_USR_CMDS) | 5913 #if defined(FEAT_USR_CMDS) |
5914 static struct | 5914 static struct |
5915 { | 5915 { |
5916 int expand; | 5916 int expand; |
5917 char *name; | 5917 char *name; |
5918 char *shortname; | |
5918 } addr_type_complete[] = | 5919 } addr_type_complete[] = |
5919 { | 5920 { |
5920 {ADDR_ARGUMENTS, "arguments"}, | 5921 {ADDR_ARGUMENTS, "arguments", "arg"}, |
5921 {ADDR_LINES, "lines"}, | 5922 {ADDR_LINES, "lines", "line"}, |
5922 {ADDR_LOADED_BUFFERS, "loaded_buffers"}, | 5923 {ADDR_LOADED_BUFFERS, "loaded_buffers", "load"}, |
5923 {ADDR_TABS, "tabs"}, | 5924 {ADDR_TABS, "tabs", "tab"}, |
5924 {ADDR_BUFFERS, "buffers"}, | 5925 {ADDR_BUFFERS, "buffers", "buf"}, |
5925 {ADDR_WINDOWS, "windows"}, | 5926 {ADDR_WINDOWS, "windows", "win"}, |
5926 {ADDR_QUICKFIX, "quickfix"}, | 5927 {ADDR_QUICKFIX, "quickfix", "qf"}, |
5927 {ADDR_OTHER, "other"}, | 5928 {ADDR_OTHER, "other", "?"}, |
5928 {-1, NULL} | 5929 {-1, NULL, NULL} |
5929 }; | 5930 }; |
5930 #endif | 5931 #endif |
5931 | 5932 |
5932 #if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO) | 5933 #if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO) |
5933 /* | 5934 /* |
6018 || message_filtered(cmd->uc_name)) | 6019 || message_filtered(cmd->uc_name)) |
6019 continue; | 6020 continue; |
6020 | 6021 |
6021 /* Put out the title first time */ | 6022 /* Put out the title first time */ |
6022 if (!found) | 6023 if (!found) |
6023 msg_puts_title(_("\n Name Args Address Complete Definition")); | 6024 msg_puts_title(_("\n Name Args Address Complete Definition")); |
6024 found = TRUE; | 6025 found = TRUE; |
6025 msg_putchar('\n'); | 6026 msg_putchar('\n'); |
6026 if (got_int) | 6027 if (got_int) |
6027 break; | 6028 break; |
6028 | 6029 |
6099 IObuff[len++] = '.'; | 6100 IObuff[len++] = '.'; |
6100 } | 6101 } |
6101 | 6102 |
6102 do { | 6103 do { |
6103 IObuff[len++] = ' '; | 6104 IObuff[len++] = ' '; |
6104 } while (len < 9 - over); | 6105 } while (len < 8 - over); |
6105 | 6106 |
6106 // Address Type | 6107 // Address Type |
6107 for (j = 0; addr_type_complete[j].expand != -1; ++j) | 6108 for (j = 0; addr_type_complete[j].expand != -1; ++j) |
6108 if (addr_type_complete[j].expand != ADDR_LINES | 6109 if (addr_type_complete[j].expand != ADDR_LINES |
6109 && addr_type_complete[j].expand == cmd->uc_addr_type) | 6110 && addr_type_complete[j].expand == cmd->uc_addr_type) |
6110 { | 6111 { |
6111 STRCPY(IObuff + len, addr_type_complete[j].name); | 6112 STRCPY(IObuff + len, addr_type_complete[j].shortname); |
6112 len += (int)STRLEN(IObuff + len); | 6113 len += (int)STRLEN(IObuff + len); |
6113 break; | 6114 break; |
6114 } | 6115 } |
6115 | 6116 |
6116 do { | 6117 do { |
6126 break; | 6127 break; |
6127 } | 6128 } |
6128 | 6129 |
6129 do { | 6130 do { |
6130 IObuff[len++] = ' '; | 6131 IObuff[len++] = ' '; |
6131 } while (len < 24 - over); | 6132 } while (len < 25 - over); |
6132 | 6133 |
6133 IObuff[len] = '\0'; | 6134 IObuff[len] = '\0'; |
6134 msg_outtrans(IObuff); | 6135 msg_outtrans(IObuff); |
6135 | 6136 |
6136 msg_outtrans_special(cmd->uc_rep, FALSE, | 6137 msg_outtrans_special(cmd->uc_rep, FALSE, |
6137 name_len == 0 ? Columns - 46 : 0); | 6138 name_len == 0 ? Columns - 47 : 0); |
6138 #ifdef FEAT_EVAL | 6139 #ifdef FEAT_EVAL |
6139 if (p_verbose > 0) | 6140 if (p_verbose > 0) |
6140 last_set_msg(cmd->uc_script_ctx); | 6141 last_set_msg(cmd->uc_script_ctx); |
6141 #endif | 6142 #endif |
6142 out_flush(); | 6143 out_flush(); |