Skip to content

Commit 69d84e4

Browse files
authored
Merge pull request #21 from SimonDanisch/asinghvi17-patch-1
Asinghvi17 patch 1
2 parents f265ed5 + 38d830f commit 69d84e4

File tree

9 files changed

+55
-360
lines changed

9 files changed

+55
-360
lines changed

Manifest.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
[[Base64]]
4+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
5+
6+
[[InteractiveUtils]]
7+
deps = ["Markdown"]
8+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
9+
10+
[[Markdown]]
11+
deps = ["Base64"]
12+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
13+
14+
[[REPL]]
15+
deps = ["InteractiveUtils", "Markdown", "Sockets"]
16+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
17+
18+
[[Sockets]]
19+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

Project.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name = "UnicodeFun"
2+
uuid = "1cfade01-22cf-5700-b092-accc4b62d6e1"
3+
authors = ["Simon Danisch"]
4+
version = "0.4.0"
5+
6+
[deps]
7+
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
8+
9+
[compat]
10+
julia = "1"
11+
12+
[extras]
13+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
14+
15+
[targets]
16+
test = ["Test"]

REQUIRE

Lines changed: 0 additions & 1 deletion
This file was deleted.

appveyor.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1+
# Documentation: https://github.com/JuliaCI/Appveyor.jl
12
environment:
23
matrix:
3-
- julia_version: 1
4+
- julia_version: 1.3
45
- julia_version: nightly
5-
66
platform:
7-
- x86 # 32-bit
8-
- x64 # 64-bit
9-
7+
- x86
8+
- x64
9+
matrix:
10+
allow_failures:
11+
- julia_version: nightly
1012
branches:
1113
only:
1214
- master
1315
- /release-.*/
14-
1516
notifications:
1617
- provider: Email
1718
on_build_success: false
1819
on_build_failure: false
1920
on_build_status_changed: false
20-
2121
install:
2222
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
23-
2423
build_script:
2524
- echo "%JL_BUILD_SCRIPT%"
2625
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
27-
2826
test_script:
2927
- echo "%JL_TEST_SCRIPT%"
3028
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
29+
on_success:
30+
- echo "%JL_CODECOV_SCRIPT%"
31+
- C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"

src/UnicodeFun.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
module UnicodeFun
22

3-
include("symbols.jl")
3+
using REPL
4+
5+
# Here, we collect and reverse the REPL's latex autocompletion map.
6+
const symbols_unsorted = [k[2:end] => v[1] for (k, v) in REPL.REPLCompletions.latex_symbols]
7+
8+
const latex_symbol_map = sort!(symbols_unsorted, by=(x)-> length(x[1]), rev=true)
49

510
include("sub_super_scripts.jl")
611
export to_superscript, to_subscript

src/latex.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ function to_latex(text)
5656
end
5757
if mod == "\\" # no match was found
5858
# is this a latex symbol?
59-
for (k,v) in latex_symbol_map
59+
for (k, v) in latex_symbol_map
6060
if startswith(ss, k)
6161
print(io, v) # replace
62-
for i=1:length(k) # move forward
62+
for i in 1:length(k) # move forward
6363
idx = nextind(text, idx)
6464
end
6565
break
6666
end
6767
end
6868
continue # ignore '\' mod
6969
else
70-
for i=1:length(mod) # move forward
70+
for i in 1:length(mod) # move forward
7171
idx = nextind(text, idx)
7272
end
7373
end

src/sub_super_scripts.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ function to_superscript(io::IO, x::AbstractString)
1414
end
1515
end
1616

17-
18-
1917
function to_subscript(io::IO, x::Int)
2018
if x in 0:9
2119
print(io, Char(0x2080+x))

0 commit comments

Comments
 (0)