Mercurial > octave
changeset 24166:37190507b5d7
fix issues in editor auto closing feature (bug #52235)
* octave-qscintilla.cc (smart_indent): do indent but no auto close after a
unwind_protect_cleanup, add parfor and methods for smart indent and
auto closing
author | Torsten <mttl@mailbox.org> |
---|---|
date | Sun, 22 Oct 2017 20:32:22 +0200 |
parents | d0cee5e09879 |
children | 7a048619fda9 |
files | libgui/src/m-editor/octave-qscintilla.cc |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/octave-qscintilla.cc Fri Oct 20 18:56:29 2017 +0200 +++ b/libgui/src/m-editor/octave-qscintilla.cc Sun Oct 22 20:32:22 2017 +0200 @@ -450,7 +450,8 @@ QRegExp bkey = QRegExp ("^[\t ]*(if|for|while|switch|case|otherwise" "|do|function|properties|events|classdef" - "|unwind_protect|unwind_protect_cleanup|try)" + "|unwind_protect|unwind_protect_cleanup|try" + "|parfor|methods)" "[\r]?[\n\t #%]"); // last word except for comments, assuming no ' or " in comment. // rx_end = QRegExp ("(\\w+)[ \t;\r\n]*([%#][^\"']*)?$"); @@ -482,7 +483,8 @@ if (do_auto_close && ! inline_end - && ! first_word.contains (QRegExp ("(case|otherwise)"))) + && ! first_word.contains ( + QRegExp ("(case|otherwise|unwind_protect_cleanup)"))) { // Do auto close auto_close (do_auto_close, line, prevline, first_word);