From 20502e50e9087248f6f8ed8d29fae9c849c1c77f Mon Sep 17 00:00:00 2001 From: champignoom <66909116+champignoom@users.noreply.github.com> Date: Sun, 3 Sep 2023 01:30:11 +0800 Subject: [PATCH] feat(esupports): use `wslview` to open `wsl2` files (#1038) --- lua/neorg/core/config.lua | 4 +++- lua/neorg/modules/core/esupports/hop/module.lua | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/neorg/core/config.lua b/lua/neorg/core/config.lua index 02a9ca8ad..2291f92c7 100644 --- a/lua/neorg/core/config.lua +++ b/lua/neorg/core/config.lua @@ -52,7 +52,9 @@ local function os_info() if f ~= nil then local version = f:read("*all") f:close() - if version:find("microsoft") then + if version:find("WSL2") then + return "wsl2" + elseif version:find("microsoft") then return "wsl" end end diff --git a/lua/neorg/modules/core/esupports/hop/module.lua b/lua/neorg/modules/core/esupports/hop/module.lua index dfe43dd05..178cdb618 100644 --- a/lua/neorg/modules/core/esupports/hop/module.lua +++ b/lua/neorg/modules/core/esupports/hop/module.lua @@ -87,6 +87,8 @@ module.public = { o.command = "xdg-open" elseif config.os_info == "mac" then o.command = "open" + elseif config.os_info == "wsl2" then + o.command = "wslview" elseif config.os_info == "wsl" then o.command = "explorer.exe" end