@@ -4,7 +4,7 @@ local log = require "remote-sshfs.log"
44
55local M = {}
66
7- M .sshfs_wrapper = function (data , mount_dir , callback )
7+ M .sshfs_wrapper = function (data , host , mount_dir , callback )
88 local output = table.concat (data , " \n " )
99 log .line (" sshfs" , output )
1010 if output == " " or string.match (output , " read:" ) then
@@ -13,7 +13,7 @@ M.sshfs_wrapper = function(data, mount_dir, callback)
1313 if string.match (output , " ssh_askpass" ) then
1414 M .askpass_handler (callback )
1515 elseif string.match (output , " Authenticated" ) then
16- M .authenticated_handler (mount_dir )
16+ M .authenticated_handler (host , mount_dir )
1717 else
1818 vim .notify (" Connection failed: " .. string.gsub (tostring (output ), " \r\n " , " " ))
1919 end
@@ -33,7 +33,7 @@ M.askpass_handler = function(callback)
3333 callback " ask_pass"
3434end
3535
36- M .authenticated_handler = function (mount_dir )
36+ M .authenticated_handler = function (host , mount_dir )
3737 vim .notify " Connected to host succesfully."
3838
3939 if M .change_dir then
@@ -49,6 +49,8 @@ M.authenticated_handler = function(mount_dir)
4949 utils .change_directory (mount_dir )
5050 end
5151 end
52+
53+ require (" remote-sshfs" ).callback .on_connect_success :trigger (host , mount_dir )
5254end
5355
5456M .setup = function (opts )
0 commit comments