diff libgui/src/m-editor/octave-qscintilla.cc @ 27455:e92bab9a7f26 stable

fix editors search and replace in selection (bug #56405) * file-editor-tab.cc (handle_double_click): update call to changed method octave_qscintilla::show_selection_markers * find-dialog.cc (find_dialog): parent is class octave_qscintilla, initialize the new class variables for searching in the selection; (handle_selection_changed): only disable selection checkbox if no text is selected, but leave check state as it is, remove the conditial compilation based on HAVE_QSCI_FINDSELECTION; (find): remove consitional compilation, initialize line and column for the search start also for selected text, remember start and end of a possible selection, remove workaround for wrong selection length update, only use finFirst also for the case with selection, check if search hit lies within the selection if necessary and stop search if required, update slection marker for showing the current selected area, remove this marker and restore real selection if no more occurrance of search text was found; (do_replace): update the length of the selection when replacing text; (replace): remove workaround for buggy selection length update * find-dialog.h: include octave_qscintilla, parent and _edit_area are of type octave_qscintilla, new class variable for storing and handling search in selection as well as selection begin and end * octave-qscintilla.cc (show_selection_markers): paraemters are now start line and column as wells as end line and column * octave-qscintilla.h: new parameters for show_selection_markers
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 01 Jun 2019 19:30:56 +0200
parents 48ddf51a6ef7
children 15752c577f6d 2310164737b3
line wrap: on
line diff
--- a/libgui/src/m-editor/octave-qscintilla.cc	Mon Sep 23 13:15:22 2019 -0700
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Sat Jun 01 19:30:56 2019 +0200
@@ -726,11 +726,12 @@
       }
   }
 
-  void octave_qscintilla::show_selection_markers (int line, int col, int len)
+  void octave_qscintilla::show_selection_markers (int l1, int c1, int l2, int c2)
   {
-    fillIndicatorRange (line, col - len, line, col, m_indicator_id);
+    fillIndicatorRange (l1, c1, l2, c2, m_indicator_id);
 
-    markerAdd (line, marker::selection);
+    if (l1 == l2)
+      markerAdd (l1, marker::selection);
   }
 
   void octave_qscintilla::contextmenu_help (bool)