Skip to content

Commit 16231a6

Browse files
authored
fix(ansible): improve regex pattern to avoid false matches (#1535)
1 parent 2107a4c commit 16231a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/astrocommunity/pack/ansible/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local function yaml_ft(path, bufnr)
88
if path_regex and path_regex:match_str(path) then return "yaml.ansible" end
99

1010
-- check for known ansible playbook text and if found, return yaml.ansible
11-
local regex = vim.regex "hosts:\\|tasks:"
11+
local regex = vim.regex "^(hosts\\|tasks):"
1212
if regex and regex:match_str(content) then return "yaml.ansible" end
1313

1414
-- return yaml if nothing else

0 commit comments

Comments
 (0)