nvim-orgmode / nvim-orgmode/orgmode

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

Open
#725 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
3.9k
Forks
190
Avg merge
2d 13h
Merged PRs (30d)
7

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the URL parser and the ORG_OPEN_AT_POINT action described in the issue, then reproduce the capture and file-opening steps on Windows 10. Done means a file URL containing a Windows drive-letter colon opens the referenced README.md at line 12.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.