Commit 1387c1cb authored by Steve Borho's avatar Steve Borho
Browse files

fileview: disable line number margin in clearDisplay()

The margin was sometimes visible when switching to a merge or other revision
which did not contain any files.
parent a95ecea3b9c3
......@@ -283,6 +283,8 @@ class HgFileView(QFrame):
# from disappearing during refresh, and tool layouts bouncing
self.filenamelabel.setText(' ')
self.extralabel.hide()
self.sci.setMarginLineNumbers(1, False)
self.sci.setMarginWidth(1, '')
def displayFile(self, filename=None, rev=None, status=None):
if filename is None:
......@@ -319,19 +321,13 @@ class HgFileView(QFrame):
if not fd.isValid():
self.ann.setVisible(False)
self.sci.setText(fd.error)
self.sci.setMarginLineNumbers(1, False)
self.sci.setMarginWidth(1, '')
return
if self._mode == 'diff' and fd.diff:
lexer = get_diff_lexer(self)
self.sci.setLexer(lexer)
self.sci.setText(fd.diff)
self.sci.setMarginLineNumbers(1, False)
self.sci.setMarginWidth(1, '')
elif fd.contents is None:
self.sci.setMarginLineNumbers(1, False)
self.sci.setMarginWidth(1, '')
return
else:
lexer = get_lexer(filename, fd.contents, self)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment