Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dvtm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ copymode(const char *args[]) {

const char *argv[3] = { args[0], NULL, NULL };
char argline[32];
int line = vt_content_start(sel->app);
int line = vt_content_end(sel->app);
snprintf(argline, sizeof(argline), "+%d", line);
argv[1] = argline;

Expand Down
6 changes: 6 additions & 0 deletions vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1966,3 +1966,9 @@ int vt_content_start(Vt *t)
{
return t->buffer->scroll_above;
}

int vt_content_end(Vt *t)
{
int curs_row = t->buffer->curs_row - t->buffer->lines;
return vt_content_start(t) + curs_row;
}
1 change: 1 addition & 0 deletions vt.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ void vt_noscroll(Vt*);
pid_t vt_pid_get(Vt*);
size_t vt_content_get(Vt*, char **s, bool colored);
int vt_content_start(Vt*);
int vt_content_end(Vt*);

#endif /* VT_H */