Remove FLUSH_DRAW as it is not needed

This commit is contained in:
Kovid Goyal
2023-11-05 20:46:25 +05:30
parent afcffc03b1
commit 93784903b2
3 changed files with 5 additions and 16 deletions

View File

@@ -233,12 +233,7 @@ class DumpCommands: # {{{
def __call__(self, window_id: int, what: str, *a: Any) -> None:
if what == 'draw':
if a[0] is None:
if self.draw_dump_buf:
safe_print('draw', ''.join(self.draw_dump_buf))
self.draw_dump_buf = []
else:
self.draw_dump_buf.append(a[0])
self.draw_dump_buf.append(a[0])
elif what == 'bytes':
self.dump_bytes_to.write(a[0])
self.dump_bytes_to.flush()

View File

@@ -101,13 +101,11 @@ _report_params(PyObject *dump_callback, id_type window_id, const char *name, int
#define REPORT_VA_COMMAND(...) Py_XDECREF(PyObject_CallFunction(self->dump_callback, __VA_ARGS__)); PyErr_Clear();
#define REPORT_DRAW(ch) \
Py_XDECREF(PyObject_CallFunction(self->dump_callback, "KsC", self->window_id, "draw", ch)); PyErr_Clear();
printf("ch: %x\n", ch); \
Py_XDECREF(PyObject_CallFunction(self->dump_callback, "KsC", self->window_id, "draw", (int)ch)); PyErr_Clear();
#define REPORT_PARAMS(name, params, num, is_group, region) _report_params(self->dump_callback, self->window_id, name, params, num_params, is_group, region)
#define FLUSH_DRAW \
Py_XDECREF(PyObject_CallFunction(self->dump_callback, "KsO", self->window_id, "draw", Py_None)); PyErr_Clear();
#define REPORT_OSC(name, string) \
Py_XDECREF(PyObject_CallFunction(self->dump_callback, "KsO", self->window_id, #name, string)); PyErr_Clear();
@@ -123,7 +121,6 @@ _report_params(PyObject *dump_callback, id_type window_id, const char *name, int
#define REPORT_VA_COMMAND(...)
#define REPORT_DRAW(ch)
#define REPORT_PARAMS(...)
#define FLUSH_DRAW
#define REPORT_OSC(name, string)
#define REPORT_OSC2(name, code, string)
#define REPORT_HYPERLINK(id, url)

View File

@@ -20,9 +20,7 @@ def cnv(x):
class CmdDump(list):
def __call__(self, *a):
if a and isinstance(a[0], int):
a = a[1:]
def __call__(self, window_id, *a):
if a and a[0] == 'bytes':
return
if a and a[0] == 'error':
@@ -42,8 +40,7 @@ class TestParser(BaseTest):
q = []
for args in cd:
if args[0] == 'draw':
if args[1] is not None:
current += args[1]
current += args[1]
else:
if current:
q.append(('draw', current))