Re: [hackers][vis][PATCH] Don't use an offset of 1 for the 'L' command by default

2016-01-31 Thread Marc André Tanner
Thanks for the patch! I think I fixed the issue in a slightly different way.

-- 
 Marc André Tanner >< http://www.brain-dump.org/ >< GPG key: 10C93617



[hackers][vis][PATCH] Don't use an offset of 1 for the 'L' command by default

2016-01-17 Thread Silvan Jegen
---

This was the easiest way to fix this that I could think of (without
duplicating most of the 'return' line).

 vis-motions.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vis-motions.c b/vis-motions.c
index 9bd95b9..f00d525 100644
--- a/vis-motions.c
+++ b/vis-motions.c
@@ -99,7 +99,10 @@ static size_t view_lines_middle(Vis *vis, View *view) {
 
 static size_t view_lines_bottom(Vis *vis, View *view) {
int h = view_height_get(vis->win->view);
-   return view_screenline_goto(vis->win->view, h - vis->action.count);
+   int offset = 0;
+   if (vis->action.count > 1)
+   offset = vis->action.count;
+   return view_screenline_goto(vis->win->view, h - offset);
 }
 
 static size_t window_changelist_next(Vis *vis, Win *win, size_t pos) {
-- 
2.5.0




[hackers][vis][PATCH] Don't use an offset of 1 for the 'L' command by default

2016-01-17 Thread Silvan Jegen
---

This was the easiest way to fix this that I could think of (without
duplicating most of the 'return' line).

 vis-motions.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vis-motions.c b/vis-motions.c
index 9bd95b9..f00d525 100644
--- a/vis-motions.c
+++ b/vis-motions.c
@@ -99,7 +99,10 @@ static size_t view_lines_middle(Vis *vis, View *view) {
 
 static size_t view_lines_bottom(Vis *vis, View *view) {
int h = view_height_get(vis->win->view);
-   return view_screenline_goto(vis->win->view, h - vis->action.count);
+   int offset = 0;
+   if (vis->action.count > 1)
+   offset = vis->action.count;
+   return view_screenline_goto(vis->win->view, h - offset);
 }
 
 static size_t window_changelist_next(Vis *vis, Win *win, size_t pos) {
-- 
2.5.0