From 80b9ff1b54f3ee7915cb14cf0b95ce9044f348be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20N=C3=BA=C3=B1ez?= Date: Tue, 9 Jul 2024 09:58:23 +0200 Subject: [PATCH] feat(editor.rb): add support for 'cursor' editor symbol with corresponding URL scheme to open file at specific line using cursor position --- lib/better_errors/editor.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/better_errors/editor.rb b/lib/better_errors/editor.rb index 96ffc3f0..399d17ff 100644 --- a/lib/better_errors/editor.rb +++ b/lib/better_errors/editor.rb @@ -12,6 +12,7 @@ class Editor { symbols: [:textmate, :txmt, :tm], sniff: /mate/i, url: "txmt://open?url=file://%{file}&line=%{line}" }, { symbols: [:vscode, :code], sniff: /code/i, url: "vscode://file/%{file}:%{line}" }, { symbols: [:vscodium, :codium], sniff: /codium/i, url: "vscodium://file/%{file}:%{line}" }, + { symbols: [:cursor], sniff: /cursor/i, url: "cursor://file/%{file}:%{line}" } ] def self.for_formatting_string(formatting_string) @@ -80,7 +81,7 @@ def url(raw_path, line) else file = raw_path end - + url_proc.call(file, line) end