Hello community,

here is the log from the commit of package octave for openSUSE:Factory checked 
in at 2019-07-08 15:10:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/octave (Old)
 and      /work/SRC/openSUSE:Factory/.octave.new.4615 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "octave"

Mon Jul  8 15:10:56 2019 rev:63 rq:713696 version:5.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/octave/octave.changes    2019-06-06 
18:15:35.628716398 +0200
+++ /work/SRC/openSUSE:Factory/.octave.new.4615/octave.changes  2019-07-08 
15:10:56.919340691 +0200
@@ -1,0 +2,8 @@
+Fri Jul 05 12:14:16 2019 UTC - Markus Ebner <hiwatari.se...@gmail.com>
+
+- Backport fix: Cursor misplaced when entering newline in editor with tabs 
indentation
+  behavior (bug #56533)
+  * Added 
octave-bug-56533-Cursor_misplaced_when_entering_newline_in_editor_with_tabs_indentation-part1.patch
+  * Added 
octave-bug-56533-Cursor_misplaced_when_entering_newline_in_editor_with_tabs_indentation-part2.patch
+
+-------------------------------------------------------------------

New:
----
  
octave-bug-56533-Cursor_misplaced_when_entering_newline_in_editor_with_tabs_indentation-part1.patch
  
octave-bug-56533-Cursor_misplaced_when_entering_newline_in_editor_with_tabs_indentation-part2.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ octave.spec ++++++
--- /var/tmp/diff_new_pack.S9UZ3V/_old  2019-07-08 15:10:58.407342119 +0200
+++ /var/tmp/diff_new_pack.S9UZ3V/_new  2019-07-08 15:10:58.411342123 +0200
@@ -86,6 +86,8 @@
 Patch0:         octave_tools_pie.patch
 # PATCH-FIX-UPSTREAM
 Patch1:         octave-bug-55029-fix_pause_and_kbhit_with_glibc_2_28.patch
+Patch2:         
octave-bug-56533-Cursor_misplaced_when_entering_newline_in_editor_with_tabs_indentation-part1.patch
+Patch3:         
octave-bug-56533-Cursor_misplaced_when_entering_newline_in_editor_with_tabs_indentation-part2.patch
 BuildRequires:  arpack-ng-devel
 # Required for Patch0
 BuildRequires:  autoconf
@@ -247,6 +249,8 @@
 # autoconf in Leap 42.x is to old, so we just build without -pie there
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 %endif
 
 # define octave_blas macros


++++++ 
octave-bug-56533-Cursor_misplaced_when_entering_newline_in_editor_with_tabs_indentation-part1.patch
 ++++++

# HG changeset patch
# User Torsten Lilge <ttl-oct...@mailbox.org>
# Date 1561493414 -7200
# Node ID dffdabfd02138fd21c0d1e56d639c56b6c9c3fba
# Parent  b8c0d5ad024f993929bac9a1f212b47ba06d731f
fix cursor position for editor smart indent after keyword (bug #56533)

* file-editor-tab.cc (notice_settings): initialize new class variable
  holding the width of the character used for indentation;
  (handle_cursor_moved): pass new class variable to smart_indent

* file-editor-tab.h: new class variable for indentation character width

* octave-qscintilla.cc (smart_indent): length of indentation character is
  a new parameter which is used for setting the cursor position at the
  end of the indentation of a new line

* octave-qscintilla.cc (smart_indent): new parameter

diff --git a/libgui/src/m-editor/file-editor-tab.cc 
b/libgui/src/m-editor/file-editor-tab.cc
--- a/libgui/src/m-editor/file-editor-tab.cc
+++ b/libgui/src/m-editor/file-editor-tab.cc
@@ -2691,6 +2691,10 @@
     _edit_area->setTabWidth
       (settings->value ("editor/tab_width",2).toInt ());
 
+    m_ind_char_width = 1;
+    if (_edit_area->indentationsUseTabs ())
+      m_ind_char_width = _edit_area->tabWidth ();
+
     _edit_area->SendScintilla (QsciScintillaBase::SCI_SETHSCROLLBAR,
                                settings->value 
("editor/show_hscroll_bar",true).toBool ());
     _edit_area->SendScintilla (QsciScintillaBase::SCI_SETSCROLLWIDTH,-1);
@@ -3040,7 +3044,8 @@
           {
             // Obviously, we have a newline here
             if (_smart_indent || _auto_endif)
-              _edit_area->smart_indent (_smart_indent, _auto_endif, _line);
+              _edit_area->smart_indent (_smart_indent, _auto_endif,
+                                        _line, m_ind_char_width);
           }
       }
 
diff --git a/libgui/src/m-editor/file-editor-tab.h 
b/libgui/src/m-editor/file-editor-tab.h
--- a/libgui/src/m-editor/file-editor-tab.h
+++ b/libgui/src/m-editor/file-editor-tab.h
@@ -304,6 +304,7 @@
     bool _always_reload_changed_files;
     bool _smart_indent;
     int _auto_endif;
+    int m_ind_char_width;
 
     QFileSystemWatcher _file_system_watcher;
 
diff --git a/libgui/src/m-editor/octave-qscintilla.cc 
b/libgui/src/m-editor/octave-qscintilla.cc
--- a/libgui/src/m-editor/octave-qscintilla.cc
+++ b/libgui/src/m-editor/octave-qscintilla.cc
@@ -499,8 +499,8 @@
   }
 
   // Do smart indendation after if, for, ...
-  void octave_qscintilla::smart_indent (bool do_smart_indent,
-                                        int do_auto_close, int line)
+  void octave_qscintilla::smart_indent (bool do_smart_indent, int 
do_auto_close,
+                                        int line, int ind_char_width)
   {
     QString prevline = text (line);
 
@@ -534,7 +534,7 @@
           {
             // Do smart indent in the current line (line+1)
             indent (line+1);
-            setCursorPosition (line+1, indentation (line) + indentationWidth 
());
+            setCursorPosition (line+1, indentation (line+1) / ind_char_width);
           }
 
         if (do_auto_close
diff --git a/libgui/src/m-editor/octave-qscintilla.h 
b/libgui/src/m-editor/octave-qscintilla.h
--- a/libgui/src/m-editor/octave-qscintilla.h
+++ b/libgui/src/m-editor/octave-qscintilla.h
@@ -63,7 +63,8 @@
     QStringList comment_string (bool comment = true);
     int get_style (int pos = -1);
     int is_style_comment (int pos = -1);
-    void smart_indent (bool do_smart_indent, int do_auto_close, int line);
+    void smart_indent (bool do_smart_indent, int do_auto_close,
+                       int line, int ind_char_width);
 
     void smart_indent_line_or_selected_text (int lineFrom, int lineTo);
 

++++++ 
octave-bug-56533-Cursor_misplaced_when_entering_newline_in_editor_with_tabs_indentation-part2.patch
 ++++++

# HG changeset patch
# User Torsten Lilge <ttl-oct...@mailbox.org>
# Date 1562267649 -7200
# Node ID 1ae91e5d70cc1fe849945b6aba6da727b8768ff5
# Parent  f5b9670604425f6bfda76c7a8e61798559f0e609
fix auto-close feature in editor when using tabs for indentation (bug #56533)

* octave-qscintilla.cc (auto_close): do not consider new inserted line for
  detecting a required closing sstatement since this line has indentation
  indicating that there already is a close satement, us indentation method
  instead of adding spaces for indenting the line with the close statement

diff --git a/libgui/src/m-editor/octave-qscintilla.cc 
b/libgui/src/m-editor/octave-qscintilla.cc
index a2a97ea..dc407f7 100644
--- a/libgui/src/m-editor/octave-qscintilla.cc
+++ b/libgui/src/m-editor/octave-qscintilla.cc
@@ -965,7 +965,8 @@ namespace octave
     //       end* (until) (catch)
     if (linenr < lines () - 1)
       {
-        int offset = 1;
+        int offset = 2;     // linenr is the old line, thus, linnr+1 is the
+                            // new one and can not be taken into account
         size_t next_start;
         QString next_line;
         do                            // find next non-blank line
@@ -1022,7 +1023,9 @@ namespace octave
         next_line = "end" + first_word + "\n";
       }
 
-    insertAt (QString (start, ' ') + next_line, linenr + 2, 0);
+    //insertAt (QString (start, ' ') + next_line, linenr + 2, 0);
+    insertAt (next_line, linenr + 2, 0);
+    setIndentation (linenr + 2, indentation (linenr));
   }
 
   void octave_qscintilla::dragEnterEvent (QDragEnterEvent *e)

Reply via email to