changeset 14482:ceb77e004f9c

Fix editing file that shadows existing function * script/miscellaneous/edit.m: fix pasting code of existing function into new file.
author Carlo de Falco <kingcrimson@tiscali.it>
date Tue, 20 Mar 2012 21:58:42 +0100
parents 05b59be209ed
children 6a736395ff7d
files scripts/miscellaneous/edit.m
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/edit.m
+++ b/scripts/miscellaneous/edit.m
@@ -421,7 +421,7 @@
       endif
       ## If we are shadowing an m-file, paste the code for the m-file.
       if (any (exists == [2, 103]))
-        code = cstrcat ("\\ ", strrep (type (name), "\n", "\n// "));
+        code = cstrcat ("\\ ", strrep (type (name){1}, "\n", "\n// "));
       else
         code = " ";
       endif
@@ -437,7 +437,7 @@
       ## If we are editing a function defined on the fly, paste the
       ## code.
       if (any (exists == [2, 103]))
-        body = type (name);
+        body = type (name){1};
       else
         body = cstrcat ("function [ ret ] = ", name, " ()\n\nendfunction\n");
       endif