Skip to content

Commit 65f02b3

Browse files
InteractiveUtils [cosmetic]: tidy editor definitions (#47048)
- fix some nasty long lines and indentiation - remove unnecessary `Any` typed vectors
1 parent fe7f673 commit 65f02b3

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

stdlib/InteractiveUtils/src/editless.jl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ function define_default_editors()
124124
`$cmd $path`
125125
end
126126
# vim family
127-
for (editors, wait) in [[Any["vim", "vi", "nvim", "mvim"], true],
128-
[Any["\bgvim"], false]]
127+
for (editors, wait) in [
128+
[["vim", "vi", "nvim", "mvim"], true],
129+
[[r"\bgvim"], false],
130+
]
129131
define_editor(editors; wait) do cmd, path, line, column
130132
cmd = line == 0 ? `$cmd $path` :
131133
column == 0 ? `$cmd +$line $path` :
@@ -135,27 +137,31 @@ function define_default_editors()
135137
define_editor("nano"; wait=true) do cmd, path, line, column
136138
cmd = `$cmd +$line,$column $path`
137139
end
138-
# emacs (must check that emacs not running in -t/-nw before regex match for general emacs)
139-
for (editors, wait) in [[Any[r"\bemacs"], false],
140-
[Any[r"\bemacs\b.*\s(-nw|--no-window-system)\b", r"\bemacsclient\b.\s*-(-?nw|t|-?tty)\b"], true]]
140+
# emacs (must check that emacs not running in -t/-nw
141+
# before regex match for general emacs)
142+
for (editors, wait) in [
143+
[[r"\bemacs"], false],
144+
[[r"\bemacs\b.*\s(-nw|--no-window-system)\b",
145+
r"\bemacsclient\b.\s*-(-?nw|t|-?tty)\b"], true],
146+
]
141147
define_editor(editors; wait) do cmd, path, line, column
142148
`$cmd +$line:$column $path`
143149
end
144150
end
145-
# Other editors
151+
# other editors
146152
define_editor("gedit") do cmd, path, line, column
147153
`$cmd +$line:$column $path`
148154
end
149-
define_editor(Any["micro", "kak"]; wait=true) do cmd, path, line, column
155+
define_editor(["micro", "kak"]; wait=true) do cmd, path, line, column
150156
`$cmd +$line $path`
151157
end
152-
define_editor(Any["hx", "helix"]; wait=true) do cmd, path, line, column
158+
define_editor(["hx", "helix"]; wait=true) do cmd, path, line, column
153159
`$cmd $path:$line:$column`
154160
end
155161
define_editor(["textmate", "mate", "kate"]) do cmd, path, line, column
156162
`$cmd $path -l $line`
157163
end
158-
define_editor(Any[r"\bsubl", r"\batom", "pycharm", "bbedit"]) do cmd, path, line, column
164+
define_editor([r"\bsubl", r"\batom", "pycharm", "bbedit"]) do cmd, path, line, column
159165
`$cmd $path:$line`
160166
end
161167
define_editor(["code", "code-insiders"]) do cmd, path, line, column

0 commit comments

Comments
 (0)