fix(external_editor): cache auto-detect result, avoid hitting registry on every UI frame
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import sys
|
||||
with open('config.toml', 'rb') as f:
|
||||
data = f.read()
|
||||
BOM = bytes([0xef, 0xbb, 0xbf])
|
||||
if data.startswith(BOM):
|
||||
with open('config.toml', 'wb') as f:
|
||||
f.write(data[3:])
|
||||
print('BOM removed')
|
||||
else:
|
||||
print('No BOM found')
|
||||
sys.exit(0)
|
||||
Reference in New Issue
Block a user