@@ -7,18 +7,16 @@ local notify = require('java-core.utils.notify')
77--- @field buffer number
88--- @field is_running boolean
99--- @field is_manually_stoped boolean
10- --- @field private cmd string
1110--- @field private term_chan_id number
1211--- @field private job_chan_id number | nil
1312--- @field private is_failure boolean
1413local Run = class ()
1514
1615--- @param dap_config java-dap.DapLauncherConfig
1716--- @param cmd string[]
18- function Run :_init (dap_config , cmd )
17+ function Run :_init (dap_config )
1918 self .name = dap_config .name
2019 self .main_class = dap_config .mainClass
21- self .cmd = table.concat (cmd , ' ' )
2220 self .buffer = vim .api .nvim_create_buf (false , true )
2321 self .term_chan_id = vim .api .nvim_open_term (self .buffer , {
2422 on_input = function (_ , _ , _ , data )
@@ -27,11 +25,13 @@ function Run:_init(dap_config, cmd)
2725 })
2826end
2927
30- function Run :start ()
28+ --- @param cmd string[]
29+ function Run :start (cmd )
30+ local merged_cmd = table.concat (cmd , ' ' )
3131 self .is_running = true
32- self :send_term (self . cmd )
32+ self :send_term (merged_cmd )
3333
34- self .job_chan_id = vim .fn .jobstart (self . cmd , {
34+ self .job_chan_id = vim .fn .jobstart (merged_cmd , {
3535 pty = true ,
3636 on_stdout = function (_ , data )
3737 self :send_term (data )
0 commit comments