comparison libgui/src/variable-editor.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
comparison
equal deleted inserted replaced
27913:8df92c17bb5c 27914:a044e50c8dcb
444 444
445 // FIXME: Is there a better way? 445 // FIXME: Is there a better way?
446 446
447 if (name.endsWith (')') || name.endsWith ('}')) 447 if (name.endsWith (')') || name.endsWith ('}'))
448 { 448 {
449 name.remove (QRegExp ("(\\(|\\{)[^({]*(\\)|\\})$")); 449 name.remove ( QRegExp ("[({][^({]*[)}]$)") );
450 emit edit_variable_signal (name, octave_value ()); 450 emit edit_variable_signal (name, octave_value ());
451 } 451 }
452 } 452 }
453 453
454 void 454 void