Add a setting tab_activity_symbol

Fixes #2515
This commit is contained in:
Kovid Goyal
2020-09-08 21:54:56 +05:30
parent 83315f7999
commit 9a54da84dc
8 changed files with 48 additions and 3 deletions
+10
View File
@@ -444,6 +444,9 @@ draw_combining_char(Screen *self, char_type ch) {
void
screen_draw(Screen *self, uint32_t och) {
if (is_ignored_char(och)) return;
if (!self->has_activity_since_last_focus && !self->has_focus) {
self->has_activity_since_last_focus = true;
}
uint32_t ch = och < 256 ? self->g_charset[och] : och;
bool is_cc = is_combining_char(ch);
if (UNLIKELY(is_cc)) {
@@ -2531,6 +2534,7 @@ focus_changed(Screen *self, PyObject *has_focus_) {
bool has_focus = PyObject_IsTrue(has_focus_) ? true : false;
if (has_focus != previous) {
self->has_focus = has_focus;
if (has_focus) self->has_activity_since_last_focus = false;
if (self->modes.mFOCUS_TRACKING) write_escape_code_to_child(self, CSI, has_focus ? "I" : "O");
Py_RETURN_TRUE;
}
@@ -2543,6 +2547,11 @@ has_focus(Screen *self, PyObject *args UNUSED) {
Py_RETURN_FALSE;
}
static PyObject*
has_activity_since_last_focus(Screen *self, PyObject *args UNUSED) {
if (self->has_activity_since_last_focus) Py_RETURN_TRUE;
Py_RETURN_FALSE;
}
WRAP2(cursor_position, 1, 1)
@@ -2628,6 +2637,7 @@ static PyMethodDef methods[] = {
MND(paste_bytes, METH_O)
MND(focus_changed, METH_O)
MND(has_focus, METH_NOARGS)
MND(has_activity_since_last_focus, METH_NOARGS)
MND(copy_colors_from, METH_O)
MND(set_marker, METH_VARARGS)
MND(marked_cells, METH_NOARGS)