diff --git a/gb.qt4/src/ext/gview.cpp b/gb.qt4/src/ext/gview.cpp index a62e40913..0f26aa979 100644 --- a/gb.qt4/src/ext/gview.cpp +++ b/gb.qt4/src/ext/gview.cpp @@ -128,6 +128,9 @@ GEditor::GEditor(QWidget *parent) flashed = false; painting = false; _showStringIgnoreCase = false; + _showRow = -1; + _showCol = 0; + _showLen = 0; for (i = 0; i < GLine::NUM_STATE; i++) { @@ -502,6 +505,13 @@ void GEditor::paintShowString(QPainter &p, GLine *l, int x, int y, int xmin, int p.fillRect(ps, 0, nx - ps, h, bg); pos += _showString.length(); } + +if (row == _showRow && _showLen > 0 && _showCol >= 0 && _showCol < (int)l->s.length()) + { + ps = lineWidth(row, _showCol); + nx = lineWidth(row, QMAX((int)l->s.length(), _showCol + _showLen)); + p.fillRect(ps, 0, nx - ps, h, bg); + } } static void make_blend(QPixmap &pix, QColor start, QColor end, int height) //, bool loop = false) @@ -660,8 +670,8 @@ void GEditor::paintCell(QPainter * painter, int row, int) p.translate(-ur.left(), 0); - // Search - if (highlight && _showString.length()) + // Show string + if (highlight && (_showRow == realRow || _showString.length())) paintShowString(p, l, margin, fm.ascent() + 1, xmin, lmax, cellHeight(), realRow); // Selection background @@ -2127,3 +2137,11 @@ void GEditor::showString(GString s, bool ignoreCase) _showStringIgnoreCase = ignoreCase; updateContents(); } + +void GEditor::showWord(int y, int x, int len) +{ + _showRow = y; + _showCol = x; + _showLen = len; + updateLine(y); +} diff --git a/gb.qt4/src/ext/gview.h b/gb.qt4/src/ext/gview.h index 971a56be5..4b374ec8c 100644 --- a/gb.qt4/src/ext/gview.h +++ b/gb.qt4/src/ext/gview.h @@ -82,6 +82,7 @@ private: bool painting; GString _showString; bool _showStringIgnoreCase; + int _showRow, _showCol, _showLen; int lastx; bool left; @@ -218,6 +219,7 @@ public: void checkMatching(); void flash(); void showString(GString s, bool ignoreCase); + void showWord(int y, int x, int len); void foldClear() { fold.clear(); } void foldLine(int row, bool no_refresh = false);