Skip to content

Commit

Permalink
InteractiveUtils [cosmetic]: tidy editor definitions (#47048)
Browse files Browse the repository at this point in the history
- fix some nasty long lines and indentiation
- remove unnecessary `Any` typed vectors
  • Loading branch information
StefanKarpinski authored Oct 5, 2022
1 parent fe7f673 commit 65f02b3
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions stdlib/InteractiveUtils/src/editless.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ function define_default_editors()
`$cmd $path`
end
# vim family
for (editors, wait) in [[Any["vim", "vi", "nvim", "mvim"], true],
[Any["\bgvim"], false]]
for (editors, wait) in [
[["vim", "vi", "nvim", "mvim"], true],
[[r"\bgvim"], false],
]
define_editor(editors; wait) do cmd, path, line, column
cmd = line == 0 ? `$cmd $path` :
column == 0 ? `$cmd +$line $path` :
Expand All @@ -135,27 +137,31 @@ function define_default_editors()
define_editor("nano"; wait=true) do cmd, path, line, column
cmd = `$cmd +$line,$column $path`
end
# emacs (must check that emacs not running in -t/-nw before regex match for general emacs)
for (editors, wait) in [[Any[r"\bemacs"], false],
[Any[r"\bemacs\b.*\s(-nw|--no-window-system)\b", r"\bemacsclient\b.\s*-(-?nw|t|-?tty)\b"], true]]
# emacs (must check that emacs not running in -t/-nw
# before regex match for general emacs)
for (editors, wait) in [
[[r"\bemacs"], false],
[[r"\bemacs\b.*\s(-nw|--no-window-system)\b",
r"\bemacsclient\b.\s*-(-?nw|t|-?tty)\b"], true],
]
define_editor(editors; wait) do cmd, path, line, column
`$cmd +$line:$column $path`
end
end
# Other editors
# other editors
define_editor("gedit") do cmd, path, line, column
`$cmd +$line:$column $path`
end
define_editor(Any["micro", "kak"]; wait=true) do cmd, path, line, column
define_editor(["micro", "kak"]; wait=true) do cmd, path, line, column
`$cmd +$line $path`
end
define_editor(Any["hx", "helix"]; wait=true) do cmd, path, line, column
define_editor(["hx", "helix"]; wait=true) do cmd, path, line, column
`$cmd $path:$line:$column`
end
define_editor(["textmate", "mate", "kate"]) do cmd, path, line, column
`$cmd $path -l $line`
end
define_editor(Any[r"\bsubl", r"\batom", "pycharm", "bbedit"]) do cmd, path, line, column
define_editor([r"\bsubl", r"\batom", "pycharm", "bbedit"]) do cmd, path, line, column
`$cmd $path:$line`
end
define_editor(["code", "code-insiders"]) do cmd, path, line, column
Expand Down

2 comments on commit 65f02b3

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

Please sign in to comment.