1. TortoiseHg
  2. TortoiseHg
  3. thg
  4. Issues
Issue #2429 on hold

Annotate view: author not correctly displayed

André Sintzoff
created an issue

In the annotate view, the author can be optionally displayed.

7-bit authors are correctly displayed but others are not.

I don't understand as the "status" at the bottom of the window is correctly displayed.

In fileview.py:

"status" displayed thanks to self.showMessage.emit(s)in _emitRevisionHintAtLine(self, line) where s is u'Andr\xe9 Sintzoff@13544:4 semaines "doc: fix typo in change selection"'

and "author" displayed thanks to self.setMarginText(i, self._lineannotation(fctx), s) in _updaterevmargin(self)where self._lineannotation(fctx) is u'Andr\xe9 Sintzoff : 2013-01-17 : 13544'

Is there any restriction for setMarginText?

See attached file.

Comments (4)

  1. Yuya Nishihara

    Same for TortoiseHg 2.6.2.

    I suspect that Scintilla core does not support utf-8 for margin text. Latin1 string is accepted by Scintilla.

    diff --git a/tortoisehg/hgqt/fileview.py b/tortoisehg/hgqt/fileview.py
    --- a/tortoisehg/hgqt/fileview.py
    +++ b/tortoisehg/hgqt/fileview.py
    @@ -1060,7 +1060,11 @@ class AnnotateView(qscilib.Scintilla):
                                s.style(), s.font().pointSize())
             for i, (fctx, _origline) in enumerate(self._links):
    -            self.setMarginText(i, self._lineannotation(fctx), s)
    +            #self.setMarginText(i, self._lineannotation(fctx), s)
    +            styleoffset = self.SendScintilla(self.SCI_MARGINGETSTYLEOFFSET)
    +            self.SendScintilla(self.SCI_MARGINSETTEXT, i,
    +                               self._lineannotation(fctx).encode('latin1'))
    +            self.SendScintilla(self.SCI_MARGINSETSTYLE, i, s.style() - styleoffset)
         def _updatemarkers(self):
             """Update markers which colorizes each line"""
  2. Log in to comment