Skip to content

Commit

Permalink
text-motions: remove unused text_line_lastchar
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Feb 15, 2017
1 parent 05f4d78 commit d266238
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
6 changes: 0 additions & 6 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ enum {
VIS_ACTION_CURSOR_LINE_FINISH,
VIS_ACTION_CURSOR_LINE_BEGIN,
VIS_ACTION_CURSOR_LINE_END,
VIS_ACTION_CURSOR_LINE_LASTCHAR,
VIS_ACTION_CURSOR_SCREEN_LINE_UP,
VIS_ACTION_CURSOR_SCREEN_LINE_DOWN,
VIS_ACTION_CURSOR_SCREEN_LINE_BEGIN,
Expand Down Expand Up @@ -420,11 +419,6 @@ static const KeyAction vis_action[] = {
"Move cursor to end of the line",
movement, { .i = VIS_MOVE_LINE_END }
},
[VIS_ACTION_CURSOR_LINE_LASTCHAR] = {
"cursor-line-lastchar",
"Move cursor to last character of the line",
movement, { .i = VIS_MOVE_LINE_LASTCHAR }
},
[VIS_ACTION_CURSOR_SCREEN_LINE_UP] = {
"cursor-screenline-up",
"Move cursor screen/display line upwards",
Expand Down
8 changes: 0 additions & 8 deletions text-motions.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,6 @@ size_t text_line_finish(Text *txt, size_t pos) {
return it.pos;
}

size_t text_line_lastchar(Text *txt, size_t pos) {
char c;
Iterator it = text_iterator_get(txt, text_line_end(txt, pos));
if (text_iterator_char_prev(&it, &c) && c == '\n')
text_iterator_byte_next(&it, NULL);
return it.pos;
}

size_t text_line_end(Text *txt, size_t pos) {
char c;
Iterator it = text_iterator_get(txt, pos);
Expand Down
5 changes: 2 additions & 3 deletions text-motions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ size_t text_line_find_prev(Text*, size_t pos, const char *s);
/* begin finish end next
* v v v v
* [\r]\n I am a line! [\r]\n
* ^ ^ ^
* prev start lastchar
* ^ ^
* prev start
*/
size_t text_line_prev(Text*, size_t pos);
size_t text_line_begin(Text*, size_t pos);
size_t text_line_start(Text*, size_t pos);
size_t text_line_finish(Text*, size_t pos);
size_t text_line_lastchar(Text*, size_t pos);
size_t text_line_end(Text*, size_t pos);
size_t text_line_next(Text*, size_t pos);
size_t text_line_offset(Text*, size_t pos, size_t off);
Expand Down
4 changes: 0 additions & 4 deletions vis-motions.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,6 @@ const Movement vis_motions[] = {
.txt = text_line_finish,
.type = INCLUSIVE,
},
[VIS_MOVE_LINE_LASTCHAR] = {
.txt = text_line_lastchar,
.type = INCLUSIVE,
},
[VIS_MOVE_LINE_END] = {
.txt = text_line_end,
},
Expand Down

0 comments on commit d266238

Please sign in to comment.