答案 0 :(得分:0)
这可能是因为您正在使用the deprecated(Lokaltog / vim-powerline)版本的电力线,以及在全局范围内使用pip安装的系统范围版本,以便在vim之外使用它。
在这种情况下,电力线docs表示您只需要使用全局电力线版本,因此需要在.vimrc中添加以下行:
let intervalID;
wallsTime = 2000;
wallsToggle = true
function wallsTimerPing(){
console.log("wallsToggle is: " + wallsToggle);
// The code that determines if the timer should continue should
// be in the function that will be called repeatedly.
if (wallsToggle === true) {
console.log('Timer has been reset');
} else { // <-- If a Boolean isn't true, it must be false. No need to check
// Clear the interval when you've determined that you need to stop
clearInterval(intervalID);
console.log('Timer is disabled');
}
// The main code that this function does here
// along with something that would change wallsToggle to false
wallsToggle = false;
}
function timerReset() {
intervalID = setInterval(wallsTimerPing, wallsTime);
}
timerReset();