mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #7593 'PVS static analysis fixes'
This commit is contained in:
commit
8c959be511
@ -12,6 +12,7 @@
|
|||||||
#include "nvim/api/private/handle.h"
|
#include "nvim/api/private/handle.h"
|
||||||
#include "nvim/msgpack_rpc/helpers.h"
|
#include "nvim/msgpack_rpc/helpers.h"
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
|
#include "nvim/assert.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/window.h"
|
#include "nvim/window.h"
|
||||||
@ -760,12 +761,8 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
|
|||||||
case kObjectTypeWindow:
|
case kObjectTypeWindow:
|
||||||
case kObjectTypeTabpage:
|
case kObjectTypeTabpage:
|
||||||
case kObjectTypeInteger:
|
case kObjectTypeInteger:
|
||||||
if (obj.data.integer > VARNUMBER_MAX
|
STATIC_ASSERT(sizeof(obj.data.integer) <= sizeof(varnumber_T),
|
||||||
|| obj.data.integer < VARNUMBER_MIN) {
|
"Integer size must be <= VimL number size");
|
||||||
api_set_error(err, kErrorTypeValidation, "Integer value outside range");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
tv->v_type = VAR_NUMBER;
|
tv->v_type = VAR_NUMBER;
|
||||||
tv->vval.v_number = (varnumber_T)obj.data.integer;
|
tv->vval.v_number = (varnumber_T)obj.data.integer;
|
||||||
break;
|
break;
|
||||||
|
@ -1696,7 +1696,7 @@ static void printdigraph(digr_T *dp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p = buf;
|
p = &buf[0];
|
||||||
*p++ = dp->char1;
|
*p++ = dp->char1;
|
||||||
*p++ = dp->char2;
|
*p++ = dp->char2;
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
|
139
src/nvim/eval.c
139
src/nvim/eval.c
@ -2206,10 +2206,6 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv,
|
|||||||
if (len == -1) {
|
if (len == -1) {
|
||||||
// "[key]": get key from "var1"
|
// "[key]": get key from "var1"
|
||||||
key = (char_u *)tv_get_string(&var1); // is number or string
|
key = (char_u *)tv_get_string(&var1); // is number or string
|
||||||
if (key == NULL) {
|
|
||||||
tv_clear(&var1);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
lp->ll_list = NULL;
|
lp->ll_list = NULL;
|
||||||
lp->ll_dict = lp->ll_tv->vval.v_dict;
|
lp->ll_dict = lp->ll_tv->vval.v_dict;
|
||||||
@ -5706,10 +5702,6 @@ static int get_function_args(char_u **argp, char_u endchar, garray_T *newargs,
|
|||||||
c = *p;
|
c = *p;
|
||||||
*p = NUL;
|
*p = NUL;
|
||||||
arg = vim_strsave(arg);
|
arg = vim_strsave(arg);
|
||||||
if (arg == NULL) {
|
|
||||||
*p = c;
|
|
||||||
goto err_ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for duplicate argument name.
|
// Check for duplicate argument name.
|
||||||
for (i = 0; i < newargs->ga_len; i++) {
|
for (i = 0; i < newargs->ga_len; i++) {
|
||||||
@ -5833,10 +5825,6 @@ static int get_lambda_tv(char_u **arg, typval_T *rettv, bool evaluate)
|
|||||||
|
|
||||||
fp = (ufunc_T *)xcalloc(1, sizeof(ufunc_T) + STRLEN(name));
|
fp = (ufunc_T *)xcalloc(1, sizeof(ufunc_T) + STRLEN(name));
|
||||||
pt = (partial_T *)xcalloc(1, sizeof(partial_T));
|
pt = (partial_T *)xcalloc(1, sizeof(partial_T));
|
||||||
if (pt == NULL) {
|
|
||||||
xfree(fp);
|
|
||||||
goto errret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ga_init(&newlines, (int)sizeof(char_u *), 1);
|
ga_init(&newlines, (int)sizeof(char_u *), 1);
|
||||||
ga_grow(&newlines, 1);
|
ga_grow(&newlines, 1);
|
||||||
@ -6222,13 +6210,9 @@ static char_u *fname_trans_sid(const char_u *const name,
|
|||||||
fname = fname_buf;
|
fname = fname_buf;
|
||||||
} else {
|
} else {
|
||||||
fname = xmalloc(i + STRLEN(name + llen) + 1);
|
fname = xmalloc(i + STRLEN(name + llen) + 1);
|
||||||
if (fname == NULL) {
|
*tofree = fname;
|
||||||
*error = ERROR_OTHER;
|
memmove(fname, fname_buf, (size_t)i);
|
||||||
} else {
|
STRCPY(fname + i, name + llen);
|
||||||
*tofree = fname;
|
|
||||||
memmove(fname, fname_buf, (size_t)i);
|
|
||||||
STRCPY(fname + i, name + llen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fname = (char_u *)name;
|
fname = (char_u *)name;
|
||||||
@ -6309,9 +6293,6 @@ call_func(
|
|||||||
// Make a copy of the name, if it comes from a funcref variable it could
|
// Make a copy of the name, if it comes from a funcref variable it could
|
||||||
// be changed or deleted in the called function.
|
// be changed or deleted in the called function.
|
||||||
name = vim_strnsave(funcname, len);
|
name = vim_strnsave(funcname, len);
|
||||||
if (name == NULL) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
fname = fname_trans_sid(name, fname_buf, &tofree, &error);
|
fname = fname_trans_sid(name, fname_buf, &tofree, &error);
|
||||||
|
|
||||||
@ -7184,8 +7165,7 @@ static void f_bufnr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
&& argvars[1].v_type != VAR_UNKNOWN
|
&& argvars[1].v_type != VAR_UNKNOWN
|
||||||
&& tv_get_number_chk(&argvars[1], &error) != 0
|
&& tv_get_number_chk(&argvars[1], &error) != 0
|
||||||
&& !error
|
&& !error
|
||||||
&& (name = tv_get_string_chk(&argvars[0])) != NULL
|
&& (name = tv_get_string_chk(&argvars[0])) != NULL) {
|
||||||
&& !error) {
|
|
||||||
buf = buflist_new((char_u *)name, NULL, 1, 0);
|
buf = buflist_new((char_u *)name, NULL, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7733,7 +7713,7 @@ static void f_delete(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *const name = tv_get_string(&argvars[0]);
|
const char *const name = tv_get_string(&argvars[0]);
|
||||||
if (name == NULL || *name == NUL) {
|
if (*name == NUL) {
|
||||||
EMSG(_(e_invarg));
|
EMSG(_(e_invarg));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -8748,10 +8728,9 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
foldstart = (linenr_T)get_vim_var_nr(VV_FOLDSTART);
|
foldstart = (linenr_T)get_vim_var_nr(VV_FOLDSTART);
|
||||||
foldend = (linenr_T)get_vim_var_nr(VV_FOLDEND);
|
foldend = (linenr_T)get_vim_var_nr(VV_FOLDEND);
|
||||||
dashes = get_vim_var_str(VV_FOLDDASHES);
|
dashes = get_vim_var_str(VV_FOLDDASHES);
|
||||||
if (foldstart > 0 && foldend <= curbuf->b_ml.ml_line_count
|
if (foldstart > 0 && foldend <= curbuf->b_ml.ml_line_count) {
|
||||||
&& dashes != NULL) {
|
// Find first non-empty line in the fold.
|
||||||
/* Find first non-empty line in the fold. */
|
for (lnum = foldstart; lnum < foldend; lnum++) {
|
||||||
for (lnum = foldstart; lnum < foldend; ++lnum) {
|
|
||||||
if (!linewhite(lnum)) {
|
if (!linewhite(lnum)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -8874,10 +8853,8 @@ static void common_function(typval_T *argvars, typval_T *rettv,
|
|||||||
snprintf(sid_buf, sizeof(sid_buf), "<SNR>%" PRId64 "_",
|
snprintf(sid_buf, sizeof(sid_buf), "<SNR>%" PRId64 "_",
|
||||||
(int64_t)current_SID);
|
(int64_t)current_SID);
|
||||||
name = xmalloc(STRLEN(sid_buf) + STRLEN(s + off) + 1);
|
name = xmalloc(STRLEN(sid_buf) + STRLEN(s + off) + 1);
|
||||||
if (name != NULL) {
|
STRCPY(name, sid_buf);
|
||||||
STRCPY(name, sid_buf);
|
STRCAT(name, s + off);
|
||||||
STRCAT(name, s + off);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
name = vim_strsave(s);
|
name = vim_strsave(s);
|
||||||
}
|
}
|
||||||
@ -8927,11 +8904,6 @@ static void common_function(typval_T *argvars, typval_T *rettv,
|
|||||||
|
|
||||||
pt->pt_argc = arg_len + lv_len;
|
pt->pt_argc = arg_len + lv_len;
|
||||||
pt->pt_argv = xmalloc(sizeof(pt->pt_argv[0]) * pt->pt_argc);
|
pt->pt_argv = xmalloc(sizeof(pt->pt_argv[0]) * pt->pt_argc);
|
||||||
if (pt->pt_argv == NULL) {
|
|
||||||
xfree(pt);
|
|
||||||
xfree(name);
|
|
||||||
goto theend;
|
|
||||||
}
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < arg_len; i++) {
|
for (; i < arg_len; i++) {
|
||||||
tv_copy(&arg_pt->pt_argv[i], &pt->pt_argv[i]);
|
tv_copy(&arg_pt->pt_argv[i], &pt->pt_argv[i]);
|
||||||
@ -9197,9 +9169,7 @@ static void f_getbufinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dict_T *const d = get_buffer_info(buf);
|
dict_T *const d = get_buffer_info(buf);
|
||||||
if (d != NULL) {
|
tv_list_append_dict(rettv->vval.v_list, d);
|
||||||
tv_list_append_dict(rettv->vval.v_list, d);
|
|
||||||
}
|
|
||||||
if (argbuf != NULL) {
|
if (argbuf != NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -9568,13 +9538,11 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
theend:
|
theend:
|
||||||
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
|
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
|
||||||
tv_list_alloc_ret(rettv);
|
tv_list_alloc_ret(rettv);
|
||||||
if (pat != NULL) {
|
ExpandOne(&xpc, pat, NULL, options, WILD_ALL_KEEP);
|
||||||
ExpandOne(&xpc, pat, NULL, options, WILD_ALL_KEEP);
|
|
||||||
|
|
||||||
for (int i = 0; i < xpc.xp_numfiles; i++) {
|
for (int i = 0; i < xpc.xp_numfiles; i++) {
|
||||||
tv_list_append_string(rettv->vval.v_list, (const char *)xpc.xp_files[i],
|
tv_list_append_string(rettv->vval.v_list, (const char *)xpc.xp_files[i],
|
||||||
-1);
|
-1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
xfree(pat);
|
xfree(pat);
|
||||||
ExpandCleanup(&xpc);
|
ExpandCleanup(&xpc);
|
||||||
@ -10136,9 +10104,7 @@ static void f_gettabinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dict_T *const d = get_tabpage_info(tp, tpnr);
|
dict_T *const d = get_tabpage_info(tp, tpnr);
|
||||||
if (d != NULL) {
|
tv_list_append_dict(rettv->vval.v_list, d);
|
||||||
tv_list_append_dict(rettv->vval.v_list, d);
|
|
||||||
}
|
|
||||||
if (tparg != NULL) {
|
if (tparg != NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -10240,9 +10206,7 @@ static void f_getwininfo(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
}
|
}
|
||||||
winnr++;
|
winnr++;
|
||||||
dict_T *const d = get_win_info(wp, tabnr, winnr);
|
dict_T *const d = get_win_info(wp, tabnr, winnr);
|
||||||
if (d != NULL) {
|
tv_list_append_dict(rettv->vval.v_list, d);
|
||||||
tv_list_append_dict(rettv->vval.v_list, d);
|
|
||||||
}
|
|
||||||
if (wparg != NULL) {
|
if (wparg != NULL) {
|
||||||
// found information about a specific window
|
// found information about a specific window
|
||||||
return;
|
return;
|
||||||
@ -14803,9 +14767,6 @@ static void f_setmatches(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
if (di == NULL) {
|
if (di == NULL) {
|
||||||
if (s == NULL) {
|
if (s == NULL) {
|
||||||
s = tv_list_alloc();
|
s = tv_list_alloc();
|
||||||
if (s == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// match from matchaddpos()
|
// match from matchaddpos()
|
||||||
@ -18628,47 +18589,39 @@ void set_selfdict(typval_T *rettv, dict_T *selfdict)
|
|||||||
// Turn "dict.Func" into a partial for "Func" with "dict".
|
// Turn "dict.Func" into a partial for "Func" with "dict".
|
||||||
if (fp != NULL && (fp->uf_flags & FC_DICT)) {
|
if (fp != NULL && (fp->uf_flags & FC_DICT)) {
|
||||||
partial_T *pt = (partial_T *)xcalloc(1, sizeof(partial_T));
|
partial_T *pt = (partial_T *)xcalloc(1, sizeof(partial_T));
|
||||||
|
pt->pt_refcount = 1;
|
||||||
|
pt->pt_dict = selfdict;
|
||||||
|
(selfdict->dv_refcount)++;
|
||||||
|
pt->pt_auto = true;
|
||||||
|
if (rettv->v_type == VAR_FUNC || rettv->v_type == VAR_STRING) {
|
||||||
|
// Just a function: Take over the function name and use selfdict.
|
||||||
|
pt->pt_name = rettv->vval.v_string;
|
||||||
|
} else {
|
||||||
|
partial_T *ret_pt = rettv->vval.v_partial;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (pt != NULL) {
|
// Partial: copy the function name, use selfdict and copy
|
||||||
pt->pt_refcount = 1;
|
// args. Can't take over name or args, the partial might
|
||||||
pt->pt_dict = selfdict;
|
// be referenced elsewhere.
|
||||||
(selfdict->dv_refcount)++;
|
if (ret_pt->pt_name != NULL) {
|
||||||
pt->pt_auto = true;
|
pt->pt_name = vim_strsave(ret_pt->pt_name);
|
||||||
if (rettv->v_type == VAR_FUNC || rettv->v_type == VAR_STRING) {
|
func_ref(pt->pt_name);
|
||||||
// Just a function: Take over the function name and use selfdict.
|
|
||||||
pt->pt_name = rettv->vval.v_string;
|
|
||||||
} else {
|
} else {
|
||||||
partial_T *ret_pt = rettv->vval.v_partial;
|
pt->pt_func = ret_pt->pt_func;
|
||||||
int i;
|
func_ptr_ref(pt->pt_func);
|
||||||
|
|
||||||
// Partial: copy the function name, use selfdict and copy
|
|
||||||
// args. Can't take over name or args, the partial might
|
|
||||||
// be referenced elsewhere.
|
|
||||||
if (ret_pt->pt_name != NULL) {
|
|
||||||
pt->pt_name = vim_strsave(ret_pt->pt_name);
|
|
||||||
func_ref(pt->pt_name);
|
|
||||||
} else {
|
|
||||||
pt->pt_func = ret_pt->pt_func;
|
|
||||||
func_ptr_ref(pt->pt_func);
|
|
||||||
}
|
|
||||||
if (ret_pt->pt_argc > 0) {
|
|
||||||
size_t arg_size = sizeof(typval_T) * ret_pt->pt_argc;
|
|
||||||
pt->pt_argv = (typval_T *)xmalloc(arg_size);
|
|
||||||
if (pt->pt_argv == NULL) {
|
|
||||||
// out of memory: drop the arguments
|
|
||||||
pt->pt_argc = 0;
|
|
||||||
} else {
|
|
||||||
pt->pt_argc = ret_pt->pt_argc;
|
|
||||||
for (i = 0; i < pt->pt_argc; i++) {
|
|
||||||
tv_copy(&ret_pt->pt_argv[i], &pt->pt_argv[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
partial_unref(ret_pt);
|
|
||||||
}
|
}
|
||||||
rettv->v_type = VAR_PARTIAL;
|
if (ret_pt->pt_argc > 0) {
|
||||||
rettv->vval.v_partial = pt;
|
size_t arg_size = sizeof(typval_T) * ret_pt->pt_argc;
|
||||||
|
pt->pt_argv = (typval_T *)xmalloc(arg_size);
|
||||||
|
pt->pt_argc = ret_pt->pt_argc;
|
||||||
|
for (i = 0; i < pt->pt_argc; i++) {
|
||||||
|
tv_copy(&ret_pt->pt_argv[i], &pt->pt_argv[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
partial_unref(ret_pt);
|
||||||
}
|
}
|
||||||
|
rettv->v_type = VAR_PARTIAL;
|
||||||
|
rettv->vval.v_partial = pt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1417,17 +1417,20 @@ void ex_emenu(exarg_T *eap)
|
|||||||
idx = MENU_INDEX_NORMAL;
|
idx = MENU_INDEX_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL) {
|
assert(idx != MENU_INDEX_INVALID);
|
||||||
/* When executing a script or function execute the commands right now.
|
if (menu->strings[idx] != NULL) {
|
||||||
* Otherwise put them in the typeahead buffer. */
|
// When executing a script or function execute the commands right now.
|
||||||
if (current_SID != 0)
|
// Otherwise put them in the typeahead buffer.
|
||||||
|
if (current_SID != 0) {
|
||||||
exec_normal_cmd(menu->strings[idx], menu->noremap[idx],
|
exec_normal_cmd(menu->strings[idx], menu->noremap[idx],
|
||||||
menu->silent[idx]);
|
menu->silent[idx]);
|
||||||
else
|
} else {
|
||||||
ins_typebuf(menu->strings[idx], menu->noremap[idx], 0,
|
ins_typebuf(menu->strings[idx], menu->noremap[idx], 0, true,
|
||||||
TRUE, menu->silent[idx]);
|
menu->silent[idx]);
|
||||||
} else
|
}
|
||||||
|
} else {
|
||||||
EMSG2(_("E335: Menu not defined for %s mode"), mode);
|
EMSG2(_("E335: Menu not defined for %s mode"), mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1989,9 +1989,8 @@ void halfpage(bool flag, linenr_T Prenum)
|
|||||||
while (n > 0 && curwin->w_botline <= curbuf->b_ml.ml_line_count) {
|
while (n > 0 && curwin->w_botline <= curbuf->b_ml.ml_line_count) {
|
||||||
if (curwin->w_topfill > 0) {
|
if (curwin->w_topfill > 0) {
|
||||||
i = 1;
|
i = 1;
|
||||||
if (--n < 0 && scrolled > 0)
|
n--;
|
||||||
break;
|
curwin->w_topfill--;
|
||||||
--curwin->w_topfill;
|
|
||||||
} else {
|
} else {
|
||||||
i = plines_nofill(curwin->w_topline);
|
i = plines_nofill(curwin->w_topline);
|
||||||
n -= i;
|
n -= i;
|
||||||
@ -2067,9 +2066,8 @@ void halfpage(bool flag, linenr_T Prenum)
|
|||||||
while (n > 0 && curwin->w_topline > 1) {
|
while (n > 0 && curwin->w_topline > 1) {
|
||||||
if (curwin->w_topfill < diff_check_fill(curwin, curwin->w_topline)) {
|
if (curwin->w_topfill < diff_check_fill(curwin, curwin->w_topline)) {
|
||||||
i = 1;
|
i = 1;
|
||||||
if (--n < 0 && scrolled > 0)
|
n--;
|
||||||
break;
|
curwin->w_topfill++;
|
||||||
++curwin->w_topfill;
|
|
||||||
} else {
|
} else {
|
||||||
i = plines_nofill(curwin->w_topline - 1);
|
i = plines_nofill(curwin->w_topline - 1);
|
||||||
n -= i;
|
n -= i;
|
||||||
|
@ -199,18 +199,25 @@ static void forward_mouse_event(TermInput *input, TermKeyKey *key)
|
|||||||
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "Right");
|
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "Right");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev == TERMKEY_MOUSE_PRESS) {
|
switch (ev) {
|
||||||
if (button == 4) {
|
case TERMKEY_MOUSE_PRESS:
|
||||||
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "ScrollWheelUp");
|
if (button == 4) {
|
||||||
} else if (button == 5) {
|
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "ScrollWheelUp");
|
||||||
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "ScrollWheelDown");
|
} else if (button == 5) {
|
||||||
} else {
|
len += (size_t)snprintf(buf + len, sizeof(buf) - len,
|
||||||
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "Mouse");
|
"ScrollWheelDown");
|
||||||
}
|
} else {
|
||||||
} else if (ev == TERMKEY_MOUSE_DRAG) {
|
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "Mouse");
|
||||||
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "Drag");
|
}
|
||||||
} else if (ev == TERMKEY_MOUSE_RELEASE) {
|
break;
|
||||||
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "Release");
|
case TERMKEY_MOUSE_DRAG:
|
||||||
|
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "Drag");
|
||||||
|
break;
|
||||||
|
case TERMKEY_MOUSE_RELEASE:
|
||||||
|
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "Release");
|
||||||
|
break;
|
||||||
|
case TERMKEY_MOUSE_UNKNOWN:
|
||||||
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "><%d,%d>", col, row);
|
len += (size_t)snprintf(buf + len, sizeof(buf) - len, "><%d,%d>", col, row);
|
||||||
|
@ -1644,7 +1644,7 @@ static void flush_buf(UI *ui, bool toggle_cursor)
|
|||||||
{
|
{
|
||||||
uv_write_t req;
|
uv_write_t req;
|
||||||
uv_buf_t bufs[3];
|
uv_buf_t bufs[3];
|
||||||
uv_buf_t *bufp = bufs;
|
uv_buf_t *bufp = &bufs[0];
|
||||||
TUIData *data = ui->data;
|
TUIData *data = ui->data;
|
||||||
|
|
||||||
if (data->bufpos <= 0 && data->busy == data->is_invisible) {
|
if (data->bufpos <= 0 && data->busy == data->is_invisible) {
|
||||||
|
Loading…
Reference in New Issue
Block a user