From bbcee2077903bb1160d24ffdbe077f227ad90bdf Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Sat, 11 Nov 2023 15:29:14 +0100 Subject: [PATCH] fix: open external docs broken in neovim 0.9 (#52) --- CHANGELOG.md | 6 ++++++ lua/rustaceanvim/commands/external_docs.lua | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52d0af3c..09befe25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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). +## [3.4.2] - 2023-11-11 + +## Fixed + +- Open external docs broken in Neovim 0.9 [[#50](https://github.com/mrcjkb/rustaceanvim/issues/50)]. + ## [3.4.1] - 2023-11-10 ## Fixed diff --git a/lua/rustaceanvim/commands/external_docs.lua b/lua/rustaceanvim/commands/external_docs.lua index c9e06420..da93969c 100644 --- a/lua/rustaceanvim/commands/external_docs.lua +++ b/lua/rustaceanvim/commands/external_docs.lua @@ -1,6 +1,7 @@ local M = {} local rl = require('rustaceanvim.rust_analyzer') +local compat = require('rustaceanvim.compat') ---@param url string local function open_url(url) @@ -14,15 +15,15 @@ local function open_url(url) end if vim.fn.has('mac') == 1 then - vim.system({ 'open', url }, nil, on_exit) + compat.system({ 'open', url }, nil, on_exit) return end if vim.fn.executable('sensible-browser') == 1 then - vim.system({ 'sensible-browser', url }, nil, on_exit) + compat.system({ 'sensible-browser', url }, nil, on_exit) return end if vim.fn.executable('xdg-open') == 1 then - vim.system({ 'xdg-open', url }, nil, on_exit) + compat.system({ 'xdg-open', url }, nil, on_exit) return end local ok, err = pcall(vim.fn['netrw#BrowseX'], url, 0)