aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.cpp
diff options
context:
space:
mode:
authorGravatar Julian Aron Prenner <julian@linux4you.it>2014-01-15 12:04:52 +0100
committerGravatar Julian Aron Prenner <julian@linux4you.it>2014-01-15 12:04:52 +0100
commitfc21bb6eda40045b28dbd865346cad80aa3d6274 (patch)
tree3b9d1188020bcb5895b459ef8c9fd5c261ab7926 /builtin.cpp
parent3a9173858b7251eab201a895cfab05731b9ab222 (diff)
Replace builtin 'bind_mode' with variable $fish_bind_mode
Diffstat (limited to 'builtin.cpp')
-rw-r--r--builtin.cpp42
1 files changed, 7 insertions, 35 deletions
diff --git a/builtin.cpp b/builtin.cpp
index 589a4730..87f4f406 100644
--- a/builtin.cpp
+++ b/builtin.cpp
@@ -588,8 +588,8 @@ static int builtin_bind(parser_t &parser, wchar_t **argv)
const wchar_t *bind_mode = DEFAULT_BIND_MODE;
bool bind_mode_given = false;
- const wchar_t *new_bind_mode = DEFAULT_BIND_MODE;
- bool new_bind_mode_given = false;
+ const wchar_t *sets_bind_mode = DEFAULT_BIND_MODE;
+ bool sets_bind_mode_given = false;
int use_terminfo = 0;
@@ -691,8 +691,8 @@ static int builtin_bind(parser_t &parser, wchar_t **argv)
break;
case 'm':
- new_bind_mode = woptarg;
- new_bind_mode_given = true;
+ sets_bind_mode = woptarg;
+ sets_bind_mode_given = true;
break;
case '?':
@@ -706,9 +706,9 @@ static int builtin_bind(parser_t &parser, wchar_t **argv)
/*
* if mode is given, but not new mode, default to new mode to mode
*/
- if(bind_mode_given && !new_bind_mode_given)
+ if(bind_mode_given && !sets_bind_mode_given)
{
- new_bind_mode = bind_mode;
+ sets_bind_mode = bind_mode;
}
switch (mode)
@@ -739,7 +739,7 @@ static int builtin_bind(parser_t &parser, wchar_t **argv)
default:
{
- builtin_bind_add(argv[woptind], (const wchar_t **)argv + (woptind + 1), argc - (woptind + 1), bind_mode, new_bind_mode, use_terminfo);
+ builtin_bind_add(argv[woptind], (const wchar_t **)argv + (woptind + 1), argc - (woptind + 1), bind_mode, sets_bind_mode, use_terminfo);
break;
}
@@ -774,33 +774,6 @@ static int builtin_bind(parser_t &parser, wchar_t **argv)
/**
- The bind mode builtin
-*/
-static int builtin_bind_mode(parser_t &parser, wchar_t **argv)
-{
- int res = STATUS_BUILTIN_OK;
- int argc = builtin_count_args(argv);
-
- switch (argc)
- {
- case 1:
- {
- append_format(stdout_buffer, L"%ls\n", input_get_bind_mode());
- break;
- }
-
- default:
- {
- res = STATUS_BUILTIN_ERROR;
- append_format(stderr_buffer, _(L"%ls: Expected no parameters, got %d"), argv[0], argc);
- break;
- }
- }
- return res;
-}
-
-
-/**
The block builtin, used for temporarily blocking events
*/
static int builtin_block(parser_t &parser, wchar_t **argv)
@@ -4058,7 +4031,6 @@ static const builtin_data_t builtin_datas[]=
{ L"begin", &builtin_begin, N_(L"Create a block of code") },
{ L"bg", &builtin_bg, N_(L"Send job to background") },
{ L"bind", &builtin_bind, N_(L"Handle fish key bindings") },
- { L"bind_mode", &builtin_bind_mode, N_(L"Set or get the current bind mode") },
{ L"block", &builtin_block, N_(L"Temporarily block delivery of events") },
{ L"break", &builtin_break_continue, N_(L"Stop the innermost loop") },
{ L"breakpoint", &builtin_breakpoint, N_(L"Temporarily halt execution of a script and launch an interactive debug prompt") },