update at 2026-03-03 22:07:05
This commit is contained in:
13
pxterm/fix_pointer.js
Normal file
13
pxterm/fix_pointer.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import fs from 'fs';
|
||||
let code = fs.readFileSync('src/components/TerminalPanel.vue', 'utf8');
|
||||
|
||||
// remove all console.log containing "[Scroll Deep]" lines regardless of newlines
|
||||
code = code.replace(/console\.log\(\s*(?:`|"|')\[Scroll Deep\][\s\S]*?\);/g, '');
|
||||
|
||||
// remove redundant empty else blocks
|
||||
code = code.replace(/\} else \{\s*\}/g, '}');
|
||||
|
||||
// remove duplicated momentum blocks
|
||||
code = code.replace(/(\/\/ 释放时触发滚行动量\s*if \(Math\.abs\(touchScrollVelocity\).*?runTouchScrollMomentum\(\);\s*\})[\s\S]*?(\/\/ 释放时触发滚行动量\s*if \(Math\.abs\(touchScrollVelocity\).*?runTouchScrollMomentum\(\);\s*\})/g, '$1');
|
||||
|
||||
fs.writeFileSync('src/components/TerminalPanel.vue', code);
|
||||
Reference in New Issue
Block a user