update at 2026-03-03 22:07:05
This commit is contained in:
25
pxterm/fix_pointer2.js
Normal file
25
pxterm/fix_pointer2.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import fs from 'fs';
|
||||
let code = fs.readFileSync('src/components/TerminalPanel.vue', 'utf8');
|
||||
|
||||
// Find the bad duplicated momentum code that has missing braces
|
||||
const badCode = ` // 释放时触发滚行动量
|
||||
|
||||
if (Math.abs(touchScrollVelocity) > 0.2 && touchGateScrollLike && !hasActiveNativeSelectionInTerminal()) {
|
||||
touchScrollVelocity *= 1.35;
|
||||
runTouchScrollMomentum();
|
||||
|
||||
|
||||
// 释放时触发滚行动量
|
||||
|
||||
if (Math.abs(touchScrollVelocity) > 0.2 && touchGateScrollLike && !hasActiveNativeSelectionInTerminal()) {
|
||||
touchScrollVelocity *= 1.35;
|
||||
runTouchScrollMomentum();`;
|
||||
|
||||
const goodCode = ` // 释放时触发滚行动量
|
||||
if (Math.abs(touchScrollVelocity) > 0.2 && touchGateScrollLike && !hasActiveNativeSelectionInTerminal()) {
|
||||
touchScrollVelocity *= 1.35;
|
||||
runTouchScrollMomentum();
|
||||
}`;
|
||||
|
||||
code = code.replace(badCode, goodCode);
|
||||
fs.writeFileSync('src/components/TerminalPanel.vue', code);
|
||||
Reference in New Issue
Block a user