From f6f15d37aa46a51673336b215afacc013e4ce9ce Mon Sep 17 00:00:00 2001 From: mananapr Date: Tue, 1 Jan 2019 11:58:08 +0530 Subject: [PATCH] Improved upwards scrolling, and fixed go to bottom keybinding --- .gitignore | 1 + README.md | 4 ++-- cf.c | 8 +++----- 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f53965 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +cf diff --git a/README.md b/README.md index 186b273..323e6c7 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ Apart from this, I have always wanted an alternative to ranger that is faster wh a similar UI. ## Todo -- [ ] Improve Upwards Scrolling +- [x] Improve Upwards Scrolling - [ ] Show sorted directories before files -- [ ] Fix the `G` keybinding +- [x] Fix the `G` keybinding - [ ] Add basic operations like renaming, copying etc. - [ ] Show more info in the statusbar - [ ] Add file previews diff --git a/cf.c b/cf.c index c492146..a563fe9 100644 --- a/cf.c +++ b/cf.c @@ -170,7 +170,6 @@ int main(int argc, char* argv[]) wprintw(status_win, "%s@%s\t%s", getenv("USER"), getenv("HOSTNAME"), dir); wrefresh(status_win); - // Print all the elements and highlight the selection int t = 0; for( i=start; i maxy) - if(selection > maxy/2) + if(selection <= start + maxy/2) { if(start == 0) wclear(current_win); @@ -288,10 +287,9 @@ int main(int argc, char* argv[]) case 'G': selection = len - 1; if(len > maxy - 2) - start = len - maxy - 1; - // Needs to be fixed + start = len - maxy + 2; else - start = len - 1 - maxy - 4 + 3; + start = 0; break; }