[vim/vim] errorformat: %f with %P only matches existing files (#2334)

10 views
Skip to first unread message

Daniel Hahler

unread,
Nov 13, 2017, 6:17:43 PM11/13/17
to vim/vim, Subscribed

%f when used with %P in an errorformat to push a file on the stack behaves different from using %f alone: with %P%f only existing files are matched, while %f alone matches files in general.

I've found 391b1dd in this regard, which creates the files in Vim's own tests explicitly - but I think that %P%f should behave like %f alone, which means it would also parse a non-existing filename, and add it as an unlisted buffer.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

bfrg

unread,
4:14 AM (18 hours ago) 4:14 AM
to vim/vim, Subscribed
bfrg left a comment (vim/vim#2334)

I have encountered the same issue. I tried reproducing the example given under :help errorformat-separate-filename but even that doesn't work as expected.

Compiler output:

[a1.tt]
(1,17)  error: ';' missing
(21,2)  warning: variable 'z' not defined
(67,3)  error: end of file found before string ended

[a2.tt]

[a3.tt]
NEW compiler v1.1
(2,2)   warning: variable 'x' not defined
(67,3)  warning: 's' already defined

Errorformat: set efm=%+P[%f],(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%-Q

Generated quickfixlist:

[
	{
		"lnum": 0,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 0,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "",
		"end_col": 0,
		"col": 0,
		"text": "[a1.tt]"
	},
	{
		"lnum": 1,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 1,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "e",
		"end_col": 0,
		"col": 17,
		"text": "';' missing"
	},
	{
		"lnum": 21,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 1,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "w",
		"end_col": 0,
		"col": 2,
		"text": "variable 'z' not defined"
	},
	{
		"lnum": 67,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 1,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "e",
		"end_col": 0,
		"col": 3,
		"text": "end of file found before string ended"
	},
	{
		"lnum": 0,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 0,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "",
		"end_col": 0,
		"col": 0,
		"text": "[a2.tt]"
	},
	{
		"lnum": 0,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 0,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "",
		"end_col": 0,
		"col": 0,
		"text": "[a3.tt]"
	},
	{
		"lnum": 0,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 0,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "",
		"end_col": 0,
		"col": 0,
		"text": "NEW compiler v1.1"
	},
	{
		"lnum": 2,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 1,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "w",
		"end_col": 0,
		"col": 2,
		"text": "variable 'x' not defined"
	},
	{
		"lnum": 67,
		"bufnr": 0,
		"end_lnum": 0,
		"pattern": "",
		"valid": 1,
		"vcol": 0,
		"nr": -1,
		"module": "",
		"type": "w",
		"end_col": 0,
		"col": 3,
		"text": "'s' already defined"
	}
]


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/2334/4197519721@github.com>

Reply all
Reply to author
Forward
0 new messages