Improved upwards scrolling, and fixed go to bottom keybinding

pull/2/head
mananapr 6 years ago
parent d18f880c60
commit f6f15d37aa

1
.gitignore vendored

@ -0,0 +1 @@
cf

@ -19,9 +19,9 @@ Apart from this, I have always wanted an alternative to ranger that is faster wh
a similar UI. a similar UI.
## Todo ## Todo
- [ ] Improve Upwards Scrolling - [x] Improve Upwards Scrolling
- [ ] Show sorted directories before files - [ ] Show sorted directories before files
- [ ] Fix the `G` keybinding - [x] Fix the `G` keybinding
- [ ] Add basic operations like renaming, copying etc. - [ ] Add basic operations like renaming, copying etc.
- [ ] Show more info in the statusbar - [ ] Show more info in the statusbar
- [ ] Add file previews - [ ] Add file previews

@ -170,7 +170,6 @@ int main(int argc, char* argv[])
wprintw(status_win, "%s@%s\t%s", getenv("USER"), getenv("HOSTNAME"), dir); wprintw(status_win, "%s@%s\t%s", getenv("USER"), getenv("HOSTNAME"), dir);
wrefresh(status_win); wrefresh(status_win);
// Print all the elements and highlight the selection // Print all the elements and highlight the selection
int t = 0; int t = 0;
for( i=start; i<len; i++ ) for( i=start; i<len; i++ )
@ -245,7 +244,7 @@ int main(int argc, char* argv[])
selection = ( selection < 0 ) ? 0 : selection; selection = ( selection < 0 ) ? 0 : selection;
// Scrolling // Scrolling
if(len > maxy) if(len > maxy)
if(selection > maxy/2) if(selection <= start + maxy/2)
{ {
if(start == 0) if(start == 0)
wclear(current_win); wclear(current_win);
@ -288,10 +287,9 @@ int main(int argc, char* argv[])
case 'G': case 'G':
selection = len - 1; selection = len - 1;
if(len > maxy - 2) if(len > maxy - 2)
start = len - maxy - 1; start = len - maxy + 2;
// Needs to be fixed
else else
start = len - 1 - maxy - 4 + 3; start = 0;
break; break;
} }

Loading…
Cancel
Save