# HG changeset patch # User Carlo de Falco # Date 1332269022 -3600 # Node ID 3cb9611e2cd1f6333aba3c8d98515cd24e4052ac # 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 3cb9611e2cd1 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 19:43: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