Mercurial > octave-nkf
view test/unwind.tst @ 18801:095fdef3d67c gui-release
use editors run selection action for the context menu
* file-editor-tab.cc (constructor): initialize flag for octave file;
(update_lexer): set flag for octave file;
(set_file_name, handle_copy_available, change_editor_state):
editor_state_changed signal uses flag for octave file;
* file-editor-tab.h: flag for octave file, also used in editor_state_changed
* file-editor.cc (create_context_menu): add action for running selection;
(handle_editor_state_changed): gets flag whether file is an octave script,
enable run action and run selection action depending on selection and file
type;
(add_file_editor_tab): connect editor_state_changed to
handle_editor_state_changedwith new third parameter;
* file-editor.h: handle_editor_state_changed has a new third parameter
* octave-qscintilla.cc (contextMenuEvent): run selection is added by the edtior
author | Torsten <ttl@justmail.de> |
---|---|
date | Fri, 16 May 2014 20:01:27 +0200 |
parents | d63878346099 |
children | 4197fc428c7d |
line wrap: on
line source
## Copyright (C) 2006-2013 John W. Eaton ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or (at ## your option) any later version. ## ## Octave is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. %!function y = f (x) %! global g; %! save_g = g; %! unwind_protect %! g = 0; %! y = g; %! [1,2;x]; %! g = 1; %! y = [y, g]; %! unwind_protect_cleanup %! g = save_g; %! y = [y, g]; %! end # "end" is part of test, check not using "end_unwind_protect" %!endfunction %! %!test %! global g = -1; %! y = f ([3,4]); %! assert (y, [0,1,-1]); %!function y = f (x) %! global g; %! save_g = g; %! unwind_protect %! g = 0; %! y = g; %! [1,2;x]; %! g = 1; %! y = [y, g]; %! unwind_protect_cleanup %! g = save_g; %! y = [y, g]; %! assert (y, [0,-1]); %! end_unwind_protect %!endfunction %! %!test %! global g = -1; %! fail ("y = f (3);", "mismatch");