changeset 24593:7a0cf02ed6d5

fix highlighting/replacing all occurrences after double-click (bug #52859) * octave-qscintilla.cc (set_word_selection, show_replace_action_tooltip, keyPressEvent): use get_current_position instead of getCursorPosition taking tabs into account;
author Torsten <mttl@mailbox.org>
date Sun, 14 Jan 2018 18:51:21 +0100
parents 6c3b7ca0cb90
children a81af57f6144
files libgui/src/m-editor/octave-qscintilla.cc
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/octave-qscintilla.cc	Sat Jan 13 10:27:11 2018 -0800
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Sun Jan 14 18:51:21 2018 +0100
@@ -666,7 +666,10 @@
       QToolTip::hideText ();
     }
   else
-    getCursorPosition (&m_selection_line, &m_selection_col);
+    {
+      int pos;
+      get_current_position (&pos, &m_selection_line, &m_selection_col);
+    }
 }
 
 void
@@ -767,7 +770,8 @@
 void
 octave_qscintilla::show_replace_action_tooltip (void)
 {
-  getCursorPosition (&m_selection_line, &m_selection_col);
+  int pos;
+  get_current_position (&pos, &m_selection_line, &m_selection_col);
 
   // Offer to replace other instances.
 
@@ -807,8 +811,8 @@
         {
           // get the resulting cursor position
           // (required if click was beyond a line ending)
-          int line, col;
-          getCursorPosition (&line, &col);
+          int pos, line, col;
+          get_current_position (&pos, &line, &col);
 
           // remember first visible line for restoring the view afterwards
           int first_line = firstVisibleLine ();
@@ -837,7 +841,7 @@
               // different from the original.
 
               int new_line, new_col;
-              getCursorPosition (&new_line, &new_col);
+              get_current_position (&pos, &new_line, &new_col);
 
               find_result_available
                 = findFirst (m_selection,