Skip to content

Commit

Permalink
fix(lsp): don't try to delete user command if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Mar 2, 2024
1 parent 71a59ea commit 6081be4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- LSP: Don't try to delete `RustLsp` command on client exit
if it doesn't exist.

## [4.10.2] - 2024-03-01

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion lua/rustaceanvim/commands/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ end

--- Delete the `:RustLsp` command
function M.delete_rust_lsp_command()
vim.api.nvim_del_user_command(rust_lsp_cmd_name)
if vim.cmd[rust_lsp_cmd_name] then
vim.api.nvim_del_user_command(rust_lsp_cmd_name)
end
end

---Create the `:Rustc` command
Expand Down

0 comments on commit 6081be4

Please sign in to comment.