From 1dd700a8d9275439fbc71ac5adeb59914bdbd5cf Mon Sep 17 00:00:00 2001 From: Leonardo Mello Date: Mon, 18 Sep 2023 16:50:47 -0300 Subject: fix: gf fails on "foo/bar.txt:1:2" on Windows Problem: On Windows, "gf" fails on a filepath that has a line:column suffix. Example: E447: Can't find file "src/app/core/services/identity/identity.service.ts:64:23" Solution: - Remove ":" from 'isfname' on Windows. Colon is not a valid filename character (except for the drive-letter). - Handle drive letters specially in file_name_in_line(). Fixes #25160 --- runtime/doc/news.txt | 3 +++ runtime/doc/options.txt | 2 +- runtime/doc/vim_diff.txt | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index f0d01f92e7..2bf912dbfd 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -15,6 +15,9 @@ BREAKING CHANGES *news-breaking* The following changes may require adaptations in user config or plugins. +• Windows file path drive letters are now detected even if ":" is not in + 'isfname'. The default 'isfname' no longer includes ":". + • |vim.tbl_islist()| now checks whether a table is actually list-like (i.e., has integer keys without gaps and starting from 1). For the previous behavior (only check for integer keys, allow gaps or not starting with 1), diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index bc207d7755..283c1e3612 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3453,7 +3453,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'isfname'* *'isf'* 'isfname' 'isf' string (default for Windows: - "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=" + "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],@-@,!,~,=" otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=") global The characters specified by this option are included in file names and diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index e9c04443a6..974aa051cf 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -53,6 +53,8 @@ Defaults *nvim-defaults* - 'hlsearch' is enabled - 'include' defaults to "". The C ftplugin sets it to "^\\s*#\\s*include" - 'incsearch' is enabled +- 'isfname' does not include ":" on Windows. Include ":" in 'isfname' to treat + it as part of a filename anywhere in the name (not only the drive letter). - 'joinspaces' is disabled - 'langnoremap' is enabled - 'langremap' is disabled -- cgit From 133e2990efa44cadf1410a452a08843dbd8ca86e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 6 Oct 2023 12:59:39 +0200 Subject: refactor: cleanup --- runtime/doc/news.txt | 5 ++--- runtime/doc/vim_diff.txt | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 2bf912dbfd..b0f3b76587 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -15,9 +15,6 @@ BREAKING CHANGES *news-breaking* The following changes may require adaptations in user config or plugins. -• Windows file path drive letters are now detected even if ":" is not in - 'isfname'. The default 'isfname' no longer includes ":". - • |vim.tbl_islist()| now checks whether a table is actually list-like (i.e., has integer keys without gaps and starting from 1). For the previous behavior (only check for integer keys, allow gaps or not starting with 1), @@ -206,6 +203,8 @@ The following changes to existing APIs or features add new behavior. option, which allows for rendering e.g., diagnostic severities differently. • Defaults: + • On Windows 'isfname' does not include ":". Drive letters are handled + correctly without it. (Use |gF| for filepaths suffixed with ":line:col"). • 'comments' includes "fb:•". • 'shortmess' includes the "C" flag. • Automatic linting of treesitter query files (see |ft-query-plugin|). diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 974aa051cf..4161d3b21e 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -53,8 +53,8 @@ Defaults *nvim-defaults* - 'hlsearch' is enabled - 'include' defaults to "". The C ftplugin sets it to "^\\s*#\\s*include" - 'incsearch' is enabled -- 'isfname' does not include ":" on Windows. Include ":" in 'isfname' to treat - it as part of a filename anywhere in the name (not only the drive letter). +- 'isfname' does not include ":" (on Windows). Drive letters are handled + correctly without it. (Use |gF| for filepaths suffixed with ":line:col"). - 'joinspaces' is disabled - 'langnoremap' is enabled - 'langremap' is disabled -- cgit