File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ function M.built_in.stop_app()
3838 async (function ()
3939 M .runner :stop_run ()
4040 end )
41- .catch (get_error_handler (' Failed to switch run' ))
41+ .catch (get_error_handler (' Failed to stop run' ))
4242 .run ()
4343end
4444
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ local notify = require('java-core.utils.notify')
66--- @field main_class string
77--- @field buffer number
88--- @field is_running boolean
9+ --- @field is_manually_stoped boolean
910--- @field private cmd string
1011--- @field private term_chan_id number
1112--- @field private job_chan_id number | nil
@@ -46,6 +47,7 @@ function Run:stop()
4647 return
4748 end
4849
50+ self .is_manually_stoped = true
4951 vim .fn .jobstop (self .job_chan_id )
5052 vim .fn .jobwait ({ self .job_chan_id }, 1000 )
5153 self .job_chan_id = nil
@@ -77,8 +79,9 @@ function Run:on_job_exit(exit_code)
7779
7880 self .is_running = false
7981
80- if exit_code == 0 then
82+ if exit_code == 0 or self . is_manually_stoped then
8183 self .is_failure = false
84+ self .is_manually_stoped = false
8285 else
8386 self .is_failure = true
8487 notify .error (string.format (' %s %s' , self .name , message ))
You can’t perform that action at this time.
0 commit comments