File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,35 @@ const TabGroup = Module("tabGroup", {
347
347
literal : 0 ,
348
348
completer : function ( context ) completion . tabgroup ( context , false ) ,
349
349
} ) ,
350
+ /**
351
+ * Panorama SubCommand rename
352
+ * rename {name}.
353
+ * clear the name of the current group if bang(!) specified and {name} is ommited.
354
+ */
355
+ new Command ( [ "rename" , "mv" ] , "Rename current tab group (or reset to '(Untitled)')." ,
356
+ function ( args ) {
357
+ let title = args . literalArg ;
358
+ if ( ! title ) {
359
+ if ( args . bang )
360
+ title = "" ;
361
+ else {
362
+ liberator . echoerr ( "No title supplied! Add \"!\" if want to clear it." ) ;
363
+ return ;
364
+ }
365
+ }
366
+ let activeGroup = tabGroup . tabView . GroupItems . getActiveGroupItem ( ) ;
367
+ if ( activeGroup )
368
+ activeGroup . setTitle ( title ) ;
369
+ } , {
370
+ bang : true ,
371
+ literal : 0 ,
372
+ completer : function ( context ) {
373
+ context . title = [ "Rename current group" ] ;
374
+ let activeGroup = tabGroup . tabView . GroupItems . getActiveGroupItem ( ) ;
375
+ let title = activeGroup ? activeGroup . getTitle ( ) : "" ;
376
+ context . completions = title ? [ [ title , "" ] ] : [ ] ;
377
+ }
378
+ } ) ,
350
379
/**
351
380
* Panorama SubCommand switch
352
381
* switch to the {group}.
Original file line number Diff line number Diff line change 123
123
</description >
124
124
</item >
125
125
126
+ <item >
127
+ <tags >tabgroups-rename tabgroups-mv</tags >
128
+ <spec >rename<oa >!</oa > <oa >newGroupName</oa ></spec >
129
+ <spec >mv<oa >!</oa > <oa >newGroupName</oa ></spec >
130
+ <description >
131
+ <p >
132
+ Rename current tab group to <oa >newGroupName</oa >.
133
+ </p >
134
+ <p >
135
+ If <oa >newGroupName</oa > is not supplied and <oa >!</oa > is
136
+ specified, resets group's name to <o >(Untitled)</o >.
137
+ </p >
138
+ </description >
139
+ </item >
140
+
126
141
<item >
127
142
<tags >tabgroups-switch</tags >
128
143
<spec ><oa >count</oa >switch <a >groupName</a ></spec >
You can’t perform that action at this time.
0 commit comments