Skip to content

Commit

Permalink
Fix "parenthese" in identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
TWO-FINGER committed Apr 8, 2018
1 parent 36b573a commit 0aea8e6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ static const KeyBinding bindings_motions[] = {
{ "g|", ACTION(CURSOR_COLUMN) },
{ "[{", ACTION(CURSOR_BLOCK_START) },
{ "]}", ACTION(CURSOR_BLOCK_END) },
{ "[(", ACTION(CURSOR_PARENTHESE_START) },
{ "])", ACTION(CURSOR_PARENTHESE_END) },
{ "[(", ACTION(CURSOR_PARENTHESIS_START) },
{ "])", ACTION(CURSOR_PARENTHESIS_END) },
{ "$", ACTION(CURSOR_LINE_END) },
{ "^", ACTION(CURSOR_LINE_START) },
{ "}", ACTION(CURSOR_PARAGRAPH_NEXT) },
Expand Down
24 changes: 12 additions & 12 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ enum {
VIS_ACTION_CURSOR_SENTENCE_NEXT,
VIS_ACTION_CURSOR_BLOCK_START,
VIS_ACTION_CURSOR_BLOCK_END,
VIS_ACTION_CURSOR_PARENTHESE_START,
VIS_ACTION_CURSOR_PARENTHESE_END,
VIS_ACTION_CURSOR_PARENTHESIS_START,
VIS_ACTION_CURSOR_PARENTHESIS_END,
VIS_ACTION_CURSOR_COLUMN,
VIS_ACTION_CURSOR_LINE_FIRST,
VIS_ACTION_CURSOR_LINE_LAST,
Expand Down Expand Up @@ -514,15 +514,15 @@ static const KeyAction vis_action[] = {
VIS_HELP("Move cursor to the closing curly brace in a block")
movement, { .i = VIS_MOVE_BLOCK_END }
},
[VIS_ACTION_CURSOR_PARENTHESE_START] = {
"vis-motion-parenthese-start",
VIS_HELP("Move cursor to the opening parenthese inside a pair of parentheses")
movement, { .i = VIS_MOVE_PARENTHESE_START }
[VIS_ACTION_CURSOR_PARENTHESIS_START] = {
"vis-motion-parenthesis-start",
VIS_HELP("Move cursor to the opening parenthesis inside a pair of parentheses")
movement, { .i = VIS_MOVE_PARENTHESIS_START }
},
[VIS_ACTION_CURSOR_PARENTHESE_END] = {
"vis-motion-parenthese-end",
VIS_HELP("Move cursor to the closing parenthese inside a pair of parentheses")
movement, { .i = VIS_MOVE_PARENTHESE_END }
[VIS_ACTION_CURSOR_PARENTHESIS_END] = {
"vis-motion-parenthesis-end",
VIS_HELP("Move cursor to the closing parenthesis inside a pair of parentheses")
movement, { .i = VIS_MOVE_PARENTHESIS_END }
},
[VIS_ACTION_CURSOR_COLUMN] = {
"vis-motion-column",
Expand Down Expand Up @@ -1135,12 +1135,12 @@ static const KeyAction vis_action[] = {
textobj, { .i = VIS_TEXTOBJECT_INNER_SQUARE_BRACKET }
},
[VIS_ACTION_TEXT_OBJECT_PARENTHESIS_OUTER] = {
"vis-textobject-parentheses-outer",
"vis-textobject-parenthesis-outer",
VIS_HELP("() block (outer variant)")
textobj, { .i = VIS_TEXTOBJECT_OUTER_PARENTHESIS }
},
[VIS_ACTION_TEXT_OBJECT_PARENTHESIS_INNER] = {
"vis-textobject-parentheses-inner",
"vis-textobject-parenthesis-inner",
VIS_HELP("() block (inner variant)")
textobj, { .i = VIS_TEXTOBJECT_INNER_PARENTHESIS }
},
Expand Down
4 changes: 2 additions & 2 deletions text-motions.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,12 @@ size_t text_block_end(Text *txt, size_t pos) {
return text_range_valid(&r) ? r.end : pos;
}

size_t text_parenthese_start(Text *txt, size_t pos) {
size_t text_parenthesis_start(Text *txt, size_t pos) {
Filerange r = text_object_parenthesis(txt, pos-1);
return text_range_valid(&r) ? r.start-1 : pos;
}

size_t text_parenthese_end(Text *txt, size_t pos) {
size_t text_parenthesis_end(Text *txt, size_t pos) {
Filerange r = text_object_parenthesis(txt, pos+1);
return text_range_valid(&r) ? r.end : pos;
}
Expand Down
4 changes: 2 additions & 2 deletions text-motions.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ size_t text_section_prev(Text*, size_t pos);
*/
size_t text_block_start(Text*, size_t pos);
size_t text_block_end(Text*, size_t pos);
size_t text_parenthese_start(Text*, size_t pos);
size_t text_parenthese_end(Text*, size_t pos);
size_t text_parenthesis_start(Text*, size_t pos);
size_t text_parenthesis_end(Text*, size_t pos);
/* search coresponding '(', ')', '{', '}', '[', ']', '>', '<', '"', ''' */
size_t text_bracket_match(Text*, size_t pos);
/* same as above but explicitly specify symbols to match */
Expand Down
8 changes: 4 additions & 4 deletions vis-motions.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,12 @@ const Movement vis_motions[] = {
.txt = text_block_end,
.type = JUMP,
},
[VIS_MOVE_PARENTHESE_START] = {
.txt = text_parenthese_start,
[VIS_MOVE_PARENTHESIS_START] = {
.txt = text_parenthesis_start,
.type = JUMP,
},
[VIS_MOVE_PARENTHESE_END] = {
.txt = text_parenthese_end,
[VIS_MOVE_PARENTHESIS_END] = {
.txt = text_parenthesis_end,
.type = JUMP,
},
[VIS_MOVE_BRACKET_MATCH] = {
Expand Down
4 changes: 2 additions & 2 deletions vis.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ enum VisMotion {
VIS_MOVE_FUNCTION_END_NEXT,
VIS_MOVE_BLOCK_START,
VIS_MOVE_BLOCK_END,
VIS_MOVE_PARENTHESE_START,
VIS_MOVE_PARENTHESE_END,
VIS_MOVE_PARENTHESIS_START,
VIS_MOVE_PARENTHESIS_END,
VIS_MOVE_BRACKET_MATCH,
VIS_MOVE_LEFT_TO,
VIS_MOVE_RIGHT_TO,
Expand Down

0 comments on commit 0aea8e6

Please sign in to comment.