# HG changeset patch # User Carlo de Falco # Date 1332277122 -3600 # Node ID ceb77e004f9ce6e4412a28d6c29b91da16d63540 # Parent 05b59be209ed5f2076040c53416d62e90a137e52 Fix editing file that shadows existing function * script/miscellaneous/edit.m: fix pasting code of existing function into new file. diff -r 05b59be209ed -r ceb77e004f9c scripts/miscellaneous/edit.m --- a/scripts/miscellaneous/edit.m Fri Mar 16 17:50:42 2012 -0700 +++ b/scripts/miscellaneous/edit.m Tue Mar 20 21:58:42 2012 +0100 @@ -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