Mercurial > octave
changeset 23736:be85302417d6 stable
Add possible '\r' to smartindent regex exprepression (Bug #51279)
* libgui/src/m-editor/file-editor-tab.cc
(file_editor_tab::do_smart_indent): add [\r]? to bkey, mkey, ekey regex.
author | John D |
---|---|
date | Thu, 06 Jul 2017 09:15:08 -0400 |
parents | 0056bcaeb01c |
children | 884e18e82e8f efba56b2406f |
files | libgui/src/m-editor/file-editor-tab.cc |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc Wed Jul 05 16:27:39 2017 -0400 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Jul 06 09:15:08 2017 -0400 @@ -2636,7 +2636,7 @@ QRegExp bkey = QRegExp ("^[\t ]*(if|for|while|switch|case|do|function" "|unwind_protect|unwind_protect_cleanup|try)" - "[\n\t #%]"); + "[\r]?[\n\t #%]"); if (prev_line.contains (bkey)) { _edit_area->indent (_line+1); @@ -2646,7 +2646,7 @@ return; } - QRegExp mkey = QRegExp ("^[\t ]*(else|elseif|catch)[\t #%\n]"); + QRegExp mkey = QRegExp ("^[\t ]*(else|elseif|catch)[\r]?[\t #%\n]"); if (prev_line.contains (mkey)) { int prev_ind = _edit_area->indentation (_line-1); @@ -2663,7 +2663,7 @@ } QRegExp ekey = QRegExp ("^[\t ]*(end|endif|endfor|endwhile|until|endfunction" - "|end_try_catch|end_unwind_protext)[\t #%\n(;]"); + "|end_try_catch|end_unwind_protext)[\r]?[\t #%\n(;]"); if (prev_line.contains (ekey)) { if (_edit_area->indentation (_line-1) <= _edit_area->indentation (_line))