History

command: define-section with empty contents removes a section

wm4 committed 11 years ago

Commit caebbde1 parent 9bcc8822 files · +3 −1Browse files

Unified · Split

2 files
  1. DOCS/man/input.rst +2 −0
  2. input/input.c +1 −1
DOCS/man/input.rst+2−0
@@ -521,6 +521,8 @@ Input Commands that are Possibly Subject to Change · 520 unmodified lines
521521 ``input.conf`` file (except that using the section syntax in it is not
522522 allowed), including the need to separate bindings with a newline character.
523523
524+ If the ``contents`` parameter is an empty string, the section is removed.
525+
524526 The section with the name ``default`` is the normal input section.
525527
526528 In general, input sections have to be enabled with the ``enable-section``
input/input.c+1−1
@@ -1016,7 +1016,7 @@ void mp_input_define_section(struct input_ctx *ictx, char *name, char *location, · 1015 unmodified lines
10161016 // Delete:
10171017 struct cmd_bind_section *bs = get_bind_section(ictx, bstr0(name));
10181018 remove_binds(bs, builtin);
1019− if (contents) {
1019+ if (contents && contents[0]) {
10201020 // Redefine:
10211021 parse_config(ictx, builtin, bstr0(contents), location, name);
10221022 } else {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t