Skip to content

Commit f1a74ad

Browse files
committed
Re-introduced startswith for alternative editors.
- Sublime Text can refer to "subl" or "sublime". - Emacs can refer to "emacs" or "emacsclient".
1 parent 5ee42ce commit f1a74ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/interactiveutil.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ function edit(file::AbstractString, line::Integer)
2020
f !== nothing && (file = f)
2121
end
2222
const no_line_msg = "Unknown editor: no line number information passed.\nThe method is defined at line $line."
23-
if edname == "emacs" || edname == "gedit"
23+
if startswith(edname, "emacs") || edname == "gedit"
2424
spawn(`$editor +$line $file`)
2525
elseif edname == "vi" || edname == "vim" || edname == "nvim" || edname == "mvim" || edname == "nano"
2626
run(`$editor +$line $file`)
2727
elseif edname == "textmate" || edname == "mate" || edname == "kate"
2828
spawn(`$editor $file -l $line`)
29-
elseif edname == "subl" || edname == "atom"
29+
elseif startswith(edname, "subl") || edname == "atom"
3030
spawn(`$editor $file:$line`)
3131
elseif OS_NAME == :Windows && (edname == "start" || edname == "open")
3232
spawn(`cmd /c start /b $file`)

0 commit comments

Comments
 (0)