mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-08 01:10:23 +00:00
[ncman] don't move down beyond the page
This commit is contained in:
parent
359af3cf76
commit
41ef5e4790
@ -780,6 +780,7 @@ create_bar(struct notcurses* nc, pagedom* dom){
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
manloop(struct notcurses* nc, const char* arg){
|
manloop(struct notcurses* nc, const char* arg){
|
||||||
|
struct ncplane* stdn = notcurses_stdplane(nc);
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
struct ncplane* page = NULL;
|
struct ncplane* page = NULL;
|
||||||
struct ncplane* bar = NULL;
|
struct ncplane* bar = NULL;
|
||||||
@ -823,8 +824,9 @@ manloop(struct notcurses* nc, const char* arg){
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'j': case NCKEY_DOWN:
|
case 'j': case NCKEY_DOWN:
|
||||||
// FIXME when to stop?
|
if(ncplane_y(page) + ncplane_dim_y(page) > ncplane_dim_y(stdn)){
|
||||||
ncplane_move_rel(page, -1, 0);
|
ncplane_move_rel(page, -1, 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user