Skip to content

Commit 86114c9

Browse files
committed
fix: Set file_pattern to string|string[] (resolves #1)
1 parent 78b524c commit 86114c9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ The following is the default configuration, and can be passed into the `setup()`
2929

3030
```lua
3131
{
32-
-- The pattern to match the file name. If the file name matches the
33-
-- pattern, ghostty.nvim will run on save in that buffer.
32+
-- The autocmd pattern matched against the filename of the buffer. If this pattern
33+
-- matches, ghostty.nvim will run on save in that buffer. This pattern is passed to
34+
-- nvim_create_autocmd, check `:h autocmd-pattern` for more information. Can be
35+
-- either a string or a list of strings
3436
file_pattern = "*/ghostty/config",
3537
-- The ghostty executable to run.
3638
ghostty_cmd = "ghostty",

lua/ghostty.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
local M = {}
22

33
---@class (exact) Options
4-
---@field file_pattern? string The pattern to match the file name. If the file name matches the pattern, ghostty.nvim will run on save in that buffer.
4+
---@field file_pattern? string|string[] The autocmd-pattern to match the file name. If the file name matches the pattern, ghostty.nvim will run on save in that buffer. This is passed to nvim_create_autocmd, check `:h autocmd-pattern` for more information.
55
---@field ghostty_cmd? string The ghostty executable to run.
66
---@field check_timeout? number The timeout in milliseconds for the check command. If the command takes longer than this it will be killed.
77

88
---@class (exact) OptionsStrict : Options
9-
---@field file_pattern string
9+
---@field file_pattern string|string[]
1010
---@field ghostty_cmd string
1111
---@field check_timeout number
1212

0 commit comments

Comments
 (0)