diff libgui/src/m-editor/file-editor-tab.cc @ 27914:a044e50c8dcb

Streamline QRegExp instances in libgu. * file-editor-tab.cc (do_comment_selected_text): Use non-capturing grouping. * octave-qscintilla.cc (smart_indent): Use non-capturing grouping for ekey, mkey, case_key, and stand-alone QRegExp. * octave-qscintilla.cc (smart_indent_line_or_selected_text): Use non-capturing grouping for end_word_regexp, begin_block_regexp, mid_block_regexp, end_block_regexp, case_block_regexp. * qt-interpreter-events.cc (make_filter_list): Use C++ Raw string to define QRegExp with lots of backslashes. * variable-editor.cc (variable_editor_stack::levulUp): Rewrite QRegExp to use character classes to get rid of excessive backslashes.
author Rik <rik@octave.org>
date Mon, 06 Jan 2020 10:18:00 -0800
parents 465ac679e976
children b442ec6dda5c
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Sat Jan 04 17:16:59 2020 -0800
+++ b/libgui/src/m-editor/file-editor-tab.cc	Mon Jan 06 10:18:00 2020 -0800
@@ -1526,7 +1526,7 @@
   void file_editor_tab::do_comment_selected_text (bool comment, bool input_str)
   {
     QRegExp rxc;
-    QString ws = "^([ \\t]*)";
+    QString ws = "^(?:[ \\t]*)";
     QStringList comment_str = m_edit_area->comment_string (comment);
     QString used_comment_str = comment_str.at (0);