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

Windwos path with Colon (:) (ex: E:\repoes\README.md) can't open #725

Open
hasansujon786 opened this issue May 16, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@hasansujon786
Copy link
Contributor

hasansujon786 commented May 16, 2024

Describe the bug

[[file:E:\repoes\react-native-apps\mini_sports\README.md::12]]
        ^
  Path with colon here

Default action ORG_OPEN_AT_POINT <leader>oo can't open this file.
The URL parser returns false on Windows.

Steps to reproduce

  1. Capture file path <leader>oc with a custom template that stores file location
-- my custom template
org_capture_templates = {
  m = {
    description = "Mark file",
    template = "** %?\n  %a",
    target = "~/my_vault/orgfiles/mark_files.org",
  },
}
  1. Put cursor on generated URL and press <leader>oo
* heading
[[file:E:\repoes\react-native-apps\mini_sports\README.md::12]
  1. Failed to open the file

Expected behavior

Open the file correctly.

Emacs functionality

No response

Minimal init.lua

vim.o.number = true
vim.g.mapleader = " "
vim.g.maplocalleader = " "

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"https://github.com/folke/lazy.nvim.git",
		"--branch=stable", -- latest stable release
		lazypath,
	})
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
	{
		"nvim-treesitter/nvim-treesitter",
		config = function()
			-- TSInstallSync javascript typescript tsx org
			local parsers = {
				"lua",
				"vim",
				"vimdoc",
			}

			require("nvim-treesitter.configs").setup({
				ensure_installed = parsers,
				highlight = {
					enable = true, -- false will disable the whole extension
					use_languagetree = false,
					disable = { "vim" },
					additional_vim_regex_highlighting = { "org", "vim", "markdown" }, -- Required since TS highlighter doesn't support all syntax features (conceal)
				},
				indent = { enable = true, disable = { "dart" } },
			})
		end,
	},
	{
		"nvim-orgmode/orgmode",
		-- lazy = true,
		-- ft = { 'org' },
		opts = {
			org_agenda_files = { "~/my_vault/orgfiles/**/*" },
			org_default_notes_file = "~/my_vault/orgfiles/refile.org",
			org_hide_leading_stars = true,
			org_hide_emphasis_markers = true,
			org_todo_keywords = { "TODO", "NEXT", "WORKING", "WAITING", "|", "DONE", "CANCELED" },
			org_capture_templates = {
				m = {
					description = "Mark file",
					template = "** %?\n  %a",
					target = "~/my_vault/orgfiles/mark_files.org",
				},
				t = {
					description = "Task",
					headline = "Quick Tasks",
					template = "** TODO %?\n  %u",
				},
			},
		},
	},
})

Screenshots and recordings

No response

OS / Distro

Windows 10

Neovim version/commit

0.9.5

Additional context

Please let me know If I can help you to debug if you don't use a Windows PC.

@hasansujon786 hasansujon786 added the bug Something isn't working label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant