Closed frenchy64 closed 1 year ago
Without digging in, I'll propose the following blind change you can try out:
diff --git i/autoload/fireplace.vim w/autoload/fireplace.vim
index 2306a70..8728514 100644
--- i/autoload/fireplace.vim
+++ w/autoload/fireplace.vim
@@ -1183,13 +1183,13 @@ endfunction
function! s:temp_response(response, ext) abort
let output = []
- call extend(output, map(split(get(a:response, 'err', ''), "\n"), '";!".v:val'))
- call extend(output, map(split(get(a:response, 'out', ''), "\n"), '";=".v:val'))
+ call extend(output, map(split(get(a:response, 'err', ''), "\n", 1), '";!".v:val'))
+ call extend(output, map(split(get(a:response, 'out', ''), "\n", 1), '";=".v:val'))
for str in type(get(a:response, 'value')) == v:t_string ? [a:response.value] : get(a:response, 'value', [])
- call extend(output, split(str, "\n"))
+ call extend(output, split(str, "\n", 1))
endfor
let temp = tempname() . '.' . a:ext
- call writefile(output, temp)
+ call writefile(output, temp, 'b')
return temp
endfunction
The 1
parameter allows split()
to return a blank string after the last line, and the b
parameter enables binary writing, preventing adding an extra newline at the end. (We're fixing 2 quasi-bugs that mostly cancel each other out.)
I don't think it's likely this will single-handedly fix it, but hopefully it will provide a clearer picture as to why it's adding ;=
in a place without a newline.
Seems unchanged AFAICT.
Sanity check, my git diff (git apply
failed, I manually copied):
diff --git a/autoload/fireplace.vim b/autoload/fireplace.vim
index 2306a70..8728514 100644
--- a/autoload/fireplace.vim
+++ b/autoload/fireplace.vim
@@ -1183,13 +1183,13 @@ endfunction
function! s:temp_response(response, ext) abort
let output = []
- call extend(output, map(split(get(a:response, 'err', ''), "\n"), '";!".v:val'))
- call extend(output, map(split(get(a:response, 'out', ''), "\n"), '";=".v:val'))
+ call extend(output, map(split(get(a:response, 'err', ''), "\n", 1), '";!".v:val'))
+ call extend(output, map(split(get(a:response, 'out', ''), "\n", 1), '";=".v:val'))
for str in type(get(a:response, 'value')) == v:t_string ? [a:response.value] : get(a:response, 'value', [])
- call extend(output, split(str, "\n"))
+ call extend(output, split(str, "\n", 1))
endfor
let temp = tempname() . '.' . a:ext
- call writefile(output, temp)
+ call writefile(output, temp, 'b')
return temp
endfunction
(prn
[[{62 "HP", 63 "CB"} {62 "HP", 64 "CB"} {63 "HP", 64 "CB"}]
[{62 "K2"} {63 "K2"} {64 "K2"} {65 "K2"} {66 "K2"}]
[{63 "K1"} {64 "K1"} {65 "K1"} {66 "K1"} {67 "K1"}]
[{65 "T5"} {66 "T5"} {67 "T5"} {68 "T5"} {69 "T5"}]
[{67 "T4"} {68 "T4"} {69 "T4"} {70 "T4"} {71 "T4"}]
[{69 "T3"} {70 "T3"} {71 "T3"} {72 "T3"} {73 "T3"}]
[{70 "RS", 71 "SC", 72 "SS"}
{70 "RS", 71 "SC", 73 "SS"}
{70 "RS", 71 "SC", 74 "SS"}
{70 "RS", 72 "SC", 73 "SS"}
{70 "RS", 72 "SC", 74 "SS"}
{70 "RS", 73 "SC", 74 "SS"}
{71 "RS", 72 "SC", 73 "SS"}
{71 "RS", 72 "SC", 74 "SS"}
{71 "RS", 73 "SC", 74 "SS"}
{72 "RS", 73 "SC", 74 "SS"}]
[{72 "T2"} {73 "T2"} {74 "T2"} {75 "T2"} {76 "T2"}]
[{74 "T1"} {75 "T1"} {76 "T1"} {77 "T1"} {78 "T1"}]
[{75 "RM", 76 "RB", 77 "RE"}
{75 "RM", 76 "RB", 78 "RE"}
{75 "RM", 76 "RB", 79 "RE"}
{75 "RM", 77 "RB", 78 "RE"}
{75 "RM", 77 "RB", 79 "RE"}
{75 "RM", 78 "RB", 79 "RE"}
{76 "RM", 77 "RB", 78 "RE"}
{76 "RM", 77 "RB", 79 "RE"}
{76 "RM", 78 "RB", 79 "RE"}
{77 "RM", 78 "RB", 79 "RE"}]
[{77 "HC", 78 "HH", 79 "HO", 80 "C2"}
{77 "HC", 78 "HH", 79 "HO", 81 "C2"}
{77 "HC", 78 "HH", 80 "HO", 81 "C2"}
{77 "HC", 79 "HH", 80 "HO", 81 "C2"}
{78 "HC", 79 "HH", 80 "HO", 81 "C2"}]
[{79 "C1", 80 "SP"}
{79 "C1", 81 "SP"}
{79 "C1", 82 "SP"}
{79 "C1", 83 "SP"}
{80 "C1", 81 "SP"}
{80 "C1", 82 "SP"}
{80 "C1", 83 "SP"}
{81 "C1", 82 "SP"}
{81 "C1", 83 "SP"}
{82 "C1", 83 "SP"}]
[{81 "CH"} {82 "CH"} {83 "CH"} {84 "CH"} {85 "CH"}]])
;=[[{62 "HP", 63 "CB"} {62 "HP", 64 "CB"} {63 "HP", 64 "CB"}] [{62 "K2"} {63 "K2"} {64 "K2"} {65 "K2"} {66 "K2"}] [{63 "K1"} {64 "K1"} {65 "K1"} {66 "K1"} {67 "K1"}] [{65 "T5"} {66 "T5"} {67 "T5"} {68 "T5"} {69 "T5"}] [{67 "T4"} {68 "T4"} {69 "T4"} {70 "T4"} {71 "T4"}] [{69 "T3"} {70 "T3"} {71 "T3"} {72 "T3"} {73 "T3"}] [{70 "RS", 71 "SC", 72 "SS"} {70 "RS", 71 "SC", 73 "SS"} {70 "RS", 71 "SC", 74 "SS"} {70 "RS", 72 "SC", 73 "SS"} {70 "RS", 72 "SC", 74 "SS"} {70 "RS", 73 "SC", 74 "SS"} {71 "RS", 72 "SC", 73 "SS"} {71 "RS", 72 "SC", 74 "SS"} {71 "RS", 73 "SC", 74 "SS"} {72 "RS", 73 "SC", 74 "SS"}] [{72 "T2"} {73 "T2"} {74 "T2"} {75 "T2"} {76 "T2"}] [{74 "T1"} {75 "T1"} {76 "T1"} {77 "T1"} {78 "T1"}] [{75 "RM", 76 "RB", 77 "RE"} {75 "RM", 76 "RB", 78 "RE"} {75 "RM", 76 "RB", 79 "RE"} {75 "RM", 77 "RB", 78 "RE"} {75 "RM", 77 "RB", 79 "RE"} {75 "RM", 78 "RB", 79 "RE"} {76 "RM", 77 "RB", 78 "RE"} {76 "RM", 77 "RB", 79 "RE"} {76 "RM", 78 "RB", 79 "RE"} {77 "RM", 78 "RB", 79 "RE"}] [{77 "HC", 78 "HH", 79 "HO", 80 "C2";=} {77 "HC", 78 "HH", 79 "HO", 81 "C2"} {77 "HC", 78 "HH", 80 "HO", 81 "C2"} {77 "HC", 79 "HH", 80 "HO", 81 "C2"} {78 "HC", 79 "HH", 80 "HO", 81 "C2"}] [{79 "C1", 80 "SP"} {79 "C1", 81 "SP"} {79 "C1", 82 "SP"} {79 "C1", 83 "SP"} {80 "C1", 81 "SP"} {80 "C1", 82 "SP"} {80 "C1", 83 "SP"} {81 "C1", 82 "SP"} {81 "C1", 83 "SP"} {82 "C1", 83 "SP"}] [{81 "CH"} {82 "CH"} {83 "CH"} {84 "CH"} {85 "CH"}]]
nil
(clojure.pprint/pprint
[[{62 "HP", 63 "CB"} {62 "HP", 64 "CB"} {63 "HP", 64 "CB"}]
[{62 "K2"} {63 "K2"} {64 "K2"} {65 "K2"} {66 "K2"}]
[{63 "K1"} {64 "K1"} {65 "K1"} {66 "K1"} {67 "K1"}]
[{65 "T5"} {66 "T5"} {67 "T5"} {68 "T5"} {69 "T5"}]
[{67 "T4"} {68 "T4"} {69 "T4"} {70 "T4"} {71 "T4"}]
[{69 "T3"} {70 "T3"} {71 "T3"} {72 "T3"} {73 "T3"}]
[{70 "RS", 71 "SC", 72 "SS"}
{70 "RS", 71 "SC", 73 "SS"}
{70 "RS", 71 "SC", 74 "SS"}
{70 "RS", 72 "SC", 73 "SS"}
{70 "RS", 72 "SC", 74 "SS"}
{70 "RS", 73 "SC", 74 "SS"}
{71 "RS", 72 "SC", 73 "SS"}
{71 "RS", 72 "SC", 74 "SS"}
{71 "RS", 73 "SC", 74 "SS"}
{72 "RS", 73 "SC", 74 "SS"}]
[{72 "T2"} {73 "T2"} {74 "T2"} {75 "T2"} {76 "T2"}]
[{74 "T1"} {75 "T1"} {76 "T1"} {77 "T1"} {78 "T1"}]
[{75 "RM", 76 "RB", 77 "RE"}
{75 "RM", 76 "RB", 78 "RE"}
{75 "RM", 76 "RB", 79 "RE"}
{75 "RM", 77 "RB", 78 "RE"}
{75 "RM", 77 "RB", 79 "RE"}
{75 "RM", 78 "RB", 79 "RE"}
{76 "RM", 77 "RB", 78 "RE"}
{76 "RM", 77 "RB", 79 "RE"}
{76 "RM", 78 "RB", 79 "RE"}
{77 "RM", 78 "RB", 79 "RE"}]
[{77 "HC", 78 "HH", 79 "HO", 80 "C2"}
{77 "HC", 78 "HH", 79 "HO", 81 "C2"}
{77 "HC", 78 "HH", 80 "HO", 81 "C2"}
{77 "HC", 79 "HH", 80 "HO", 81 "C2"}
{78 "HC", 79 "HH", 80 "HO", 81 "C2"}]
[{79 "C1", 80 "SP"}
{79 "C1", 81 "SP"}
{79 "C1", 82 "SP"}
{79 "C1", 83 "SP"}
{80 "C1", 81 "SP"}
{80 "C1", 82 "SP"}
{80 "C1", 83 "SP"}
{81 "C1", 82 "SP"}
{81 "C1", 83 "SP"}
{82 "C1", 83 "SP"}]
[{81 "CH"} {82 "CH"} {83 "CH"} {84 "CH"} {85 "CH"}]])
;=[[{62 "HP", 63 "CB"} {62 "HP", 64 "CB"} {63 "HP", 64 "CB"}]
;= [{62 "K2"} {63 "K2"} {64 "K2"} {65 "K2"} {66 "K2"}]
;= [{63 "K1"} {64 "K1"} {65 "K1"} {66 "K1"} {67 "K1"}]
;= [{65 "T5"} {66 "T5"} {67 "T5"} {68 "T5"} {69 "T5"}]
;= [{67 "T4"} {68 "T4"} {69 "T4"} {70 "T4"} {71 "T4"}]
;= [{69 "T3"} {70 "T3"} {71 "T3"} {72 "T3"} {73 "T3"}]
;= [{70 "RS", 71 "SC", 72 "SS"}
;= {70 "RS", 71 "SC", 73 "SS"}
;= {70 "RS", 71 "SC", 74 "SS"}
;= {70 "RS", 72 "SC", 73 "SS"}
;= {70 "RS", 72 "SC", 74 "SS"}
;= {70 "RS", 73 "SC", 74 "SS"}
;= {71 "RS", 72 "SC", 73 "SS"}
;= {71 "RS", 72 "SC", 74 "SS"}
;= {71 "RS", 73 "SC", 74 "SS"}
;= {72 "RS", 73 "SC", 74 "SS"}]
;= [{72 "T2"} {73 "T2"} {74 "T2"} {75 "T2"} {76 "T2"}]
;= [{74 "T1"} {75 "T1"} {76 "T1"} {77 "T1"} {78 "T1"}]
;= [{75 "RM", 76 "RB", 77 "RE"}
;= {75 "RM", 76 "RB", 78 "RE"}
;= {75 "RM", 76 "RB", 79 "RE"}
;= {75 "RM", 77 "RB", 78 "RE"}
;= {75 "RM", 77 "RB", 79 "RE"}
;= {75 "RM", 78 "RB", 79 "RE"}
;= {76 "RM", 77 "RB", 78 "RE"}
;= {76 "RM", 77 "RB", 79 "RE"}
;= {76 "RM", 78 "RB", 79 "RE"}
;= {77 "RM", 78 "RB", 7;=9 "RE"}]
;= [{77 "HC", 78 "HH", 79 "HO", 80 "C2"}
;= {77 "HC", 78 "HH", 79 "HO", 81 "C2"}
;= {77 "HC", 78 "HH", 80 "HO", 81 "C2"}
;= {77 "HC", 79 "HH", 80 "HO", 81 "C2"}
;= {78 "HC", 79 "HH", 80 "HO", 81 "C2"}]
;= [{79 "C1", 80 "SP"}
;= {79 "C1", 81 "SP"}
;= {79 "C1", 82 "SP"}
;= {79 "C1", 83 "SP"}
;= {80 "C1", 81 "SP"}
;= {80 "C1", 82 "SP"}
;= {80 "C1", 83 "SP"}
;= {81 "C1", 82 "SP"}
;= {81 "C1", 83 "SP"}
;= {82 "C1", 83 "SP"}]
;= [{81 "CH"} {82 "CH"} {83 "CH"} {84 "CH"} {85 "CH"}]]
nil
Sometimes a printed result has an extra
;=
in the middle of the output when displayed by:Last
. Search for;=}
and;=9
in the following forms.