From 40f13d845bd492003dce09277f006249f6aa628c Mon Sep 17 00:00:00 2001 From: pavel Date: Sun, 7 Oct 2018 17:59:33 -0400 Subject: limited scrolling to the end of the file --- ranger/gui/widgets/browsercolumn.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index d5741d09..c0446995 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -96,11 +96,12 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes self.fm.thisdir.move_to_obj(clicked_file) self.fm.execute_file(clicked_file) elif self.target.is_file: ##scrolling through file preview? - if len(self.lines) > self.hei: ##is it longer than we can show? - if self.scrollbit > -1: ## have we reached the the top? - self.scrollbit += direction # influence the start point - if self.scrollbit < 0: #make sure we dont scroll before the file - self.scrollbit = 0 + if direction > 0 and len(self.lines) > self.hei+self.scrollbit: ##is there more to show? + self.scrollbit += direction # influence the start point + if self.scrollbit < 0: #make sure we dont scroll before or after the file + self.scrollbit = 0 + if direction < 0 and self.scrollbit > 0: ## have we reached the the top + self.scrollbit += direction # influence the start point self.need_redraw = True else: if self.level > 0 and not direction: -- cgit 1.4.1-2-gfad0 href='/akkartik/mu/commit/linux/apps/raytracing/2.mu?h=hlt&id=7ab55b3494f311fb9f4264fc01f9adc9f0ce3b15'>commit diff stats
path: root/linux/apps/raytracing/2.mu
blob: 92e457d3cfb2e7e69567ddee85233fe9cfa52738 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86