Skip to content

Commit 9946591

Browse files
committed
clear info panel before each action
1 parent e42ed4e commit 9946591

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

autoload/coqtop.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ def ignore_sigint():
154154
signal.signal(signal.SIGINT, signal.SIG_IGN)
155155

156156
def escape(cmd):
157-
return cmd.replace(" ", ' ').replace("'", '\'').replace("(", '(').replace("/)", ')')
157+
return cmd.replace(" ", ' ') \
158+
.replace("'", '\'') \
159+
.replace("(", '(') \
160+
.replace(")", ')')
158161

159162
def get_answer():
160163
acc = ''

autoload/coquille.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import vim
22

3-
import os
43
import re
5-
import subprocess
64
import xml.etree.ElementTree as ET
7-
import signal
85
import coqtop as CT
96

107
from collections import deque
@@ -60,6 +57,8 @@ def goto_last_sent_dot():
6057
vim.current.window.cursor = (line + 1, col)
6158

6259
def coq_rewind(steps=1):
60+
clear_info()
61+
6362
global encountered_dots, info_msg
6463

6564
if steps < 1 or encountered_dots == []:
@@ -133,6 +132,8 @@ def coq_next():
133132
goto_last_sent_dot()
134133

135134
def coq_raw_query(*args):
135+
clear_info()
136+
136137
global info_msg
137138
if CT.coqtop is None:
138139
print("Error: Coqtop isn't running. Are you sure you called :CoqLaunch?")
@@ -241,6 +242,11 @@ def show_info():
241242
lst = info_msg.split('\n')
242243
buff.append(map(lambda s: s.encode('utf-8'), lst))
243244

245+
def clear_info():
246+
global info_msg
247+
info_msg = ''
248+
show_info()
249+
244250
def reset_color():
245251
global error_at
246252
# Clear current coloring (dirty)
@@ -299,6 +305,8 @@ def send_until_fail():
299305
error.
300306
When this function returns, [send_queue] is empty.
301307
"""
308+
clear_info()
309+
302310
global encountered_dots, error_at, info_msg
303311

304312
encoding = vim.eval('&fileencoding') or 'utf-8'

0 commit comments

Comments
 (0)