Scenario:
Before this commit the app would crash on an assertion failure; a pane's line and line_cache were no longer in sync.
I'm fixing it by reloading all other copies of a pane from disk immediately after writing it to disk. Which may well be massively slower, but is a) likely cached by the OS, and b) not noticeable.
This bug has likely been present since 2022-11 (commit 813e06fd4d).
ONVQPNBJRWL3VLMV3UJGQOKR26GELHHOUZ7F3ISVVY6ET6OVITOQC
NQBUJ4VZQJZP2X2J2UG27XVY5LCGNVAOE5RFZJA5BASITUQSVIUQC
UCFOE6KJM4USAO3SATXQQQBF3H6ERZCEWIKTYYYSLJK5TASKZOVAC
RRMDUZP7S7DJW6QDCVSMQVF5TZHYM3LL65Q7Z4GQIX4GWMVK7A3AC
2CK5QI7WA7M4IVSACFGOJYAIDKRUTZVMMPSFWEJTUNMWTN7AX4NAC
SPSW74Y5OJ54Y7VQ3SJFCJR5CYDKTR4A3TOEVZODDZLUSDDU2GZAC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
XNFTJHC4QSHNSIWNN7K6QZEZ37GTQYKHS4EPNSVPQCUSWREROGIQC
MTJEVRJR5GLWUSK7HMIM4UXM6GS6O6YCRWJT3DUSU2RYMHCQNOEQC
2ZYV7D3W2HPQW2HYB7XDPM4T7KEWPUFPZ77BDLCCDSCLRPJFK6PQC
Z5HLXU4PJWWJJDBCK52NBD6PIRIA3TAN2BKZB5HBYFGIDBX4F5HAC
OI4FPFINEROK6GNDEMOBTGSPYIULCLRGGT5W3H7VLM7VFH22GMWQC
KOYAJWE4NJ2J4X3SHEAVMRXYZPZGOMTI7OX3PTUQIDIZ2GQI6UKAC
JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
VPCPK52KMU4MZUXP4SUSJJDEHDR4C3KJ45HLMUQUK32FMY6OCQ4QC
AHOO2ILEJWTPCYHJH26WAF7A4YYVMHFX4UWHSAAAMHI73TSQZ6CAC
NP5DODWMHP22MO6Z3B6NYDR7C3DLV2BD4NKT2RFFFOSIDPC3ZPWQC
N3JOR25T7F4JFEMMSQ7WI4BFY46ESSXVHG24ARGXLASBA43MNSYQC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
LNUHQOGHIOFGJXNGA3DZLYEASLYYDGLN2I3EDZY5ANASQAHCG3YQC
PP2IIHL6EK4HBFFSYAQNV35BKIK6D4EL2JQOY7NZVJX2DXCLSMGAC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
D2TYQVN3UGM76SYX2NVKKXTRXSEKZV5M5C4HXF7TSHYOQ2AEKBBQC
IFTYOERMW7P3I24WISZN35X3GWJ5MSMRYDRBK3L52GCZTPP3CWZQC
--? if Foo_pane then
--? print_and_log(('run.draw_normal_mode %d,%d %s %s %d %d -- %d,%d %s %s %d %d'):format(pane.column_index, pane.pane_index, pane, pane.lines, #pane.lines, #pane.line_cache, Foo_pane.column_index, Foo_pane.pane_index, Foo_pane, Foo_pane.lines, #Foo_pane.lines, #Foo_pane.line_cache))
--? end
log(2, os.date('%Y/%m/%d/%H-%M-%S')..(' line_cache is out of date; %d when it should be %d'):format(#State.line_cache, #State.lines))
print_and_log(os.date('%Y/%m/%d/%H-%M-%S')..(' line_cache is out of date; %d when it should be %d'):format(#State.line_cache, #State.lines))