Skip to content

Commit

Permalink
- Fixed handling of leading spaces
Browse files Browse the repository at this point in the history
- Fixed handling of " in autohotkey backend
  • Loading branch information
iarwain committed Jun 23, 2020
1 parent 8ba0b3a commit 1528e7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions text2key.r
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ autohotkey: make backend [
foreach line lines [
either remove-count > 0 [
emit {SendEvent {Insert}}
emit rejoin [{S("} replace/all system/words/copy line {;} {`;} {")}]
emit rejoin [{S("} replace/all replace/all system/words/copy line {;} {`;} {"} {""} {")}]
if (length? line) < (length? remove-data/1) [
emit {SendEvent {Shift Down}{End}{Shift Up}{Delete}}
]
emit {SendEvent {Right}}
emit {SendEvent {Insert}}
] [
emit rejoin [{S("} replace/all system/words/copy line {;} {`;} {`n} {")}]
emit rejoin [{S("} replace/all replace/all system/words/copy line {;} {`;} {"} {""} {`n} {")}]
]
remove-count: remove-count - 1
remove-data: next remove-data
Expand All @@ -94,7 +94,7 @@ autohotkey: make backend [
emit {SendEvent {Up}}
]
forall lines [
text: replace/all system/words/copy lines/1 {;} {`;}
text: replace/all replace/all system/words/copy lines/1 {;} {`;} {"} {""}
if any [not carry not last? lines] [
append text {`n}
]
Expand Down Expand Up @@ -173,7 +173,7 @@ either attempt [exists? file: to-rebol-file system/options/args/1] [

; === Parse sections and steps ===
do funct [] [
label: [integer! opt ["." integer!]]
label: [spaces opt #"-" integer! opt ["." integer!]]
option-marker: #":"
option-value: complement charset reduce [option-marker #"]"]
option: [
Expand Down Expand Up @@ -210,7 +210,7 @@ either attempt [exists? file: to-rebol-file system/options/args/1] [
] 0 []

print [{== Parsing [} to-local-file file {]}]
parse read file [
parse/all read file [
any [
section-marker (current: add-section section actions)
| key-marker
Expand Down

0 comments on commit 1528e7e

Please sign in to comment.