mirror of
https://github.com/tmux/tmux.git
synced 2026-10-09 11:44:23 +00:00
Use only one space with -p.
This commit is contained in:
@@ -38,6 +38,21 @@
|
|||||||
"#{p|#{key_string_width}:#{q|a:key_string}} " \
|
"#{p|#{key_string_width}:#{q|a:key_string}} " \
|
||||||
"#{key_command}}"
|
"#{key_command}}"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Multiline (-p) template: do not align anything, just a single space between
|
||||||
|
* each field regardless of the width of other keys.
|
||||||
|
*/
|
||||||
|
#define LIST_KEYS_TEMPLATE_PRETTY \
|
||||||
|
"#{?notes_only," \
|
||||||
|
"#{key_prefix} " \
|
||||||
|
"#{key_string} " \
|
||||||
|
"#{?key_note,#{key_note},#{key_command}}" \
|
||||||
|
"," \
|
||||||
|
"bind-key #{?key_repeat,-r ,}" \
|
||||||
|
"-T #{key_table} " \
|
||||||
|
"#{q|a:key_string} " \
|
||||||
|
"#{key_command}}"
|
||||||
|
|
||||||
static enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmdq_item *);
|
static enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmdq_item *);
|
||||||
|
|
||||||
const struct cmd_entry cmd_list_keys_entry = {
|
const struct cmd_entry cmd_list_keys_entry = {
|
||||||
@@ -209,8 +224,12 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (args_has(args, 'p'))
|
if (args_has(args, 'p'))
|
||||||
print_flags |= CMD_PARSE_PRINT_MULTILINE;
|
print_flags |= CMD_PARSE_PRINT_MULTILINE;
|
||||||
|
|
||||||
if ((template = args_get(args, 'F')) == NULL)
|
if ((template = args_get(args, 'F')) == NULL) {
|
||||||
template = LIST_KEYS_TEMPLATE;
|
if (print_flags & CMD_PARSE_PRINT_MULTILINE)
|
||||||
|
template = LIST_KEYS_TEMPLATE_PRETTY;
|
||||||
|
else
|
||||||
|
template = LIST_KEYS_TEMPLATE;
|
||||||
|
}
|
||||||
|
|
||||||
if (table)
|
if (table)
|
||||||
l = sort_get_key_bindings_table(table, &n, &sort_crit);
|
l = sort_get_key_bindings_table(table, &n, &sort_crit);
|
||||||
|
|||||||
@@ -57,23 +57,23 @@ bind-key -T parsetest n if-shell true { display-message a\nb 'x;y' '#literal' }
|
|||||||
--- options ---
|
--- options ---
|
||||||
display-message 'hi there'
|
display-message 'hi there'
|
||||||
--- multiline ---
|
--- multiline ---
|
||||||
bind-key -T parsetest a display-message hello
|
bind-key -T parsetest a display-message hello
|
||||||
bind-key -T parsetest b display-message 'hello world'
|
bind-key -T parsetest b display-message 'hello world'
|
||||||
bind-key -T parsetest c display-message 'literal $HOME #{p} ~'
|
bind-key -T parsetest c display-message 'literal $HOME #{p} ~'
|
||||||
bind-key -T parsetest d display-message ''
|
bind-key -T parsetest d display-message ''
|
||||||
bind-key -T parsetest e display-message '#{pane_id}'
|
bind-key -T parsetest e display-message '#{pane_id}'
|
||||||
bind-key -T parsetest f display-message a \; display-message b
|
bind-key -T parsetest f display-message a \; display-message b
|
||||||
bind-key -T parsetest g display-message one
|
bind-key -T parsetest g display-message one
|
||||||
display-message two
|
display-message two
|
||||||
bind-key -T parsetest h if-shell true {
|
bind-key -T parsetest h if-shell true {
|
||||||
display-message yes
|
display-message yes
|
||||||
} {
|
} {
|
||||||
display-message no
|
display-message no
|
||||||
}
|
}
|
||||||
bind-key -T parsetest m if-shell true {
|
bind-key -T parsetest m if-shell true {
|
||||||
display-message ${HOME} ~ ~root '#{pane_id}'
|
display-message ${HOME} ~ ~root '#{pane_id}'
|
||||||
}
|
}
|
||||||
bind-key -T parsetest n if-shell true {
|
bind-key -T parsetest n if-shell true {
|
||||||
display-message a\nb 'x;y' '#literal'
|
display-message a\nb 'x;y' '#literal'
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user