mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
Merge branch 'master' into expression-parser
This commit is contained in:
@@ -793,7 +793,11 @@ Integer nvim_buf_add_highlight(Buffer buffer,
|
||||
col_end = MAXCOL;
|
||||
}
|
||||
|
||||
int hlg_id = syn_name2id((char_u *)(hl_group.data ? hl_group.data : ""));
|
||||
int hlg_id = 0;
|
||||
if (hl_group.size > 0) {
|
||||
hlg_id = syn_check_group((char_u *)hl_group.data, (int)hl_group.size);
|
||||
}
|
||||
|
||||
src_id = bufhl_add_hl(buf, (int)src_id, hlg_id, (linenr_T)line+1,
|
||||
(colnr_T)col_start+1, (colnr_T)col_end);
|
||||
return src_id;
|
||||
|
@@ -667,6 +667,22 @@ tabpage_T *find_tab_by_handle(Tabpage tabpage, Error *err)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/// Allocates a String consisting of a single char. Does not support multibyte
|
||||
/// characters. The resulting string is also NUL-terminated, to facilitate
|
||||
/// interoperating with code using C strings.
|
||||
///
|
||||
/// @param char the char to convert
|
||||
/// @return the resulting String, if the input char was NUL, an
|
||||
/// empty String is returned
|
||||
String cchar_to_string(char c)
|
||||
{
|
||||
char buf[] = { c, NUL };
|
||||
return (String) {
|
||||
.data = xmemdupz(buf, 1),
|
||||
.size = (c != NUL) ? 1 : 0
|
||||
};
|
||||
}
|
||||
|
||||
/// Copies a C string into a String (binary safe string, characters + length).
|
||||
/// The resulting string is also NUL-terminated, to facilitate interoperating
|
||||
/// with code using C strings.
|
||||
@@ -687,6 +703,23 @@ String cstr_to_string(const char *str)
|
||||
};
|
||||
}
|
||||
|
||||
/// Copies buffer to an allocated String.
|
||||
/// The resulting string is also NUL-terminated, to facilitate interoperating
|
||||
/// with code using C strings.
|
||||
///
|
||||
/// @param buf the buffer to copy
|
||||
/// @param size length of the buffer
|
||||
/// @return the resulting String, if the input string was NULL, an
|
||||
/// empty String is returned
|
||||
String cbuf_to_string(const char *buf, size_t size)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
return (String) {
|
||||
.data = xmemdupz(buf, size),
|
||||
.size = size
|
||||
};
|
||||
}
|
||||
|
||||
/// Creates a String using the given C string. Unlike
|
||||
/// cstr_to_string this function DOES NOT copy the C string.
|
||||
///
|
||||
|
@@ -68,4 +68,20 @@ void popupmenu_select(Integer selected)
|
||||
void tabline_update(Tabpage current, Array tabs)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
|
||||
void cmdline_show(Array content, Integer pos, String firstc, String prompt,
|
||||
Integer indent, Integer level)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_pos(Integer pos, Integer level)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_special_char(String c, Boolean shift, Integer level)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_hide(Integer level)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_block_show(Array lines)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_block_append(Array lines)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_block_hide(void)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
|
||||
#endif // NVIM_API_UI_EVENTS_IN_H
|
||||
|
Reference in New Issue
Block a user