# HG changeset patch # User John W. Eaton # Date 1508805317 14400 # Node ID 1680d425bb386ffcb4e0acd3f716c301b112ff22 # Parent 3dbd6409eeb90bbc827856959e6eba7ede77362f also place marker in editor margin for lines matching selected word * file-editor-tab.h, file-editor-tab.cc (file_editor_tab::_marker_highlight_all): New data member. (file_editor_tab::file_editor_tab): Define marker. (file_editor_tab::update_lexer_settings): Set marker colors. (file_editor_tab::handle_double_click): Also set and clear margin marker. * octave-qscintilla.h, octave-qscintilla.cc (octave_qscintilla::clear_indicator): New argument, marker_style. Also delete all marker_style markers. diff -r 3dbd6409eeb9 -r 1680d425bb38 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Tue Oct 24 15:56:22 2017 +0200 +++ b/libgui/src/m-editor/file-editor-tab.cc Mon Oct 23 20:35:17 2017 -0400 @@ -243,6 +243,10 @@ _indicator_highlight_all = 1; _edit_area->setIndicatorDrawUnder (true, _indicator_highlight_all); + + _marker_highlight_all = _edit_area->markerDefine (QsciScintilla::Minus); + if (_marker_highlight_all == -1) + _marker_highlight_all = 1; } file_editor_tab::~file_editor_tab (void) @@ -803,6 +807,9 @@ _edit_area->setIndicatorForegroundColor (hg, _indicator_highlight_all); _edit_area->setIndicatorOutlineColor (hg, _indicator_highlight_all); + _edit_area->setMarkerBackgroundColor (hg, _marker_highlight_all); + _edit_area->setMarkerForegroundColor (hg, _marker_highlight_all); + // fix line number width with respect to the font size of the lexer and // set the line numbers font depending on the lexers font if (settings->value ("editor/showLineNumbers", true).toBool ()) @@ -2849,7 +2856,8 @@ { // double clicks without modifier // clear any existing indicators of this type - _edit_area->clear_indicator (_indicator_highlight_all); + _edit_area->clear_indicator (_indicator_highlight_all, + _marker_highlight_all); if (_highlight_all_occurrences) { @@ -2898,6 +2906,9 @@ _edit_area->fillIndicatorRange (oline, ocol - wlen, oline, ocol, _indicator_highlight_all); + + _edit_area->markerAdd (oline, _marker_highlight_all); + // find next occurrence find_result_available = _edit_area->findNext (); } diff -r 3dbd6409eeb9 -r 1680d425bb38 libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h Tue Oct 24 15:56:22 2017 +0200 +++ b/libgui/src/m-editor/file-editor-tab.h Mon Oct 23 20:35:17 2017 -0400 @@ -307,6 +307,7 @@ bool _lines_changed; bool _highlight_all_occurrences; int _indicator_highlight_all; + int _marker_highlight_all; int m_bp_restore_count; }; diff -r 3dbd6409eeb9 -r 1680d425bb38 libgui/src/m-editor/octave-qscintilla.cc --- a/libgui/src/m-editor/octave-qscintilla.cc Tue Oct 24 15:56:22 2017 +0200 +++ b/libgui/src/m-editor/octave-qscintilla.cc Mon Oct 23 20:35:17 2017 -0400 @@ -322,12 +322,14 @@ // helper function for clearing all indicators of a specific style void -octave_qscintilla::clear_indicator (int indicator_style) +octave_qscintilla::clear_indicator (int indicator_style, int marker_style) { int end_pos = text ().length (); int end_line, end_col; lineIndexFromPosition (end_pos, &end_line, &end_col); clearIndicatorRange (0, 0, end_line, end_col, indicator_style); + + markerDeleteAll (marker_style); } // Function returning the true cursor position where the tab length diff -r 3dbd6409eeb9 -r 1680d425bb38 libgui/src/m-editor/octave-qscintilla.h --- a/libgui/src/m-editor/octave-qscintilla.h Tue Oct 24 15:56:22 2017 +0200 +++ b/libgui/src/m-editor/octave-qscintilla.h Mon Oct 23 20:35:17 2017 -0400 @@ -53,7 +53,7 @@ void context_run (void); void get_global_textcursor_pos (QPoint *global_pos, QPoint *local_pos); bool get_actual_word (void); - void clear_indicator (int indicator_style); + void clear_indicator (int indicator_style, int marker_style); void get_current_position (int *pos, int *line, int *col); QString comment_string (void); int get_style (int pos = -1);