diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d755cf..2d170de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.6.1](https://github.com/nvim-java/nvim-java/compare/v1.6.0...v1.6.1) (2024-06-27) + + +### Bug Fixes + +* when the same main class is ran again, first process is not stopped ([1fae8de](https://github.com/nvim-java/nvim-java/commit/1fae8de1327167ac4b9f744970b2b6b7c7652874)) + ## [1.6.0](https://github.com/nvim-java/nvim-java/compare/v1.5.1...v1.6.0) (2024-06-25) diff --git a/doc/nvim-java.txt b/doc/nvim-java.txt index c740642..d0d6a4c 100644 --- a/doc/nvim-java.txt +++ b/doc/nvim-java.txt @@ -1,4 +1,4 @@ -*nvim-java.txt* For Neovim >= 0.9.4 Last change: 2024 May 04 +*nvim-java.txt* For Neovim >= 0.9.4 Last change: 2024 June 25 ============================================================================== Table of Contents *nvim-java-table-of-contents* @@ -24,6 +24,9 @@ Table of Contents *nvim-java-table-of-contents* Just install and start writing `public static void main(String[] args)`. + [!WARNING] You cannot use `nvim-java` alongside `nvim-jdtls`. So remove + `nvim-jdtls` before installing this + DEMO *nvim-java-demo* @@ -36,6 +39,7 @@ FEATURES *nvim-java-features* - Automatic DAP debug configuration - Running tests +- Run & Debug profiles WHY *nvim-java-why* @@ -55,6 +59,12 @@ HOW TO INSTALL *nvim-java-how-to-install* :small_orange_diamond:details ~ +Q & A ~ + +If you face any issues, check our Q & A + wiki to see if that helps + + DISTRIBUTIONS ~ - Lazyvim diff --git a/lua/java/runner/run.lua b/lua/java/runner/run.lua index 4e677f6..cb5ab35 100644 --- a/lua/java/runner/run.lua +++ b/lua/java/runner/run.lua @@ -5,10 +5,10 @@ local notify = require('java-core.utils.notify') ---@field name string ---@field main_class string ---@field buffer number +---@field is_running boolean ---@field private cmd string ---@field private term_chan_id number ---@field private job_chan_id number | nil ----@field private is_running boolean ---@field private is_failure boolean local Run = class() diff --git a/lua/java/runner/runner.lua b/lua/java/runner/runner.lua index 3f7c2f3..6b0ddc4 100644 --- a/lua/java/runner/runner.lua +++ b/lua/java/runner/runner.lua @@ -26,11 +26,13 @@ function Runner:start_run(args) return end - local run ---@as java.Run + local run = self.runs[dap_config.mainClass] -- get the default run if exist or create new run - if self.runs[dap_config.mainClass] then - run = self.runs[dap_config.mainClass] + if run then + if run.is_running then + run:stop() + end else run = Run(dap_config, cmd) self.runs[dap_config.mainClass] = run