Skip to content

Commit

Permalink
Allow opening files in Nova editor
Browse files Browse the repository at this point in the history
  • Loading branch information
goulvench committed May 21, 2023
1 parent 55ce4f6 commit 8e2f978
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/better_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def self.editor
# * `:textmate`, `:txmt`, `:tm`
# * `:sublime`, `:subl`, `:st`
# * `:macvim`
# * `:nova`
# * `:atom`
#
# @param [Symbol] sym
Expand Down
1 change: 1 addition & 0 deletions lib/better_errors/editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Editor
{ symbols: [:emacs, :emacsclient], sniff: /emacs/i, url: "emacs://open?url=file://%{file}&line=%{line}" },
{ symbols: [:idea], sniff: /idea/i, url: "idea://open?file=%{file}&line=%{line}" },
{ symbols: [:macvim, :mvim], sniff: /vim/i, url: "mvim://open?url=file://%{file_unencoded}&line=%{line}" },
{ symbols: [:nova], sniff: /nova/i, url: "nova://open?path=%{file}&line=%{line}" },
{ symbols: [:rubymine], sniff: /mine/i, url: "x-mine://open?file=%{file}&line=%{line}" },
{ symbols: [:sublime, :subl, :st], sniff: /subl/i, url: "subl://open?url=file://%{file}&line=%{line}" },
{ symbols: [:textmate, :txmt, :tm], sniff: /mate/i, url: "txmt://open?url=file://%{file}&line=%{line}" },
Expand Down
10 changes: 10 additions & 0 deletions spec/better_errors/editor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@
end
end

[:nova].each do |symbol|
context "when symbol is '#{symbol}'" do
let(:symbol) { symbol }

it "uses txmt:// scheme" do
expect(subject.url("file", 42)).to start_with("nova://")
end
end
end

[:sublime, :subl, :st].each do |symbol|
context "when symbol is '#{symbol}'" do
let(:symbol) { symbol }
Expand Down

0 comments on commit 8e2f978

Please sign in to comment.