]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.cpp
typo
[lyx.git] / src / rowpainter.cpp
index d36916126fddcfe38521a9b2282051e5d8c834fc..0a097ed9f257edd0308bae09e473db4025b64e4d 100644 (file)
@@ -246,6 +246,7 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
        // selected text?
        bool const selection = pos >= row_.sel_beg && pos < row_.sel_end;
 
+       char_type prev_char = ' ';
        // collect as much similar chars as we can
        for (++vpos ; vpos < end ; ++vpos) {
                pos = bidi_.vis2log(vpos);
@@ -264,6 +265,11 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
 
                char_type c = par_.getChar(pos);
 
+               if (c == '\t' || prev_char == '\t') {
+                       prev_char = c;
+                       break;
+               }
+
                if (!isPrintableNonspace(c))
                        break;
 
@@ -308,6 +314,9 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
 
        docstring s(&str[0], str.size());
 
+       if (s[0] == '\t')
+               s.replace(0,1,from_ascii("    "));
+
        if (!selection && !change_running.changed()) {
                x_ += pi_.pain.text(int(x_), yo_, s, font);
                return;