[gnome-builder] source-vim: Dont go to negative lines when adjusting scroll
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] source-vim: Dont go to negative lines when adjusting scroll
- Date: Tue, 13 Jan 2015 09:56:08 +0000 (UTC)
commit 2d19ace11b0a9f8e2f9a3324dac6c5ab4224110f
Author: Carlos Soriano <csoriano gnome org>
Date: Tue Jan 13 10:49:20 2015 +0100
source-vim: Dont go to negative lines when adjusting scroll
Commit fbb1252c tried to fix that, but the error was not there.
https://bugzilla.gnome.org/show_bug.cgi?id=742767
src/vim/gb-source-vim.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/vim/gb-source-vim.c b/src/vim/gb-source-vim.c
index 570dac9..9cda118 100644
--- a/src/vim/gb-source-vim.c
+++ b/src/vim/gb-source-vim.c
@@ -2746,7 +2746,7 @@ gb_source_vim_adjust_scroll (GbSourceVim *vim,
case GB_SOURCE_VIM_ALIGNMENT_BOTTOM:
result->yalign = CLAMP (1.0, min_yalign, max_yalign);
- result->line = line - (1.0 - result->yalign) * page_lines;
+ result->line = MAX(0, line - (1.0 - result->yalign) * page_lines);
break;
default:
@@ -2793,7 +2793,7 @@ gb_source_vim_move_page (GbSourceVim *vim,
adjusted_scroll = gb_source_vim_adjust_scroll (vim, line, GB_SOURCE_VIM_ALIGNMENT_KEEP);
break;
case GB_SOURCE_VIM_PAGE_UP:
- line = MAX (vim->priv->scroll_off, gtk_text_iter_get_line (&iter_top));
+ line = gtk_text_iter_get_line (&iter_top);
adjusted_scroll = gb_source_vim_adjust_scroll (vim, line, GB_SOURCE_VIM_ALIGNMENT_BOTTOM);
break;
case GB_SOURCE_VIM_PAGE_DOWN:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]