1. Yuya Nishihara
  2. thg-work

Commits

Steve Borho  committed 6850195

fileview: always emit newChunkList for all display modes

Prevents tracebacks when mode is switched from diff to annotate, then the file
check status is toggled.

  • Participants
  • Parent commits 2a271d1
  • Branches default

Comments (0)

Files changed (1)

File tortoisehg/hgqt/fileview.py

View file
                 self.blk.setVisible(self._mode != DiffMode)
                 self.sci.setAnnotationEnabled(self._mode == AnnMode)
 
-        if fd.changes is None:
-            self.newChunkList.emit(uf, None)
-
         if self._mode == DiffMode:
             self.sci.setMarginWidth(1, 0)
             lexer = lexers.get_diff_lexer(self)
                 else:
                     # there was an error or rename without diffs
                     self.sci.setText(hglib.tounicode(fd.diff))
+            self.newChunkList.emit(uf, fd.changes)
         elif fd.ucontents:
             # subrepo summary and perhaps other data
             self.sci.setText(fd.ucontents)
             self.sci.setFont(qtlib.getfont('fontlog').font())
             self.sci.setMarginWidth(1, 0)
             self.blk.setVisible(False)
+            self.newChunkList.emit(uf, None)
             return
         elif fd.contents:
             lexer = lexers.get_lexer(filename, fd.contents, self)
             self.sci._updatemarginwidth()
             if self._mode == AnnMode:
                 self.sci._updateannotation(self._ctx, filename)
+            self.newChunkList.emit(uf, None)
         else:
+            self.newChunkList.emit(uf, None)
             return
 
         # Recover the last cursor/scroll position
         self.highlightText(*self._lastSearch)
         uc = hglib.tounicode(fd.contents) or ''
         self.fileDisplayed.emit(uf, uc)
-        self.newChunkList.emit(uf, fd.changes)
 
         if self._mode != DiffMode:
             self.blk.setVisible(True)