Skip to content

Commit

Permalink
chore: typos fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phanen authored and ibhagwan committed May 7, 2024
1 parent b6996a8 commit 64f6eff
Show file tree
Hide file tree
Showing 25 changed files with 71 additions and 71 deletions.
24 changes: 12 additions & 12 deletions OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Disable `file_icons` in `files`, applies to this call only:
:FzfLua files file_icons=false
```

Fzf-lua conviniently enables setting lua tables recursively using dotted keys, for exmaple, if we
Fzf-lua conveniently enables setting lua tables recursively using dotted keys, for example, if we
wanted to call `files` in "split" mode (instead of the default floating window), we would normally call:

```lua
Expand Down Expand Up @@ -222,25 +222,25 @@ Neovim split command to use for fzf-lua interface, e.g `belowright new`.

Type: `number`, Default: `0.55`

Screen column where to place the fzf-lua float window, between 0-1 will represent precentage of `vim.o.columns` (0: leftmost, 1: rightmost), if >= 1 will attempt to place the float in the exact screen column.
Screen column where to place the fzf-lua float window, between 0-1 will represent percentage of `vim.o.columns` (0: leftmost, 1: rightmost), if >= 1 will attempt to place the float in the exact screen column.

#### globals.winopts.row

Type: `number`, Default: `0.35`

Screen row where to place the fzf-lua float window, between 0-1 will represent precentage of `vim.o.lines` (0: top, 1: bottom), if >= 1 will attempt to place the float in the exact screen line.
Screen row where to place the fzf-lua float window, between 0-1 will represent percentage of `vim.o.lines` (0: top, 1: bottom), if >= 1 will attempt to place the float in the exact screen line.

#### globals.winopts.width

Type: `number`, Default: `0.80`

Width of the fzf-lua float, between 0-1 will represent precentage of `vim.o.columns` (1: max width), if >= 1 will use fixed number of columns.
Width of the fzf-lua float, between 0-1 will represent percentage of `vim.o.columns` (1: max width), if >= 1 will use fixed number of columns.

#### globals.winopts.height

Type: `number`, Default: `0.85`

Height of the fzf-lua float, between 0-1 will represent precentage of `vim.o.lines` (1: max height), if >= 1 will use fixed number of lines.
Height of the fzf-lua float, between 0-1 will represent percentage of `vim.o.lines` (1: max height), if >= 1 will use fixed number of lines.

#### globals.winopts.border

Expand All @@ -265,7 +265,7 @@ Callback after the creation of the fzf-lua main terminal window.

Type: `number`, Default: `100`

Debounce time (miliseconds) for displaying the preview buffer in the builtin previewer.
Debounce time (milliseconds) for displaying the preview buffer in the builtin previewer.

#### globals.winopts.preview.wrap

Expand All @@ -286,7 +286,7 @@ Preview startup visibility in both native fzf and the builtin previewer, mapped

Type: `string`, Default: `border`

Preview border for native fzf previewers (i.e. `bat`, `git_status`), set to `noborder` to hide the preview border, consult `man fzf` for all vailable options.
Preview border for native fzf previewers (i.e. `bat`, `git_status`), set to `noborder` to hide the preview border, consult `man fzf` for all available options.

#### globals.winopts.preview.layout

Expand All @@ -299,7 +299,7 @@ tested against `winopts.preview.flip_columns`, when <= `vertical` is used, other

Type: `number`, Default: `120`

Auto-detect the preview layout based on available widht, see above note in `winopts.preview.layout`.
Auto-detect the preview layout based on available width, see above note in `winopts.preview.layout`.

#### globals.winopts.preview.horizontal

Expand Down Expand Up @@ -524,13 +524,13 @@ Interactive headers description highlight group, e.g. `<ctrl-g> to Disable .giti

Type: `string`, Default: `FzfLuaPathLineNr`

Highlight group for the line part of paths, e.g. `file:<line>:<col>:`, used in pickers such as `bufers`, `lines`, `quickfix`, `lsp`, `diagnostics`, etc.
Highlight group for the line part of paths, e.g. `file:<line>:<col>:`, used in pickers such as `buffers`, `lines`, `quickfix`, `lsp`, `diagnostics`, etc.

#### globals.hls.path_colnr

Type: `string`, Default: `FzfLuaPathColNr`

Highlight group for the column part of paths, e.g. `file:<line>:<col>:`, used in pickers such as `bufers`, `lines`, `quickfix`, `lsp`, `diagnostics`, etc.
Highlight group for the column part of paths, e.g. `file:<line>:<col>:`, used in pickers such as `buffers`, `lines`, `quickfix`, `lsp`, `diagnostics`, etc.

#### globals.hls.buf_name

Expand Down Expand Up @@ -641,7 +641,7 @@ Exclude non-file entries (directories).

#### files

Files finder, will enumrate the filesystem of the current working directory using `fd`, `rg` and `grep` or `dir.exe`.
Files finder, will enumerate the filesystem of the current working directory using `fd`, `rg` and `grep` or `dir.exe`.

##### files.cwd_prompt

Expand Down Expand Up @@ -687,7 +687,7 @@ Performant "live" grep variant piping the underlying command directly to fzf (wi

#### live_grep_glob

"Live" grep variant with add support for `rg --iglob` flag, use the default separator `--` to specify globs, for exmaple, `pcall -- *.lua !*spec*` will search for `pcall` in any lua file that doesn't contain `spec`.
"Live" grep variant with add support for `rg --iglob` flag, use the default separator `--` to specify globs, for example, `pcall -- *.lua !*spec*` will search for `pcall` in any lua file that doesn't contain `spec`.

#### live_grep_resume

Expand Down
2 changes: 1 addition & 1 deletion README-Win.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ And try to search for the literal `[` by typing `\[`, we get the error:
[Command failed: rg --line-number --column --color=always ^"\\[^"]
```

If we double the blackslashes by typing `\\[` we get the error:
If we double the backslashes by typing `\\[` we get the error:
```
[Command failed: rg --line-number --column --color=always ^"\\\\[^"]
```
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ M.vimcmd_file = function(vimcmd, selected, opts, pcall_vimcmd)
relpath = fullpath
end
-- we normalize the path or Windows will fail with directories starting
-- with special characters, for example "C:\app\(web)" will be traslated
-- with special characters, for example "C:\app\(web)" will be translated
-- by neovim to "c:\app(web)" (#1082)
local cmd = vimcmd .. " " .. vim.fn.fnameescape(path.normalize(relpath))
if pcall_vimcmd then
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function M._candidates(line, cmp_items)
},
{ patterns = { "^lsp_.*_symbols$" }, transform = function(_) return "lsp.symbols" end },
{ patterns = { "^lsp_" }, transform = function(_) return "lsp" end },
{ patterns = { "^diagnostics_" }, transform = function(_) return "dianostics" end },
{ patterns = { "^diagnostics_" }, transform = function(_) return "diagnostics" end },
{ patterns = { "^tags" }, transform = function(_) return "tags" end },
{ patterns = { "grep" }, transform = function(_) return "grep" end },
{ patterns = { "^complete_bline$" }, transform = function(_) return "complete_line" end },
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua/complete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ local function find_toplevel_cwd(maybe_cwd, postfix, orig_cwd)
end

-- forward and reverse match spaces and single/double quotes
-- and attepmpt to find the top level existing directory
-- and attempt to find the top level existing directory
-- set the cwd and prompt top the top level directory and
-- the leftover match to the input query
local set_cmp_opts_path = function(opts)
Expand Down
4 changes: 2 additions & 2 deletions lua/fzf-lua/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ M.resume_set = function(what, val, opts)
-- backward compatibility for users using `get_last_query`
if what == "query" then
utils.map_set(M, "__resume_data.last_query", val)
-- store in opts for convinience in action callbacks
-- store in opts for convenience in action callbacks
opts.last_query = val
end
-- _G.dump("resume_set", key1, utils.map_get(M, key1))
Expand Down Expand Up @@ -425,7 +425,7 @@ function M.normalize_opts(opts, globals, __resume_key)
-- directory so we must convert to full path (#375)
opts.cwd = path.join({ uv.cwd(), opts.cwd })
elseif utils.__IS_WINDOWS and opts.cwd:sub(2) == ":" then
-- TODO: upstream bug? on Windoows: starting jobs with `cwd = C:` (without separator)
-- TODO: upstream bug? on Windows: starting jobs with `cwd = C:` (without separator)
-- ignores the cwd argument and starts the job in the current working directory
opts.cwd = path.add_trailing(opts.cwd)
end
Expand Down
10 changes: 5 additions & 5 deletions lua/fzf-lua/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ M.CTX = function(includeBuflist)
-- is already open (actions.sym_lsym|grep_lgrep)
if not M.__CTX or
-- when called from the LSP module in "sync" mode when no results are found
-- the fzf window won't open (e.g. "No refernces found") and the context is
-- the fzf window won't open (e.g. "No references found") and the context is
-- never cleared. The below condition validates the source window when the
-- UI is not open (#907)
(not utils.fzf_winobj() and M.__CTX.bufnr ~= vim.api.nvim_get_current_buf()) then
Expand Down Expand Up @@ -425,7 +425,7 @@ M.fzf = function(contents, opts)
-- reminder: this doesn't get called with 'live_grep' when using skim
-- due to a bug where '--print-query --interactive' combo is broken:
-- skim always prints an empty line where the typed query should be.
-- see addtional note above 'opts.fn_post_fzf' inside 'live_grep_mt'
-- see additional note above 'opts.fn_post_fzf' inside 'live_grep_mt'
config.resume_set("query", selected[1], opts)
end
table.remove(selected, 1)
Expand Down Expand Up @@ -491,7 +491,7 @@ M.create_fzf_colors = function(opts)

local tbl = {}

-- In case the user alredy set fzf_opts["--color"] (#1052)
-- In case the user already set fzf_opts["--color"] (#1052)
table.insert(tbl, opts.fzf_opts and opts.fzf_opts["--color"])

for flag, list in pairs(colors) do
Expand Down Expand Up @@ -675,7 +675,7 @@ M.mt_cmd_wrapper = function(opts)
"rg_glob",
"_base64",
}
-- caller reqested rg with glob support
-- caller requested rg with glob support
if o.rg_glob then
table.insert(names, "glob_flag")
table.insert(names, "glob_separator")
Expand Down Expand Up @@ -1064,7 +1064,7 @@ M.setup_fzf_interactive_flags = function(command, fzf_field_expression, opts)
-- also escaping the query with ^"<query>"^ any spaces in the query
-- will fail the command, by adding caret escaping before fzf's
-- we fool CMD.exe to not terminate the quote and thus an empty query
-- will generate the experssion ^^"^" which translates to ^""
-- will generate the expression ^^"^" which translates to ^""
-- our specialized libuv.shellescape will also double the escape
-- sequence if a "!" is found in our string as explained in:
-- https://ss64.com/nt/syntax-esc.html
Expand Down
6 changes: 3 additions & 3 deletions lua/fzf-lua/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ M.defaults.git = {
},
status = {
prompt = "GitStatus> ",
-- override `color.status=always`, techincally not required
-- override `color.status=always`, technically not required
-- since we now also call `utils.strip_ansi_coloring` (#706)
cmd = "git -c color.status=false --no-optional-locks status --porcelain=v1 -u",
previewer = "git_diff",
Expand Down Expand Up @@ -744,14 +744,14 @@ M.defaults.lsp.symbols = {
-- NOT NEEDED: we format at the source in `lsp.symbol_handler`
-- to = function(s, _)
-- local file, text = s:match("^(.+:.+:.+:)%s(.*)")
-- -- fzf has alignment issues with ansi colorings of differnt escape length
-- -- fzf has alignment issues with ansi colorings of different escape length
-- local align = 56 + utils.ansi_escseq_len(text)
-- return string.format("%-" .. align .. "s%s%s", text, utils.nbsp, file)
-- end,
to = false,
from = function(s, _)
-- restore the format to something that `path.entry_to_file` can
-- handle more robustly, while this can stil work due to the `utils.nbsp`
-- handle more robustly, while this can still work due to the `utils.nbsp`
-- it will fail when the symbol contains "[%d]" (which we use as bufnr)
local text, file = s:match(string.format("^(.-)%s(.*)", utils.nbsp))
return string.format("%s %s", file, text)
Expand Down
4 changes: 2 additions & 2 deletions lua/fzf-lua/fzf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ function M.raw_fzf(contents, fzf_cli_args, opts)
end)

-- I'm not sure why this happens (probably a neovim bug) but when pressing
-- <C-c> in quick successsion immediately after opening the window neovim
-- <C-c> in quick succession immediately after opening the window neovim
-- hangs the CPU at 100% at the last `coroutine.yield` before returning from
-- this function. At this point it seems that the fzf subprocess was started
-- and killed but `on_exit` is never called. In order to avoid calling `yield`
-- I tried checking the job/coroutine status in different ways:
-- * coroutine.status(co): always returns 'running'
-- * vim.fn.job_pid: always returns the corrent pid (even if it doesn't
-- * vim.fn.job_pid: always returns the current pid (even if it doesn't
-- exist anymore)
-- * vim.fn.jobwait({job_pid}, 0): always returns '-1' (even when looping
-- with 'vim.defer_fn(fn, 100)')
Expand Down
10 changes: 5 additions & 5 deletions lua/fzf-lua/libuv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ M.spawn_stdio = function(opts, fn_transform_str, fn_preprocess_str)
end

-- stdin/stdout are already buffered, not stderr. This means
-- that every character is flushed immedietely which caused
-- that every character is flushed immediately which caused
-- rendering issues on Mac (#316, #287) and Linux (#414)
-- switch 'stderr' stream to 'line' buffering
-- https://www.lua.org/manual/5.2/manual.html#pdf-file%3asetvbuf
Expand Down Expand Up @@ -447,7 +447,7 @@ M.spawn_stdio = function(opts, fn_transform_str, fn_preprocess_str)
-- if the user cancels the call prematurely with
-- <C-c>, err will be either EPIPE or ECANCELED
-- don't really need to do anything since the
-- processs will be killed anyways with os.exit()
-- processes will be killed anyways with os.exit()
if err then
stderr_write(("pipe:write error: %s\n"):format(err))
end
Expand Down Expand Up @@ -525,7 +525,7 @@ M.is_escaped = function(s, is_win)
return m ~= nil
end

-- our own version of vim.fn.shellescape compatibile with fish shells
-- our own version of vim.fn.shellescape compatible with fish shells
-- * don't double-escape '\' (#340)
-- * if possible, replace surrounding single quote with double
-- from ':help shellescape':
Expand All @@ -535,8 +535,8 @@ end
--
-- for windows, we assume we want to keep all quotes as literals
-- to avoid the quotes being stripped when run from fzf actions
-- we therefore have to escape the quotes with blackslashes and
-- for nested quotes we double the blackslashes due to windows
-- we therefore have to escape the quotes with backslashes and
-- for nested quotes we double the backslashes due to windows
-- quirks, further reading:
-- https://stackoverflow.com/questions/6714165/powershell-stripping-double-quotes-from-command-line-arguments
-- https://learn.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way
Expand Down
4 changes: 2 additions & 2 deletions lua/fzf-lua/make_entry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ M.file = function(x, opts)
if opts.path_shorten then
filepath = path.shorten(filepath, tonumber(opts.path_shorten),
-- On Windows we want to shorten using the separator used by the `cwd` arg
-- otherwise we might haave issues "lenghening" as in the case of git which
-- otherwise we might have issues "lenghening" as in the case of git which
-- uses normalized paths (using /) for `rev-parse --show-toplevel` and `ls-files`
utils.__IS_WINDOWS and opts.cwd and path.separator(opts.cwd))
end
Expand Down Expand Up @@ -434,7 +434,7 @@ M.git_status = function(x, opts)
f1, f2 = f1:match("(.*)%s%->%s(.*)")
end
f1 = f1 and M.file(f1, opts)
-- accomodate 'file_ignore_patterns'
-- accommodate 'file_ignore_patterns'
if not f1 then return end
f2 = f2 and M.file(f2, opts)
local staged = git_iconify(x:sub(1, 1):gsub("?", " "), true)
Expand Down
4 changes: 2 additions & 2 deletions lua/fzf-lua/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ end
M.byte_is_separator = function(byte)
if utils.__IS_WINDOWS then
-- path on windows can also be the result of `vim.fs.normalize`
-- so we need to test for the presense of both slash types
-- so we need to test for the presence of both slash types
return byte == M.bslash_byte or byte == M.fslash_byte
else
return byte == M.fslash_byte
Expand Down Expand Up @@ -231,7 +231,7 @@ end

-- I'm not sure why this happens given that neovim is single threaded
-- but it seems that 'oldfiles' provider processing entries concurrently
-- crashes when trying to access `vim.env.HOME' from two differnt entries
-- crashes when trying to access `vim.env.HOME' from two different entries
-- at the same time due to being run in a coroutine (#447)
M.HOME = function()
if not M.__HOME then
Expand Down
4 changes: 2 additions & 2 deletions lua/fzf-lua/previewer/builtin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function Previewer.buffer_or_file:populate_terminal_cmd(tmpbuf, cmd, entry)
-- the scrollbar which we wish to hide
entry.no_scrollbar = true
-- both ueberzug and terminal cmds need a clear
-- on redraw to fit the new window dimentions
-- on redraw to fit the new window dimensions
self.clear_on_redraw = true
-- 2nd arg `true`: minimal style window
self:set_preview_buf(tmpbuf, true)
Expand Down Expand Up @@ -1086,7 +1086,7 @@ end
function Previewer.tags:parse_entry(entry_str)
-- first parse as normal entry
-- must use 'super.' and send self as 1st arg
-- or the ':' syntactic suger will send super's
-- or the ':' syntactic sugar will send super's
-- self which doesn't have self.opts
local entry = self.super.parse_entry(self, entry_str)
entry.ctag = path.entry_to_ctag(entry_str)
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua/previewer/codeaction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ local function preview_action_tuple(self, idx, callback)
-- prior to nvim 0.10 we could check `client.server_capabilities`
or vim.tbl_get(client.server_capabilities, "codeActionProvider", "resolveProvider")
if not action.edit and client and supports_resolve then
-- Action is not a worksapce edit, attempt to resolve the code action
-- Action is not a workspace edit, attempt to resolve the code action
-- in case it resolves to a workspace edit
local function handle_resolved_response(err, resolved_action)
if err then
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua/previewer/fzf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function Previewer.bat_async:_preview_offset()
]]
if not self.args or not self.args:match("%-%-style=default") then
-- we don't need affixed header unless we use bat default style
-- TODO: shuld also adjust for "--style=header-filename"
-- TODO: should also adjust for "--style=header-filename"
if self.opts.line_field_index then
return ("+%s-/2"):format(self.opts.line_field_index)
end
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua/providers/colorschemes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function AsyncDownloadManager:jobstart(plugin, job_args)
elseif job_id == -1 then
utils.warn(string.format([[jobstart: "%s" is not executable]], job_args[1]))
else
-- job started succesfully
-- job started successfully
utils.info(string.format("%s [path:%s] [job_id:%d]...",
msg, path.HOME_to_tilde(info.path), job_id))
self.job_ids[tostring(job_id)] = { plugin = plugin, args = job_args }
Expand Down
Loading

0 comments on commit 64f6eff

Please sign in to comment.