summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2016-02-10 02:45:49 +0100
committerhut <hut@lepus.uberspace.de>2016-02-10 02:45:49 +0100
commit8099359508357ce5c0343275c311312633bfa611 (patch)
treebadbcb6a7588fa015cccfd5754c6e1deefc7c1cb
parentfa4c3bbd9e33fde2727c5056c5f9d866a6227fe8 (diff)
downloadranger-8099359508357ce5c0343275c311312633bfa611.tar.gz
ext.rifle: fix line numbers in error messages
-rwxr-xr-xranger/ext/rifle.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index c43de24f..afc0b558 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -154,8 +154,9 @@ class Rifle(object):
             config_file = self.config_file
         f = open(config_file, 'r')
         self.rules = []
-        lineno = 1
+        lineno = 0
         for line in f:
+            lineno += 1
             if line.startswith('#') or line == '\n':
                 continue
             line = line.strip()
@@ -170,7 +171,6 @@ class Rifle(object):
             except Exception as e:
                 self.hook_logger("Syntax error in %s line %d (%s)" % \
                     (config_file, lineno, str(e)))
-            lineno += 1
         f.close()
 
     def _eval_condition(self, condition, files, label):
f5bb2649191bc1c'>650a1fb ^
dbf7e03 ^


95766d6 ^
dbf7e03 ^
1076f2b



42277b1 ^
5d3fd37 ^
a2d56f6 ^
99b126d ^

1076f2b
650a1fb ^
1076f2b
95766d6 ^
82064af ^
1076f2b

4d55eee ^
db876f9 ^
dbf7e03 ^

4d55eee ^






dbf7e03 ^

4d55eee ^
dbf7e03 ^
4d55eee ^


dbf7e03 ^
d9386a0 ^
4d55eee ^
dbf7e03 ^

4d55eee ^



dc5c070 ^

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