diff --git a/lua/grug-far.lua b/lua/grug-far.lua index 09932020..b12de47d 100644 --- a/lua/grug-far.lua +++ b/lua/grug-far.lua @@ -53,7 +53,7 @@ local function ensure_instance(instanceName) return inst end --- note: unfortunatly has to be global so it can be passed to command complete= opt +-- note: unfortunately has to be global so it can be passed to command complete= opt -- selene: allow(unused_variable) function GrugFarCompleteEngine() return table.concat(vim.fn.keys(opts.defaultOptions.engines), '\n') diff --git a/lua/grug-far/actions/search.lua b/lua/grug-far/actions/search.lua index 41b00b44..17747373 100644 --- a/lua/grug-far/actions/search.lua +++ b/lua/grug-far/actions/search.lua @@ -36,7 +36,7 @@ local function search(params) state.stats = { matches = 0, files = 0 } state.actionMessage = nil - -- note: we clear first time we fetch more info instead of intially + -- note: we clear first time we fetch more info instead of initially -- in order to reduce flicker local isCleared = false local effectiveArgs diff --git a/lua/grug-far/actions/sync.lua b/lua/grug-far/actions/sync.lua index 967b924f..1eb15c08 100644 --- a/lua/grug-far/actions/sync.lua +++ b/lua/grug-far/actions/sync.lua @@ -96,7 +96,7 @@ local function sync(params) end if not context.engine.isSyncSupported() then - state.actionMessage = 'sync operation not suppored by current engine!' + state.actionMessage = 'sync operation not supported by current engine!' renderResultsHeader(buf, context) vim.notify('grug-far: ' .. state.actionMessage, vim.log.levels.INFO) return diff --git a/lua/grug-far/engine.lua b/lua/grug-far/engine.lua index ee081341..ec896a22 100644 --- a/lua/grug-far/engine.lua +++ b/lua/grug-far/engine.lua @@ -52,7 +52,7 @@ M.DiffSeparatorChars = ' ' ---@field options GrugFarOptions ---@field replacementInterpreter? GrugFarReplacementInterpreter ---@field on_fetch_chunk fun(data: ParsedResultsData) ----@field on_finish fun(status: GrugFarStatus, errorMesage: string?, customActionMessage: string?) +---@field on_finish fun(status: GrugFarStatus, errorMessage: string?, customActionMessage: string?) ---@class EngineReplaceParams ---@field inputs GrugFarInputs @@ -74,7 +74,7 @@ M.DiffSeparatorChars = ' ' ---@field options GrugFarOptions ---@field changedFiles ChangedFile[] ---@field report_progress fun(update: { type: "update_total" | "update_count", count: integer }) ----@field on_finish fun(status: GrugFarStatus, errorMesage: string?, customActionMessage: string?) +---@field on_finish fun(status: GrugFarStatus, errorMessage: string?, customActionMessage: string?) ---@class GrugFarEngine ---@field type GrugFarEngineType diff --git a/lua/grug-far/engine/ProcessingQueue.lua b/lua/grug-far/engine/ProcessingQueue.lua index b8f9d5c4..528b3af3 100644 --- a/lua/grug-far/engine/ProcessingQueue.lua +++ b/lua/grug-far/engine/ProcessingQueue.lua @@ -4,7 +4,7 @@ M.__index = M --- a processing queue processes each item pushed to it in sequence --- until there are none. If more items are pushed it automatically starts ---- procesing again +--- processing again ---@param processCallback fun(item: any, on_done: fun()) function M.new(processCallback) local self = setmetatable({}, M) diff --git a/lua/grug-far/engine/astgrep/getArgs.lua b/lua/grug-far/engine/astgrep/getArgs.lua index 797b36ca..88e885df 100644 --- a/lua/grug-far/engine/astgrep/getArgs.lua +++ b/lua/grug-far/engine/astgrep/getArgs.lua @@ -72,7 +72,7 @@ local function getArgs(inputs, options, extraArgs, blacklistedFlags, forceReplac end local version = getAstgrepVersion(options) - -- note: astgrep added --glob suport in v0.28.0 + -- note: astgrep added --glob support in v0.28.0 if #inputs.filesFilter > 0 and version and vim.version.gt(version, '0.27.999') then for _, fileFilter in ipairs(vim.split(inputs.filesFilter, '\n')) do local glob = vim.trim(fileFilter) diff --git a/lua/grug-far/engine/astgrep/replace.lua b/lua/grug-far/engine/astgrep/replace.lua index 1901f95b..f9e00ae3 100644 --- a/lua/grug-far/engine/astgrep/replace.lua +++ b/lua/grug-far/engine/astgrep/replace.lua @@ -165,7 +165,7 @@ function M.replace(params) local filesFilter = params.inputs.filesFilter local version = getAstgrepVersion(params.options) if filesFilter and #filesFilter > 0 and version and vim.version.lt(version, '0.28.0') then - -- note: astgrep added --glob suport in v0.28.0 + -- note: astgrep added --glob support in v0.28.0 -- this if-branch uses rg to get the files and can be removed in the future once everybody uses new astgrep on_abort = fetchFilteredFilesList({ inputs = params.inputs, @@ -206,7 +206,7 @@ function M.replace(params) cmd_path = params.options.engines.astgrep.path, args = chunk_args, on_fetch_chunk = function() - -- astgrep does not report progess while replacing + -- astgrep does not report progress while replacing end, on_finish = on_finish_chunk, }) @@ -224,7 +224,7 @@ function M.replace(params) cmd_path = params.options.engines.astgrep.path, args = args, on_fetch_chunk = function() - -- astgrep does not report progess while replacing + -- astgrep does not report progress while replacing end, on_finish = on_finish, }) diff --git a/lua/grug-far/engine/astgrep/search.lua b/lua/grug-far/engine/astgrep/search.lua index deae8cee..f91e5ccc 100644 --- a/lua/grug-far/engine/astgrep/search.lua +++ b/lua/grug-far/engine/astgrep/search.lua @@ -175,7 +175,7 @@ function M.search(params) local filesFilter = params.inputs.filesFilter local version = getAstgrepVersion(params.options) if filesFilter and #filesFilter > 0 and version and vim.version.gt(version, '0.28.0') then - -- note: astgrep added --glob suport in v0.28.0 + -- note: astgrep added --glob support in v0.28.0 -- this if-branch uses rg to get the files and can be removed in the future once everybody uses new astgrep local on_abort = nil diff --git a/lua/grug-far/engine/fetchCommandOutput.lua b/lua/grug-far/engine/fetchCommandOutput.lua index cc494a66..ad3c35df 100644 --- a/lua/grug-far/engine/fetchCommandOutput.lua +++ b/lua/grug-far/engine/fetchCommandOutput.lua @@ -5,7 +5,7 @@ local uv = vim.uv ---@field cmd_path string ---@field args string[]? ---@field on_fetch_chunk fun(data: string) ----@field on_finish fun(status: GrugFarStatus, errorMesage: string?) +---@field on_finish fun(status: GrugFarStatus, errorMessage: string?) ---@field stdin? uv_pipe_t ---@field fixChunkLineTruncation? boolean diff --git a/lua/grug-far/engine/ripgrep/fetchFilesWithMatches.lua b/lua/grug-far/engine/ripgrep/fetchFilesWithMatches.lua index 5d2f6c15..7b3e0479 100644 --- a/lua/grug-far/engine/ripgrep/fetchFilesWithMatches.lua +++ b/lua/grug-far/engine/ripgrep/fetchFilesWithMatches.lua @@ -6,7 +6,7 @@ local fetchCommandOutput = require('grug-far.engine.fetchCommandOutput') ---@field inputs GrugFarInputs ---@field options GrugFarOptions ---@field report_progress fun(count: integer) ----@field on_finish fun(status: GrugFarStatus, errorMesage: string?, filesWithMatches: string[], blacklistedArgs: string[]?) +---@field on_finish fun(status: GrugFarStatus, errorMessage: string?, filesWithMatches: string[], blacklistedArgs: string[]?) --- fetch list of files that match search ---@param params FetchWithMatchesParams diff --git a/lua/grug-far/engine/ripgrep/fetchFilteredFilesList.lua b/lua/grug-far/engine/ripgrep/fetchFilteredFilesList.lua index 91161019..5cc64917 100644 --- a/lua/grug-far/engine/ripgrep/fetchFilteredFilesList.lua +++ b/lua/grug-far/engine/ripgrep/fetchFilteredFilesList.lua @@ -5,7 +5,7 @@ local fetchCommandOutput = require('grug-far.engine.fetchCommandOutput') ---@field inputs GrugFarInputs ---@field options GrugFarOptions ---@field report_progress fun(count: integer) ----@field on_finish fun(status: GrugFarStatus, errorMesage: string?, files: string[]) +---@field on_finish fun(status: GrugFarStatus, errorMessage: string?, files: string[]) --- fetch list of files that match filter and paths ---@param params FetchFilteredFilesListParams diff --git a/lua/grug-far/engine/ripgrep/fetchReplacedFileContent.lua b/lua/grug-far/engine/ripgrep/fetchReplacedFileContent.lua index d4a47f11..eb683bc0 100644 --- a/lua/grug-far/engine/ripgrep/fetchReplacedFileContent.lua +++ b/lua/grug-far/engine/ripgrep/fetchReplacedFileContent.lua @@ -7,7 +7,7 @@ local uv = vim.uv ---@field inputs GrugFarInputs ---@field options GrugFarOptions ---@field file string ----@field on_finish fun(status: GrugFarStatus, errorMesage: string | nil, content: string?) +---@field on_finish fun(status: GrugFarStatus, errorMessage: string | nil, content: string?) --- fetch file content with matches replaced ---@param params FetchReplacedFileContentParams diff --git a/lua/grug-far/engine/ripgrep/search.lua b/lua/grug-far/engine/ripgrep/search.lua index 718de26d..8b2ac6b8 100644 --- a/lua/grug-far/engine/ripgrep/search.lua +++ b/lua/grug-far/engine/ripgrep/search.lua @@ -39,7 +39,7 @@ end ---@field json_data RipgrepJson[] ---@field options GrugFarOptions ---@field inputs GrugFarInputs ----@field on_finish fun(status: GrugFarStatus, errorMesage: string?, results: ParsedResultsData?) +---@field on_finish fun(status: GrugFarStatus, errorMessage: string?, results: ParsedResultsData?) --- adds results of doing a replace to results of doing a search ---@param params ResultsWithReplaceDiffParams @@ -123,7 +123,7 @@ end ---@field options GrugFarOptions ---@field inputs GrugFarInputs ---@field on_fetch_chunk fun(data: ParsedResultsData) ----@field on_finish fun(status: GrugFarStatus, errorMesage: string?, customActionMessage: string?) +---@field on_finish fun(status: GrugFarStatus, errorMessage: string?, customActionMessage: string?) --- runs search ---@param params RipgrepEngineSearchParams diff --git a/lua/grug-far/engine/ripgrep/sync.lua b/lua/grug-far/engine/ripgrep/sync.lua index 104d4300..e4374cff 100644 --- a/lua/grug-far/engine/ripgrep/sync.lua +++ b/lua/grug-far/engine/ripgrep/sync.lua @@ -31,7 +31,7 @@ M.sync = function(params) end if isMultilineSearchReplace(args) then - on_finish(nil, nil, 'sync disabled for multline search/replace!') + on_finish(nil, nil, 'sync disabled for multiline search/replace!') return end diff --git a/lua/grug-far/farBuffer.lua b/lua/grug-far/farBuffer.lua index 11c92232..3b1d1451 100644 --- a/lua/grug-far/farBuffer.lua +++ b/lua/grug-far/farBuffer.lua @@ -183,7 +183,7 @@ local function getActions(buf, context) { text = 'Swap Replacement Interpreter', keymap = keymaps.swapReplacementInterpreter, - description = 'Swap replacement interpreter with the next one. For example, with the "lua" interpeter, you can use lua to generate your replacement for each match.', + description = 'Swap replacement interpreter with the next one. For example, with the "lua" interpreter, you can use lua to generate your replacement for each match.', action = function() swapReplacementInterpreter({ buf = buf, context = context }) end, diff --git a/lua/grug-far/opts.lua b/lua/grug-far/opts.lua index 25fdaf34..393f5f9c 100644 --- a/lua/grug-far/opts.lua +++ b/lua/grug-far/opts.lua @@ -102,9 +102,9 @@ M.defaultOptions = { -- Supported: -- * 'default': treat replacement as a string to pass to the current engine -- * 'lua': treat replacement as lua function body where search match is identified by `match` and - -- meta variables (with astgrep for example) are avaible in `vars` table (ex: `vars.A` captures `$A`) + -- meta variables (with astgrep for example) are available in `vars` table (ex: `vars.A` captures `$A`) -- * 'vimscript': treat replacement as vimscript function body where search match is identified by `match` and - -- meta variables (with astgrep for example) are avaible in `vars` table (ex: `vars.A` captures `$A`) + -- meta variables (with astgrep for example) are available in `vars` table (ex: `vars.A` captures `$A`) enabledReplacementInterpreters = { 'default', 'lua', 'vimscript' }, -- which replacement interprer to use @@ -133,7 +133,7 @@ M.defaultOptions = { -- static title to use for grug-far buffer, as opposed to the dynamically generated title. -- Note that nvim does not allow multiple buffers with the same name, so this option is meant more - -- as something to be speficied for a particular instance as opposed to something set in the setup function + -- as something to be specified for a particular instance as opposed to something set in the setup function -- nil or '' disables it staticTitle = nil, @@ -288,7 +288,7 @@ M.defaultOptions = { -- unique instance name. This is used as a handle to refer to a particular instance of grug-far when -- toggling visibility, etc. - -- As this needs to be unique per instance, this option is meant to be speficied for a particular instance + -- As this needs to be unique per instance, this option is meant to be specified for a particular instance -- as opposed to something set in the setup function instanceName = nil, diff --git a/lua/grug-far/render/resultsList.lua b/lua/grug-far/render/resultsList.lua index 9b7e92b2..4bea9737 100644 --- a/lua/grug-far/render/resultsList.lua +++ b/lua/grug-far/render/resultsList.lua @@ -413,7 +413,7 @@ function M.appendSearchCommand(buf, context, rgArgs) ) end ---- force redraws buffer. This is order to apear more responsive to the user +--- force redraws buffer. This is order to appear more responsive to the user --- and quickly give user feedback as results come in / data is updated --- note that only the "top" range of lines is redrawn, including a bunch of lines --- after headerRow so that we immediately get error messages to show up diff --git a/lua/grug-far/replacementInterpreter.lua b/lua/grug-far/replacementInterpreter.lua index 5b9396b2..b6c157e7 100644 --- a/lua/grug-far/replacementInterpreter.lua +++ b/lua/grug-far/replacementInterpreter.lua @@ -31,7 +31,7 @@ function M.setReplacementInterpreter(buf, context, type) return end - -- clear results as it can be slow to clear sytnax highlight otherwise + -- clear results as it can be slow to clear syntax highlight otherwise resultsList.clear(buf, context) -- clear old syntax highlighting diff --git a/tests/astgrep/test_sync.lua b/tests/astgrep/test_sync.lua index b277d289..4fccee94 100644 --- a/tests/astgrep/test_sync.lua +++ b/tests/astgrep/test_sync.lua @@ -46,7 +46,7 @@ T['sync all is not supported'] = function() child.type_keys('' .. keymaps.syncLocations.n) - helpers.childWaitForUIVirtualText(child, 'sync operation not suppored') + helpers.childWaitForUIVirtualText(child, 'sync operation not supported') end T['sync line is not supported'] = function() @@ -80,7 +80,7 @@ T['sync line is not supported'] = function() child.type_keys('' .. keymaps.syncLine.n) - helpers.childWaitForUIVirtualText(child, 'sync operation not suppored') + helpers.childWaitForUIVirtualText(child, 'sync operation not supported') end return T diff --git a/tests/base/test_utils.lua b/tests/base/test_utils.lua index 25691a83..5ce47655 100644 --- a/tests/base/test_utils.lua +++ b/tests/base/test_utils.lua @@ -9,7 +9,7 @@ describe('strEllideAfter', function() it('returns string if strlen < n', function() expect.equality('hello world', utils.strEllideAfter('hello world', 20)) end) - it('returns ellided strign if strlen > n', function() + it('returns ellided string if strlen > n', function() expect.equality('hello...', utils.strEllideAfter('hello world', 5)) end) it('adds prefix if proficed', function() diff --git a/tests/screenshots/tests-base-test_sync.lua---is-prevented-when-multiline-search b/tests/screenshots/tests-base-test_sync.lua---is-prevented-when-multiline-search index 61c91bdd..c18fdf59 100644 --- a/tests/screenshots/tests-base-test_sync.lua---is-prevented-when-multiline-search +++ b/tests/screenshots/tests-base-test_sync.lua---is-prevented-when-multiline-search @@ -13,7 +13,7 @@ 12| 13| 14| STATUS_READY ⟪ ripgrep ⟫ -15| 5 matches in 2 files  sync disabled for multline search/replace! +15| 5 matches in 2 files  sync disabled for multiline search/replace! 16| 17|file1.txt 18|3:13: then grug swims a deep depth indeed! [2] @@ -39,7 +39,7 @@ 12|11111111111111111111111111111111111111111111111111111111111111111111111111111111 13|11111111111111111111111111111111111111111111111111111111111111111111111111111111 14|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -15|33333333333333333333330000000000000000000000000000000000000000000001111111111111 +15|33333333333333333333330000000000000000000000000000000000000000000000111111111111 16|11111111111111111111111111111111111111111111111111111111111111111111111111111111 17|44444444411111111111111111111111111111111111111111111111111111111111111111111111 18|51551111111111111444411111111111111111111111111111111111111111111111111111112222