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

perf: remove unused context size from ripgrep command #144

Merged
merged 2 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration-tests/cypress/support/tui-sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export type NeovimContext = {

/** Arguments for starting the neovim server. They are built based on your test
* environment in a type safe manner. */
type MyStartNeovimServerArguments = OverrideProperties<
export type MyStartNeovimServerArguments = OverrideProperties<
StartNeovimGenericArguments,
{
filename?:
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@eslint/js": "9.21.0",
"@tui-sandbox/library": "9.3.0",
"@tui-sandbox/library": "9.5.0",
"@types/node": "22.13.5",
"@types/tinycolor2": "1.4.6",
"concurrently": "9.1.2",
Expand Down
11 changes: 5 additions & 6 deletions lua/blink-ripgrep/backends/ripgrep/ripgrep_command.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ function RipgrepCommand.get_command(prefix, options)
"rg",
"--no-config",
"--json",
"--context=" .. options.context_size,
"--word-regexp",
"--max-filesize=" .. options.max_filesize,
options.search_casing,
Expand Down Expand Up @@ -54,17 +53,17 @@ function RipgrepCommand:debugify_for_shell()
-- print the command to :messages for hacky debugging, but don't show it
-- in the ui so that it doesn't interrupt the user's work
local debug_cmd = vim.deepcopy(self.command)
assert(#debug_cmd >= 10)
assert(#debug_cmd >= 9)

-- The pattern is not compatible with shell syntax, so escape it
-- separately. The user should be able to copy paste it into their posix
-- compatible terminal.
local pattern = debug_cmd[9]
local pattern = debug_cmd[8]
assert(pattern)
debug_cmd[9] = "'" .. pattern .. "'"
debug_cmd[8] = "'" .. pattern .. "'"

assert(debug_cmd[10])
debug_cmd[10] = vim.fn.fnameescape(debug_cmd[10])
assert(debug_cmd[9])
debug_cmd[9] = vim.fn.fnameescape(debug_cmd[9])

local things = table.concat(debug_cmd, " ")
vim.api.nvim_exec2("echomsg " .. vim.fn.string(things), {})
Expand Down
30 changes: 15 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions spec/blink-ripgrep/get_command_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ describe("get_command", function()
"rg",
"--no-config",
"--json",
"--context=5",
"--word-regexp",
"--max-filesize=1M",
"--ignore-case",
Expand All @@ -46,7 +45,6 @@ describe("get_command", function()
"rg",
"--no-config",
"--json",
"--context=9",
"--word-regexp",
"--max-filesize=1M",
"--ignore-case",
Expand All @@ -66,7 +64,6 @@ describe("get_command", function()
"rg",
"--no-config",
"--json",
"--context=5",
"--word-regexp",
"--max-filesize=2M",
"--ignore-case",
Expand All @@ -86,7 +83,6 @@ describe("get_command", function()
"rg",
"--no-config",
"--json",
"--context=5",
"--word-regexp",
"--max-filesize=1M",
"--smart-case",
Expand Down
Loading