Do not fail to load tweaks when the file does not end with a newline

This commit is contained in:
Kovid Goyal 2013-05-09 09:40:18 +05:30
parent 2d7e19d36d
commit 2ce41e6b27

View File

@ -172,7 +172,10 @@ class Tweaks(QAbstractListModel, SearchQueryParser): # {{{
doc.append(line[1:].strip()) doc.append(line[1:].strip())
doc = '\n'.join(doc) doc = '\n'.join(doc)
while True: while True:
line = lines[pos] try:
line = lines[pos]
except IndexError:
break
if not line.strip(): if not line.strip():
break break
spidx1 = line.find(' ') spidx1 = line.find(' ')