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

fix(filetype.lua): escape expansion of ~ when used as a pattern #18353

Merged
merged 1 commit into from May 2, 2022

Conversation

jamessan
Copy link
Member

@jamessan jamessan commented May 2, 2022

No description provided.

@github-actions github-actions bot added filetype filetype detection, filetype.lua lua stdlib labels May 2, 2022
@github-actions github-actions bot requested review from clason and gpanders May 2, 2022 04:16
@jamessan
Copy link
Member Author

jamessan commented May 2, 2022

@dundargoc regen-api-docs failed:

Switched to a new branch 'marvim/api-doc-update/refs/pull/18353/merge'
Traceback (most recent call last):
  File "/home/runner/work/neovim/neovim/scripts/gen_vimdoc.py", line 62, in <module>
    doxygen_version = tuple([int(i) for i in subprocess.check_output(["doxygen", "-v"],
  File "/home/runner/work/neovim/neovim/scripts/gen_vimdoc.py", line 62, in <listcomp>
    doxygen_version = tuple([int(i) for i in subprocess.check_output(["doxygen", "-v"],
ValueError: invalid literal for int() with base 10: '2 (ee54ebd4f0ad83d9c44f19a459146de64d0ffba2*)\n'
Error: Process completed with exit code 1.

runtime/lua/vim/filetype.lua Outdated Show resolved Hide resolved
runtime/lua/vim/filetype.lua Outdated Show resolved Hide resolved
@jamessan jamessan merged commit a1542b0 into neovim:master May 2, 2022
@jamessan jamessan deleted the ft-match-fix branch May 2, 2022 15:01
@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2022

Cannot read property 'match' of null

@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2022

Git push to origin failed for release-0.7 with exitcode 1

if as_pattern then
-- Escape Lua's metacharacters when $HOME is used in a pattern.
-- The rest of path should already be properly escaped.
normal = vim.env.HOME:gsub('[-^$()%%.%[%]+?]', '%%%0') .. normal:sub(2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is vim.pesc useful here?

function vim.pesc(s)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that would have been useful to notice. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be more than one opportunity to refactor filetype.lua (e.g., as part of #18241) ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filetype filetype detection, filetype.lua lua stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants