Merge pull request #185 from lloeki/eh-1.19
Support Promise response in trySave
This commit is contained in:
commit
5301f4a5d4
1 changed files with 8 additions and 3 deletions
|
|
@ -17,7 +17,12 @@ trySave = (func) ->
|
|||
deferred = defer()
|
||||
|
||||
try
|
||||
func()
|
||||
response = func()
|
||||
|
||||
if response instanceof Promise
|
||||
response.then ->
|
||||
deferred.resolve()
|
||||
else
|
||||
deferred.resolve()
|
||||
catch error
|
||||
if error.message.endsWith('is a directory')
|
||||
|
|
@ -252,7 +257,7 @@ class Ex
|
|||
@write(args)
|
||||
|
||||
wq: (args) =>
|
||||
@write(args).then => @quit()
|
||||
@write(args).then(=> @quit())
|
||||
|
||||
wa: =>
|
||||
@wall()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue