changeset 26483:10f648516d5b

maint: Merge stable to default.
author John W. Eaton <jwe@octave.org>
date Mon, 07 Jan 2019 13:27:20 -0500
parents 11cef718fcbc (current diff) 7647b82f921b (diff)
children 10919e3c9aaa
files libinterp/corefcn/graphics.cc
diffstat 3 files changed, 25 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/octave-qscintilla.cc	Mon Jan 07 08:08:47 2019 -0500
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Mon Jan 07 13:27:20 2019 -0500
@@ -506,7 +506,7 @@
 
     QRegExp bkey = QRegExp ("^[\t ]*(if|for|while|switch|case|otherwise"
                             "|do|function|properties|events|classdef"
-                            "|unwind_protect|unwind_protect_cleanup|try"
+                            "|unwind_protect|try"
                             "|parfor|methods)"
                             "[\r]?[\n\t #%]");
     // last word except for comments, assuming no ' or " in comment.
@@ -549,7 +549,8 @@
         return;
       }
 
-    QRegExp mkey = QRegExp ("^[\t ]*(else|elseif|catch)[\r]?[\t #%\n]");
+    QRegExp mkey = QRegExp ("^[\t ]*(else|elseif|catch|unwind_protect_cleanup"
+                            "|case|otherwise)[\r]?[\t #%\n]");
     if (prevline.contains (mkey))
       {
         int prev_ind = indentation (line-1);
@@ -566,7 +567,7 @@
       }
 
     ekey = QRegExp ("^[\t ]*(end|endif|endfor|endwhile|until|endfunction"
-                    "|end_try_catch|end_unwind_protext)[\r]?[\t #%\n(;]");
+                    "|end_try_catch|end_unwind_protect)[\r]?[\t #%\n(;]");
     if (prevline.contains (ekey))
       {
         if (indentation (line-1) <= indentation (line))
@@ -595,6 +596,12 @@
                  "|unwind_protect|unwind_protect_cleanup|try|catch)"
                  "[\r\n\t #%]");
 
+    QRegExp mid_block_regexp
+      = QRegExp ("^([\t ]*)(elseif|else"
+                 "|otherwise"
+                 "|unwind_protect_cleanup|catch)"
+                 "[\r\n\t #%]");
+
     QRegExp end_block_regexp
       = QRegExp ("^([\t ]*)(end"
                  "|end(for|function|if|parfor|switch|while"
@@ -636,6 +643,9 @@
         if (end_block_regexp.indexIn (line_text) > -1)
           indent_column -= indent_increment;
 
+        if (mid_block_regexp.indexIn (line_text) > -1)
+            indent_column -= indent_increment;
+
         setIndentation (line, indent_column);
 
         if (begin_block_regexp.indexIn (line_text) > -1)
--- a/libinterp/corefcn/graphics.cc	Mon Jan 07 08:08:47 2019 -0500
+++ b/libinterp/corefcn/graphics.cc	Mon Jan 07 13:27:20 2019 -0500
@@ -10480,14 +10480,20 @@
 void
 uicontrol::properties::set_style (const octave_value& st)
 {
-  style = st;
-
-  // if we know know what we are, can override value for listbox and popupmenu
-  if (style_is ("listbox") || style_is ("popupmenu"))
+  // Don't notify the style change until the "value" property is fixed
+  bool modified = style.set (st, true, false);
+
+  // We now need to override "value" for listbox and popupmenu and eventually
+  // notify the toolkit afterwards.
+  if (modified && (style_is ("listbox") || style_is ("popupmenu")))
     {
       Matrix v = value.get ().matrix_value ();
-      if (v.numel () == 1 && v (0) == 0)
-        value.set (octave_value (1));
+      if (v.numel () == 1 && v(0) == 0)
+        value.set (octave_value (1), true, false);
+
+      graphics_object go = gh_manager::get_object (get___myhandle__ ());
+      if (go)
+        go.update (style.get_id ());
     }
 }
 
--- a/libinterp/parse-tree/lex.ll	Mon Jan 07 08:08:47 2019 -0500
+++ b/libinterp/parse-tree/lex.ll	Mon Jan 07 13:27:20 2019 -0500
@@ -389,9 +389,6 @@
 
     COMMAND_ARG_FINISH;
 
-    curr_lexer->m_input_line_number++;
-    curr_lexer->m_current_input_column = 1;
-
     HANDLE_STRING_CONTINUATION;
   }