@@ -24,16 +24,16 @@ define([
2424 * @param {boolean } exec true(default) / false
2525 * @param {int } sigNum
2626 */
27- var insertCell = function ( type , command , exec = true , sigNum = - 1 ) {
27+ var insertCell = function ( type , command , exec = true , sigText = '' ) {
2828 var selectedIndex = getSelectedCell ( ) ;
2929 var targetCell = Jupyter . notebook . insert_cell_below ( type , selectedIndex ) ;
3030
3131 // Add signature
3232 if ( type == 'code' ) {
33- if ( sigNum >= 0 ) {
34- command = com_util . formatString ( '# VisualPython [ {0}] \n' , sigNum ) + command ;
33+ if ( sigText !== '' ) {
34+ command = com_util . formatString ( '# Visual Python: {0}\n' , sigText ) + command ;
3535 } else {
36- command = '# VisualPython \n' + command ;
36+ command = '# Visual Python \n' + command ;
3737 }
3838 }
3939 targetCell . set_text ( command ) ;
@@ -61,14 +61,18 @@ define([
6161 * @param {boolean } exec
6262 * @param {int } sigNum
6363 */
64- var insertCells = function ( type , commands , exec = true , sigNum = - 1 ) {
64+ var insertCells = function ( type , commands , exec = true , sigText = '' ) {
6565 var selectedIndex = getSelectedCell ( ) ;
6666 var targetCell = Jupyter . notebook . insert_cell_below ( type , selectedIndex ) ;
6767
6868 commands && commands . forEach ( ( command , idx ) => {
6969 // Add signature
70- if ( type == 'code' && sigNum >= 0 ) {
71- command = com_util . formatString ( '# VisualPython [{0}] - {1}\n' , sigNum , idx + 1 ) + command
70+ if ( type == 'code' ) {
71+ if ( sigText !== '' ) {
72+ command = com_util . formatString ( '# Visual Python: {0}\n' , sigText ) + command ;
73+ } else {
74+ command = com_util . formatString ( '# Visual Python' ) + command ;
75+ }
7276 }
7377 targetCell . set_text ( command ) ;
7478 Jupyter . notebook . select_next ( ) ;
0 commit comments