File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ exports.remove = function(path) {
225225 } else {
226226 exec ( 'rm -rf -- ' + process . cwd ( ) + path , function ( err ) {
227227 if ( ! err ) {
228- // TODO: Implement removal from list cache
228+ // Invalidate file list cache
229229 listCache = undefined
230230 ee . emit ( 'success' )
231231 } else {
@@ -247,6 +247,8 @@ exports.rename = function(oldpath, newpath) {
247247 } else {
248248 fs . rename ( process . cwd ( ) + oldpath , process . cwd ( ) + newpath , function ( err ) {
249249 if ( ! err ) {
250+ // Invalidate file list cache
251+ listCache = undefined
250252 ee . emit ( 'success' )
251253 } else {
252254 ee . emit ( 'err' , err )
Original file line number Diff line number Diff line change @@ -212,6 +212,13 @@ var renameFile = function(oldpath, newpath) {
212212 socket . emit ( 'rename' , { oldpath : oldpath , newpath : newpath } )
213213}
214214
215+ socket . on ( 'rename-success' , function ( data ) {
216+ selectFile ( {
217+ type : 'file' ,
218+ path : data . path
219+ } , fileHtmlElementByPath ) ;
220+ } )
221+
215222var removeFile = function ( ) {
216223 socket . emit ( 'remove' , currentFile . path )
217224}
Original file line number Diff line number Diff line change @@ -116,8 +116,9 @@ exports.listen = function(port) {
116116 project . rename ( data . oldpath , data . newpath )
117117 . on ( 'success' , function ( file ) {
118118 project . list ( )
119- . on ( 'success' , function ( data ) {
120- socket . emit ( 'list' , data )
119+ . on ( 'success' , function ( list ) {
120+ socket . emit ( 'list' , list )
121+ socket . emit ( 'rename-success' , { path : data . newpath } )
121122 } )
122123 } )
123124 . on ( 'error' , function ( err ) {
You can’t perform that action at this time.
0 commit comments