forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Notepad++_2_Julia.ahk
74 lines (63 loc) · 1.07 KB
/
Notepad++_2_Julia.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
global hasRunJulia = 0
global JuliaPID = 0
global NppPID = 0
OpenJulia()
{
if %hasRunJulia% = 0
{
Run julia.bat,,,JuliaPID
hasRunJulia = 1
ReturnToNpp()
return
}
Process, Exist, %JuliaPID%
if %ErrorLevel% = 0
{
Run julia.bat,,,JuliaPID
hasRunJulia = 1
ReturnToNpp()
return
}
}
ReOpenJulia()
{
WinClose, ahk_pid %JuliaPID%
OpenJulia()
}
SendToJulia()
{
OpenJulia()
WinWait, ahk_pid %JuliaPID%
WinActivate, ahk_pid %JuliaPID%
WinWaitActive, ahk_pid %JuliaPID%
Send {Alt Down}{Space}{Alt up}ep{Enter}
}
ReturnToNpp()
{
WinActivate, ahk_pid %NppPID%
}
PassLine()
{
WinGetCLASS, currentClass, A
If currentClass = Notepad++
{
WinGet, NppPID, PID, A
send {Home}{Shift Down}{End}{Shift Up}{Ctrl Down}c{Ctrl Up}{End}
SendToJulia()
ReturnToNpp()
}
}
PassBlock()
{
WinGetCLASS, currentClass, A
If currentClass = Notepad++
{
WinGet, NppPID, PID, A
send {Ctrl Down}c{Ctrl Up}
SendToJulia()
ReturnToNpp()
}
}
LShift & Enter:: PassLine()
Ctrl & d:: PassBlock()
$F3:: ReOpenJulia()