aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2018-04-26 14:20:22 +0200
committerMarc André Tanner <mat@brain-dump.org>2018-05-16 13:24:01 +0200
commitf9d0d91f5160a69ce6977395ba19c6d20cb8af4d (patch)
treedb7ae2f114f93b6e322baddab49de42fd77f8c7b
parent6d02c89f0c5ad8882da14f3e40724e5e1a36168b (diff)
downloadvis-f9d0d91f5160a69ce6977395ba19c6d20cb8af4d.tar.gz
vis-f9d0d91f5160a69ce6977395ba19c6d20cb8af4d.tar.xz
vis: implement gU using tr(1)
-rw-r--r--config.def.h2
-rw-r--r--main.c6
-rw-r--r--vis-operators.c3
-rw-r--r--vis.h1
4 files changed, 1 insertions, 11 deletions
diff --git a/config.def.h b/config.def.h
index 5105fd7..55e7924 100644
--- a/config.def.h
+++ b/config.def.h
@@ -183,7 +183,7 @@ static const KeyBinding bindings_operators[] = {
{ "gp", ACTION(PUT_AFTER_END) },
{ "gP", ACTION(PUT_BEFORE_END) },
{ "gu", ALIAS(":|tr '[:upper:]' '[:lower:]'<Enter>")},
- { "gU", ACTION(OPERATOR_CASE_UPPER) },
+ { "gU", ALIAS(":|tr '[:lower:]' '[:upper:]'<Enter>")},
{ "p", ACTION(PUT_AFTER) },
{ "P", ACTION(PUT_BEFORE) },
{ "y", ACTION(OPERATOR_YANK) },
diff --git a/main.c b/main.c
index f894652..bfbcc6d 100644
--- a/main.c
+++ b/main.c
@@ -236,7 +236,6 @@ enum {
VIS_ACTION_OPERATOR_YANK,
VIS_ACTION_OPERATOR_SHIFT_LEFT,
VIS_ACTION_OPERATOR_SHIFT_RIGHT,
- VIS_ACTION_OPERATOR_CASE_UPPER,
VIS_ACTION_OPERATOR_CASE_SWAP,
VIS_ACTION_COUNT,
VIS_ACTION_INSERT_NEWLINE,
@@ -778,11 +777,6 @@ static const KeyAction vis_action[] = {
VIS_HELP("Shift right operator")
operator, { .i = VIS_OP_SHIFT_RIGHT }
},
- [VIS_ACTION_OPERATOR_CASE_UPPER] = {
- "vis-operator-case-upper",
- VIS_HELP("Uppercase operator")
- operator, { .i = VIS_OP_CASE_UPPER }
- },
[VIS_ACTION_OPERATOR_CASE_SWAP] = {
"vis-operator-case-swap",
VIS_HELP("Swap case operator")
diff --git a/vis-operators.c b/vis-operators.c
index 64176a6..2a0329b 100644
--- a/vis-operators.c
+++ b/vis-operators.c
@@ -172,8 +172,6 @@ static size_t op_case_change(Vis *vis, Text *txt, OperatorContext *c) {
if (isascii(ch)) {
if (c->arg->i == VIS_OP_CASE_SWAP)
*cur = islower(ch) ? toupper(ch) : tolower(ch);
- else if (c->arg->i == VIS_OP_CASE_UPPER)
- *cur = toupper(ch);
}
}
@@ -266,7 +264,6 @@ bool vis_operator(Vis *vis, enum VisOperator id, ...) {
case VIS_OP_MODESWITCH:
vis->action.mode = va_arg(ap, int);
break;
- case VIS_OP_CASE_UPPER:
case VIS_OP_CASE_SWAP:
vis->action.arg.i = id;
id = VIS_OP_CASE_SWAP;
diff --git a/vis.h b/vis.h
index 0a5217f..4d999a6 100644
--- a/vis.h
+++ b/vis.h
@@ -388,7 +388,6 @@ enum VisOperator {
VIS_OP_CASE_SWAP,
VIS_OP_INVALID, /* denotes the end of the "real" operators */
/* pseudo operators: keep them at the end to save space in array definition */
- VIS_OP_CASE_UPPER,
VIS_OP_CURSOR_EOL,
VIS_OP_PUT_AFTER_END,
VIS_OP_PUT_BEFORE,