Mercurial > octave
changeset 26624:7994f91cbdb8
Provide correct guess at filename when saving classdef file from GUI (bug #55497).
* file-editor-tab.cc (file_editor_tab::get_function_name):
Add regular expression to search for "classdef NAME".
author | Rik <rik@octave.org> |
---|---|
date | Thu, 24 Jan 2019 12:36:06 -0800 |
parents | 708d2db72e1c |
children | 6a6a6ede86d3 |
files | libgui/src/m-editor/file-editor-tab.cc |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc Thu Jan 24 12:28:33 2019 -0800 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Jan 24 12:36:06 2019 -0800 @@ -3101,6 +3101,7 @@ QRegExp rxfun2 ("^[\t ]*function[\t ]+([^\\(]+)\\([^\\)]*\\)[\t ]*$"); QRegExp rxfun3 ("^[\t ]*function[^=]+=[\t ]*([^\\s]+)[\t ]*$"); QRegExp rxfun4 ("^[\t ]*function[\t ]+([^\\s]+)[\t ]*$"); + QRegExp rxfun5 ("^[\t ]*classdef[\t ]+([^\\s]+)[\t ]*$"); QStringList lines = _edit_area->text ().split ("\n"); @@ -3114,6 +3115,8 @@ return rxfun3.cap (1).remove (QRegExp ("[ \t]*")); else if (rxfun4.indexIn (lines.at (i)) != -1) return rxfun4.cap (1).remove (QRegExp ("[ \t]*")); + else if (rxfun5.indexIn (lines.at (i)) != -1) + return rxfun5.cap (1).remove (QRegExp ("[ \t]*")); } return QString ();