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
521 ``input.conf`` file (except that using the section syntax in it is not521 ``input.conf`` file (except that using the section syntax in it is not
522 allowed), including the need to separate bindings with a newline character.522 allowed), including the need to separate bindings with a newline character.
523 523
524 If the ``contents`` parameter is an empty string, the section is removed.
525
524 The section with the name ``default`` is the normal input section.526 The section with the name ``default`` is the normal input section.
525 527
526 In general, input sections have to be enabled with the ``enable-section``528 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
1016 // Delete:1016 // Delete:
1017 struct cmd_bind_section *bs = get_bind_section(ictx, bstr0(name));1017 struct cmd_bind_section *bs = get_bind_section(ictx, bstr0(name));
1018 remove_binds(bs, builtin);1018 remove_binds(bs, builtin);
1019 if (contents) {1019 if (contents && contents[0]) {
1020 // Redefine:1020 // Redefine:
1021 parse_config(ictx, builtin, bstr0(contents), location, name);1021 parse_config(ictx, builtin, bstr0(contents), location, name);
1022 } else {1022 } 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