diff options
-rw-r--r-- | ttystatus/index.py | 2 | ||||
-rw-r--r-- | ttystatus/index_tests.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ttystatus/index.py b/ttystatus/index.py index 8d26c75..2d51189 100644 --- a/ttystatus/index.py +++ b/ttystatus/index.py @@ -33,7 +33,7 @@ class Index(ttystatus.Widget): value = master[self.name] listvalue = master[self.listname] try: - index = listvalue.index(value) + index = listvalue.index(value) + 1 except ValueError: pass else: diff --git a/ttystatus/index_tests.py b/ttystatus/index_tests.py index 31b28c8..9d825b3 100644 --- a/ttystatus/index_tests.py +++ b/ttystatus/index_tests.py @@ -29,7 +29,7 @@ class IndexTests(unittest.TestCase): def test_gets_index_right(self): self.w.update({ 'foo': 'x', 'foos': ['a', 'x', 'b'] }, 999) - self.assertEqual(str(self.w), '1/3') + self.assertEqual(str(self.w), '2/3') def test_handles_value_not_in_list(self): self.w.update({ 'foo': 'xxx', 'foos': ['a', 'x', 'b'] }, 999) |