changeset 28301:b8a38ed00bf4

maint: merge stable to default.
author Rik <rik@octave.org>
date Sat, 16 May 2020 13:36:48 -0700
parents 0c6dcf803529 (current diff) 1127bcb30e61 (diff)
children 1f5ec8c025bc
files libgui/src/m-editor/file-editor-tab.cc
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Sat May 16 13:32:24 2020 -0700
+++ b/libgui/src/m-editor/file-editor-tab.cc	Sat May 16 13:36:48 2020 -0700
@@ -3188,8 +3188,9 @@
               {
                 // word is not empty, so find all occurrences of the word
 
-                // remember first visible line for restoring the view afterwards
+                // remember first visible line and x-offset for restoring the view afterwards
                 int first_line = m_edit_area->firstVisibleLine ();
+                int x_offset = m_edit_area->SendScintilla (QsciScintillaBase::SCI_GETXOFFSET);
 
                 // search for first occurrence of the detected word
                 bool find_result_available
@@ -3224,6 +3225,7 @@
                 // restore the visible area of the file, the cursor position,
                 // and the selection
                 m_edit_area->setFirstVisibleLine (first_line);
+                m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETXOFFSET, x_offset);
                 m_edit_area->setCursorPosition (line, col);
                 m_edit_area->setSelection (line, col - wlen, line, col);
                 m_edit_area->set_word_selection (word);
--- a/test/bug-50831/bug-50831.tst	Sat May 16 13:32:24 2020 -0700
+++ b/test/bug-50831/bug-50831.tst	Sat May 16 13:36:48 2020 -0700
@@ -1,5 +1,5 @@
 %!test
-%! filename = "save-text.var";
+%! filename = tempname ();
 %! s.("a-b") = "bad fieldname";
 %! unwind_protect
 %!   save ("-text", filename, "s");