Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(esupports.hop): support os_open_link for WSL #963

Merged
merged 1 commit into from
Jul 7, 2023
Merged

feat(esupports.hop): support os_open_link for WSL #963

merged 1 commit into from
Jul 7, 2023

Conversation

ShangjinTang
Copy link
Contributor

Environment

Use Neovim with this plugin in Windows Subsystem for Linux (WSL)

Steps

  1. Create a hyperlink in .norg file , e.g. "{https://github.com}[GitHub]"
  2. Move cursor to the hyperlink
  3. Press Key [Enter]

Current phenomenon (without this PR)

An error occured:

stack traceback:
	[C]: in function 'error'
	...nvim/site/pack/lazy/opt/plenary.nvim/lua/plenary/job.lua:106: in function 'new'
	...pt/neorg/lua/neorg/modules/core/esupports/hop/module.lua:94: in function 'os_open_link'
	...pt/neorg/lua/neorg/modules/core/esupports/hop/module.lua:122: in function <...pt/neorg/lua/neorg/modules/core/esupports/hop/module.lua:121>

With this PR

Link can be opened with Windows default browser successfully.

@ShangjinTang
Copy link
Contributor Author

There are multiple ways to solve this:

  1. my current PR
  2. similar to my current PR, change the "wsl" to "linux_wsl" in my PR; use if string starts with 'linux' to check in other files (such as in lua/neorg/external/helpers.lua)
  3. add another function to check if is wsl (such as add function neorg.configuration.os_is_wsl)

If you think the PR is suitable and reasonable, but prefer the 2nd solution or the 3rd solution, please leave a message.

@vhyrro
Copy link
Member

vhyrro commented Jul 7, 2023

I think this PR is good as is! Thank you :D

@vhyrro vhyrro changed the title feat(esupports.hop): support os_open_link for WSL feat(esupports.hop): support os_open_link for WSL Jul 7, 2023
@vhyrro vhyrro merged commit 628ba9f into nvim-neorg:main Jul 7, 2023
2 checks passed
benlubas pushed a commit to benlubas/neorg that referenced this pull request Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants