diff --git a/OPTIONS.md b/OPTIONS.md index 02b0bad4..339561f1 100644 --- a/OPTIONS.md +++ b/OPTIONS.md @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -524,13 +524,13 @@ Interactive headers description highlight group, e.g. ` to Disable .giti Type: `string`, Default: `FzfLuaPathLineNr` -Highlight group for the line part of paths, e.g. `file:::`, used in pickers such as `bufers`, `lines`, `quickfix`, `lsp`, `diagnostics`, etc. +Highlight group for the line part of paths, e.g. `file:::`, 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:::`, used in pickers such as `bufers`, `lines`, `quickfix`, `lsp`, `diagnostics`, etc. +Highlight group for the column part of paths, e.g. `file:::`, used in pickers such as `buffers`, `lines`, `quickfix`, `lsp`, `diagnostics`, etc. #### globals.hls.buf_name @@ -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 @@ -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 diff --git a/README-Win.md b/README-Win.md index 00100191..78145705 100644 --- a/README-Win.md +++ b/README-Win.md @@ -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 ^"\\\\[^"] ``` diff --git a/lua/fzf-lua/actions.lua b/lua/fzf-lua/actions.lua index 959e26bf..1ae077a4 100644 --- a/lua/fzf-lua/actions.lua +++ b/lua/fzf-lua/actions.lua @@ -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 diff --git a/lua/fzf-lua/cmd.lua b/lua/fzf-lua/cmd.lua index c76b395f..b9498cf8 100644 --- a/lua/fzf-lua/cmd.lua +++ b/lua/fzf-lua/cmd.lua @@ -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 }, diff --git a/lua/fzf-lua/complete.lua b/lua/fzf-lua/complete.lua index 1b15d401..4b4be60b 100644 --- a/lua/fzf-lua/complete.lua +++ b/lua/fzf-lua/complete.lua @@ -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) diff --git a/lua/fzf-lua/config.lua b/lua/fzf-lua/config.lua index 573c1e40..70e24219 100644 --- a/lua/fzf-lua/config.lua +++ b/lua/fzf-lua/config.lua @@ -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)) @@ -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 diff --git a/lua/fzf-lua/core.lua b/lua/fzf-lua/core.lua index 94bd41f9..11c35d87 100644 --- a/lua/fzf-lua/core.lua +++ b/lua/fzf-lua/core.lua @@ -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 @@ -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) @@ -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 @@ -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") @@ -1064,7 +1064,7 @@ M.setup_fzf_interactive_flags = function(command, fzf_field_expression, opts) -- also escaping the query with ^""^ 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 diff --git a/lua/fzf-lua/defaults.lua b/lua/fzf-lua/defaults.lua index f1f0d13a..2ce3d055 100644 --- a/lua/fzf-lua/defaults.lua +++ b/lua/fzf-lua/defaults.lua @@ -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", @@ -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) diff --git a/lua/fzf-lua/fzf.lua b/lua/fzf-lua/fzf.lua index 6a4e8fb4..25c1c53b 100644 --- a/lua/fzf-lua/fzf.lua +++ b/lua/fzf-lua/fzf.lua @@ -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 - -- in quick successsion immediately after opening the window neovim + -- 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)') diff --git a/lua/fzf-lua/libuv.lua b/lua/fzf-lua/libuv.lua index 45c5feec..ae9cf2fd 100644 --- a/lua/fzf-lua/libuv.lua +++ b/lua/fzf-lua/libuv.lua @@ -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 @@ -447,7 +447,7 @@ M.spawn_stdio = function(opts, fn_transform_str, fn_preprocess_str) -- if the user cancels the call prematurely with -- , 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 @@ -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': @@ -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 diff --git a/lua/fzf-lua/make_entry.lua b/lua/fzf-lua/make_entry.lua index 9de92be3..de4c3faf 100644 --- a/lua/fzf-lua/make_entry.lua +++ b/lua/fzf-lua/make_entry.lua @@ -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 @@ -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) diff --git a/lua/fzf-lua/path.lua b/lua/fzf-lua/path.lua index fb05f568..7fb15c8e 100644 --- a/lua/fzf-lua/path.lua +++ b/lua/fzf-lua/path.lua @@ -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 @@ -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 diff --git a/lua/fzf-lua/previewer/builtin.lua b/lua/fzf-lua/previewer/builtin.lua index e1214e7f..fa29ee04 100644 --- a/lua/fzf-lua/previewer/builtin.lua +++ b/lua/fzf-lua/previewer/builtin.lua @@ -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) @@ -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) diff --git a/lua/fzf-lua/previewer/codeaction.lua b/lua/fzf-lua/previewer/codeaction.lua index 62c07acc..42d1eb02 100644 --- a/lua/fzf-lua/previewer/codeaction.lua +++ b/lua/fzf-lua/previewer/codeaction.lua @@ -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 diff --git a/lua/fzf-lua/previewer/fzf.lua b/lua/fzf-lua/previewer/fzf.lua index a98cc206..4c7a0393 100644 --- a/lua/fzf-lua/previewer/fzf.lua +++ b/lua/fzf-lua/previewer/fzf.lua @@ -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 diff --git a/lua/fzf-lua/providers/colorschemes.lua b/lua/fzf-lua/providers/colorschemes.lua index 047288dc..165fdba7 100644 --- a/lua/fzf-lua/providers/colorschemes.lua +++ b/lua/fzf-lua/providers/colorschemes.lua @@ -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 } diff --git a/lua/fzf-lua/providers/grep.lua b/lua/fzf-lua/providers/grep.lua index abdbf243..7135de0e 100644 --- a/lua/fzf-lua/providers/grep.lua +++ b/lua/fzf-lua/providers/grep.lua @@ -168,7 +168,7 @@ local function normalize_live_grep_opts(opts) utils.map_set(config, "__resume_data.last_query", val) -- also store query for `fzf_resume` (#963) utils.map_set(config, "__resume_data.opts.query", val) - -- store in opts for convinience in action callbacks + -- store in opts for convenience in action callbacks o.last_query = val else config.resume_set(what, val, { __resume_key = o.__resume_key }) @@ -257,7 +257,7 @@ M.live_grep_mt = function(opts) -- signal to preprocess we are looking to replace {argvz} opts.argv_expr = true - -- this will be replaced by the approperiate fzf + -- this will be replaced by the appropriate fzf -- FIELD INDEX EXPRESSION by 'fzf_exec' opts.cmd = get_grep_cmd(opts, core.fzf_query_placeholder, 2) if not opts.cmd then return end @@ -281,7 +281,7 @@ M.live_grep_glob_st = function(opts) end -- 'rg_glob = true' enables glob - -- processsing in 'get_grep_cmd' + -- processing in 'get_grep_cmd' opts = opts or {} opts.rg_glob = true return M.live_grep_st(opts) @@ -293,7 +293,7 @@ M.live_grep_glob_mt = function(opts) return end - -- 'rg_glob = true' enables the glob processsing in + -- 'rg_glob = true' enables the glob processing in -- 'make_entry.preprocess', only supported with multiprocess opts = opts or {} opts.rg_glob = true @@ -403,8 +403,8 @@ M.grep_curbuf = function(opts, lgrep) opts.grep_opts = make_entry.rg_insert_args(config.globals.grep.grep_opts, " --with-filename") opts.exec_empty_query = opts.exec_empty_query == nil and true opts.fzf_opts = vim.tbl_extend("keep", opts.fzf_opts or {}, config.globals.blines.fzf_opts) - -- call `normalize_opts` here as we want to strore all previous - -- optios in the resume data store under the key "bgrep" + -- call `normalize_opts` here as we want to store all previous + -- options in the resume data store under the key "bgrep" -- 3rd arg is an override for resume data store lookup key opts = config.normalize_opts(opts, "grep", "bgrep") if not opts then return end diff --git a/lua/fzf-lua/providers/lsp.lua b/lua/fzf-lua/providers/lsp.lua index 49c18900..a3a21ce6 100644 --- a/lua/fzf-lua/providers/lsp.lua +++ b/lua/fzf-lua/providers/lsp.lua @@ -8,7 +8,7 @@ local make_entry = require "fzf-lua.make_entry" local M = {} -local function handler_capabilty(handler) +local function handler_capability(handler) if utils.__HAS_NVIM_08 then return handler.server_capability else @@ -489,7 +489,7 @@ local function gen_lsp_contents(opts) -- cancel all lingering LSP queries fn_cancel_all(opts) - local async_buf_reqeust = function() + local async_buf_request = function() -- save cancel all fnref so we can cancel all requests -- when using `live_ws_symbols` _, opts._cancel_all = vim.lsp.buf_request(core.CTX().bufnr, @@ -501,10 +501,10 @@ local function gen_lsp_contents(opts) -- E5560: nvim_exec_autocmds must not be called in a lua loop callback nil if vim.in_fast_event() then vim.schedule(function() - async_buf_reqeust() + async_buf_request() end) else - async_buf_reqeust() + async_buf_request() end -- process results from all LSP client @@ -634,7 +634,7 @@ M.finder = function(opts) opts.silent = opts.silent == nil and true or opts.silent opts.no_autoclose = true opts.lsp_handler = handlers[method] - opts.lsp_handler.capability = handler_capabilty(opts.lsp_handler) + opts.lsp_handler.capability = handler_capability(opts.lsp_handler) opts.lsp_params = lsp_params -- reset previous calls params if existed -- returns nil for no client attached, false for unsupported capability @@ -782,7 +782,7 @@ M.live_workspace_symbols = function(opts) utils.map_set(config, "__resume_data.last_query", val) -- also store query for `fzf_resume` (#963) utils.map_set(config, "__resume_data.opts.query", val) - -- store in opts for convinience in action callbacks + -- store in opts for convenience in action callbacks o.last_query = val end opts.__resume_get = function(what, o) @@ -918,9 +918,9 @@ local function wrap_fn(key, fn) return function(opts) opts = opts or {} opts.lsp_handler = handlers[key] - opts.lsp_handler.capability = handler_capabilty(opts.lsp_handler) + opts.lsp_handler.capability = handler_capability(opts.lsp_handler) - -- check_capabilities will print the approperiate warning + -- check_capabilities will print the appropriate warning if not check_capabilities(opts.lsp_handler) then return end diff --git a/lua/fzf-lua/providers/manpages.lua b/lua/fzf-lua/providers/manpages.lua index 64dc2255..794e9493 100644 --- a/lua/fzf-lua/providers/manpages.lua +++ b/lua/fzf-lua/providers/manpages.lua @@ -35,7 +35,7 @@ M.manpages = function(opts) end opts.fn_transform = function(x) - -- split by first occurence of ' - ' (spaced hyphen) + -- split by first occurrence of ' - ' (spaced hyphen) local man, desc = x:match("^(.-) %- (.*)$") return string.format("%-45s %s", man, desc) end diff --git a/lua/fzf-lua/providers/module.lua b/lua/fzf-lua/providers/module.lua index a529058a..31d63097 100644 --- a/lua/fzf-lua/providers/module.lua +++ b/lua/fzf-lua/providers/module.lua @@ -22,7 +22,7 @@ M.metatable = function(opts) table.sort(methods, function(a, b) return a < b end) opts.preview = shell.raw_action(function(args) - -- TODO: retreive method help + -- TODO: retrieve method help local help = "" return string.format("%s:%s", args[1], help) end, nil, opts.debug) diff --git a/lua/fzf-lua/providers/ui_select.lua b/lua/fzf-lua/providers/ui_select.lua index c0d465a8..ad90d370 100644 --- a/lua/fzf-lua/providers/ui_select.lua +++ b/lua/fzf-lua/providers/ui_select.lua @@ -113,7 +113,7 @@ M.ui_select = function(items, ui_opts, on_choice) if not selected then -- with `actions.dummy_abort` this doesn't get called anymore -- as the action is configured as a valid fzf "accept" (thus - -- `selected` isn't empty), see below comment for mor info + -- `selected` isn't empty), see below comment for more info on_choice(nil, nil) else o._on_choice_called = nil diff --git a/lua/fzf-lua/shell.lua b/lua/fzf-lua/shell.lua index 56597b14..6d1e97b3 100644 --- a/lua/fzf-lua/shell.lua +++ b/lua/fzf-lua/shell.lua @@ -54,7 +54,7 @@ function M.raw_async_action(fn, fzf_field_expression, debug) local receiving_function = function(pipe_path, ...) local pipe = uv.new_pipe(false) local args = { ... } - -- unesacpe double backslashes on windows + -- unescape double backslashes on windows if type(args[1]) == "table" then args[1] = vim.tbl_map(function(x) return libuv.unescape_fzf(x) end, args[1]) end @@ -94,8 +94,8 @@ function M.raw_async_action(fn, fzf_field_expression, debug) -- we need to add '--' to mark the end of command options otherwise -- our preview command will fail when the selected items contain - -- special shell chars ('+', '-', etc), exmaples where this can - -- happen are the `git status` command and git brances from diff + -- special shell chars ('+', '-', etc), examples where this can + -- happen are the `git status` command and git branches from diff -- worktrees (#600) local action_cmd = ("%s%s -n --headless --clean --cmd %s -- %s"):format( nvim_runtime, diff --git a/lua/fzf-lua/utils.lua b/lua/fzf-lua/utils.lua index a8025d85..cf91e6ef 100644 --- a/lua/fzf-lua/utils.lua +++ b/lua/fzf-lua/utils.lua @@ -483,7 +483,7 @@ local function hex2rgb(hexcol) return r, g, b end --- auto genreate ansi escape sequence from RGB or neovim highlights +-- auto generate ansi escape sequence from RGB or neovim highlights --[[ M.ansi_auto = setmetatable({}, { -- __index metamethod only gets called when the item does not exist -- we use this to auto-cache the ansi escape sequence @@ -746,7 +746,7 @@ function M.fzf_exit() -- Usually called from the LSP module to exit the interface on "async" mode -- when no results are found or when `jump_to_single_result` is used, when -- the latter is used in "sync" mode we also need to make sure core.__CTX - -- is cleared or we'll have the wrong cursor coordiantes (#928) + -- is cleared or we'll have the wrong cursor coordinates (#928) return loadstring([[ require('fzf-lua').core.__CTX = nil require('fzf-lua').win.win_leave() @@ -786,7 +786,7 @@ function M.load_profile_fname(fname, name, silent) if ok and type(res) == "table" then -- success if not silent then - M.info(string.format("Succefully loaded profile '%s'", profile)) + M.info(string.format("Successfully loaded profile '%s'", profile)) end return res elseif silent then @@ -1059,7 +1059,7 @@ end -- without "E5108: Error executing lua Keyboard interrupt" function M.input(prompt) local ok, res - -- NOTE: do not use `vim.ui` yet, a conflcit with `dressing.nvim` + -- NOTE: do not use `vim.ui` yet, a conflict with `dressing.nvim` -- causes the return value to appear as cancellation -- if vim.ui then if false then diff --git a/lua/fzf-lua/win.lua b/lua/fzf-lua/win.lua index f17997a2..a4ac8fe7 100644 --- a/lua/fzf-lua/win.lua +++ b/lua/fzf-lua/win.lua @@ -402,7 +402,7 @@ function FzfWin:set_winopts(win, opts) -- PROBABLY DOESN'T MATTER (WHO USES 0.5?) BUT WHY NOT LOL -- minor backward compatibility fix, with neovim version < 0.7 -- nvim_win_get_option("scroloff") which should return -1 - -- returns an invalid (really big number insead which panics + -- returns an invalid (really big number instead which panics -- when called with nvim_win_set_option, wrapping in a pcall -- ensures this plugin still works for neovim version as low as 0.5! pcall(function() vim.wo[win][opt] = value end) @@ -711,7 +711,7 @@ function FzfWin:redraw_main() win_opts.col = winopts.col or math.floor((columns - win_opts.width) / 2) -- When border chars are empty strings 'nvim_open_win' adjusts - -- the layout to take all avialable space, we use these to adjust + -- the layout to take all available space, we use these to adjust -- our main window height to use all available lines (#364) if type(win_opts.border) == "table" then local function is_empty_str(tbl, arr) @@ -834,7 +834,7 @@ function FzfWin:create() self.winopts.on_create() end -- not sure why but when using a split and reusing the window, - -- fzf will not use all the avialable width until 'redraw' is + -- fzf will not use all the available width until 'redraw' is -- called resulting in misaligned native and builtin previews vim.cmd("redraw") return self.fzf_bufnr diff --git a/tests/libuv_spec.lua b/tests/libuv_spec.lua index 1ee7d117..f64b61f2 100644 --- a/tests/libuv_spec.lua +++ b/tests/libuv_spec.lua @@ -2,14 +2,14 @@ local libuv = require("fzf-lua.libuv") describe("Testing libuv module", function() - it("is_escpaed (posix)", function() + it("is_escaped (posix)", function() assert.is.False(libuv.is_escaped([[]], false)) assert.is.True(libuv.is_escaped([[""]], false)) assert.is.True(libuv.is_escaped([['']], false)) assert.is.True(libuv.is_escaped([['foo']], false)) end) - it("is_escpaed (win)", function() + it("is_escaped (win)", function() assert.is.False(libuv.is_escaped([[]], true)) assert.is.True(libuv.is_escaped([[""]], true)) assert.is.True(libuv.is_escaped([[^"^"]], true))