mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 12:38:33 +00:00
refactor(uncrustify): format all c files
This commit is contained in:
@@ -965,8 +965,7 @@ void nvim_buf_set_keymap(uint64_t channel_id, Buffer buffer, String mode, String
|
|||||||
/// @see |nvim_del_keymap()|
|
/// @see |nvim_del_keymap()|
|
||||||
///
|
///
|
||||||
/// @param buffer Buffer handle, or 0 for current buffer
|
/// @param buffer Buffer handle, or 0 for current buffer
|
||||||
void nvim_buf_del_keymap(uint64_t channel_id, Buffer buffer, String mode,
|
void nvim_buf_del_keymap(uint64_t channel_id, Buffer buffer, String mode, String lhs, Error *err)
|
||||||
String lhs, Error *err)
|
|
||||||
FUNC_API_SINCE(6)
|
FUNC_API_SINCE(6)
|
||||||
{
|
{
|
||||||
String rhs = { .data = "", .size = 0 };
|
String rhs = { .data = "", .size = 0 };
|
||||||
@@ -1380,8 +1379,8 @@ Object nvim_buf_call(Buffer buffer, LuaRef fun, Error *err)
|
|||||||
/// @param buffer Buffer handle, or 0 for current buffer.
|
/// @param buffer Buffer handle, or 0 for current buffer.
|
||||||
/// @param[out] err Error details, if any.
|
/// @param[out] err Error details, if any.
|
||||||
/// @see nvim_add_user_command
|
/// @see nvim_add_user_command
|
||||||
void nvim_buf_add_user_command(Buffer buffer, String name, Object command,
|
void nvim_buf_add_user_command(Buffer buffer, String name, Object command, Dict(user_command) *opts,
|
||||||
Dict(user_command) *opts, Error *err)
|
Error *err)
|
||||||
FUNC_API_SINCE(9)
|
FUNC_API_SINCE(9)
|
||||||
{
|
{
|
||||||
buf_T *target_buf = find_buffer_by_handle(buffer, err);
|
buf_T *target_buf = find_buffer_by_handle(buffer, err);
|
||||||
|
@@ -34,9 +34,9 @@
|
|||||||
#include "nvim/channel.h"
|
#include "nvim/channel.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
|
#include "nvim/decoration.h"
|
||||||
#include "nvim/diff.h"
|
#include "nvim/diff.h"
|
||||||
#include "nvim/digraph.h"
|
#include "nvim/digraph.h"
|
||||||
#include "nvim/decoration.h"
|
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/ex_cmds.h"
|
#include "nvim/ex_cmds.h"
|
||||||
#include "nvim/ex_cmds2.h"
|
#include "nvim/ex_cmds2.h"
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
#include "nvim/event/loop.h"
|
#include "nvim/event/loop.h"
|
||||||
#include "nvim/event/rstream.h"
|
#include "nvim/event/rstream.h"
|
||||||
#include "nvim/log.h"
|
#include "nvim/log.h"
|
||||||
#include "nvim/memory.h"
|
|
||||||
#include "nvim/main.h"
|
#include "nvim/main.h"
|
||||||
|
#include "nvim/memory.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef NVIM_EX_DOCMD_H
|
#ifndef NVIM_EX_DOCMD_H
|
||||||
#define NVIM_EX_DOCMD_H
|
#define NVIM_EX_DOCMD_H
|
||||||
|
|
||||||
#include "nvim/ex_cmds_defs.h"
|
|
||||||
#include "nvim/eval/funcs.h"
|
#include "nvim/eval/funcs.h"
|
||||||
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/globals.h"
|
#include "nvim/globals.h"
|
||||||
|
|
||||||
// flags for do_cmdline()
|
// flags for do_cmdline()
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
#define NVIM_EXTMARK_H
|
#define NVIM_EXTMARK_H
|
||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/extmark_defs.h"
|
|
||||||
#include "nvim/decoration.h"
|
#include "nvim/decoration.h"
|
||||||
|
#include "nvim/extmark_defs.h"
|
||||||
#include "nvim/marktree.h"
|
#include "nvim/marktree.h"
|
||||||
#include "nvim/pos.h"
|
#include "nvim/pos.h"
|
||||||
|
|
||||||
|
@@ -906,7 +906,6 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e
|
|||||||
CHECK_FLAG(cterm, cterm_mask, reverse, , HL_INVERSE);
|
CHECK_FLAG(cterm, cterm_mask, reverse, , HL_INVERSE);
|
||||||
CHECK_FLAG(cterm, cterm_mask, strikethrough, , HL_STRIKETHROUGH);
|
CHECK_FLAG(cterm, cterm_mask, strikethrough, , HL_STRIKETHROUGH);
|
||||||
CHECK_FLAG(cterm, cterm_mask, nocombine, , HL_NOCOMBINE);
|
CHECK_FLAG(cterm, cterm_mask, nocombine, , HL_NOCOMBINE);
|
||||||
|
|
||||||
} else if (dict->cterm.type == kObjectTypeArray && dict->cterm.data.array.size == 0) {
|
} else if (dict->cterm.type == kObjectTypeArray && dict->cterm.data.array.size == 0) {
|
||||||
// empty list from Lua API should clear all cterm attributes
|
// empty list from Lua API should clear all cterm attributes
|
||||||
// TODO(clason): handle via gen_api_dispatch
|
// TODO(clason): handle via gen_api_dispatch
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
#include "nvim/getchar.h"
|
#include "nvim/getchar.h"
|
||||||
|
#include "nvim/input.h"
|
||||||
#include "nvim/mbyte.h"
|
#include "nvim/mbyte.h"
|
||||||
#include "nvim/memory.h"
|
#include "nvim/memory.h"
|
||||||
#include "nvim/input.h"
|
|
||||||
#include "nvim/mouse.h"
|
#include "nvim/mouse.h"
|
||||||
#include "nvim/os/input.h"
|
#include "nvim/os/input.h"
|
||||||
#include "nvim/ui.h"
|
#include "nvim/ui.h"
|
||||||
|
@@ -15,8 +15,8 @@
|
|||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/change.h"
|
#include "nvim/change.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/eval/userfunc.h"
|
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
|
#include "nvim/eval/userfunc.h"
|
||||||
#include "nvim/event/loop.h"
|
#include "nvim/event/loop.h"
|
||||||
#include "nvim/event/time.h"
|
#include "nvim/event/time.h"
|
||||||
#include "nvim/ex_cmds2.h"
|
#include "nvim/ex_cmds2.h"
|
||||||
@@ -189,21 +189,18 @@ static int nlua_luv_cfpcall(lua_State *lstate, int nargs, int nresult, int flags
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nlua_luv_thread_cb_cfpcall(lua_State *lstate, int nargs, int nresult,
|
static int nlua_luv_thread_cb_cfpcall(lua_State *lstate, int nargs, int nresult, int flags)
|
||||||
int flags)
|
|
||||||
{
|
{
|
||||||
return nlua_luv_thread_common_cfpcall(lstate, nargs, nresult, flags, true);
|
return nlua_luv_thread_common_cfpcall(lstate, nargs, nresult, flags, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nlua_luv_thread_cfpcall(lua_State *lstate, int nargs, int nresult,
|
static int nlua_luv_thread_cfpcall(lua_State *lstate, int nargs, int nresult, int flags)
|
||||||
int flags)
|
|
||||||
FUNC_ATTR_NONNULL_ALL
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
return nlua_luv_thread_common_cfpcall(lstate, nargs, nresult, flags, false);
|
return nlua_luv_thread_common_cfpcall(lstate, nargs, nresult, flags, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nlua_luv_thread_cfcpcall(lua_State *lstate, lua_CFunction func,
|
static int nlua_luv_thread_cfcpcall(lua_State *lstate, lua_CFunction func, void *ud, int flags)
|
||||||
void *ud, int flags)
|
|
||||||
FUNC_ATTR_NONNULL_ARG(1, 2)
|
FUNC_ATTR_NONNULL_ARG(1, 2)
|
||||||
{
|
{
|
||||||
lua_pushcfunction(lstate, func);
|
lua_pushcfunction(lstate, func);
|
||||||
@@ -212,8 +209,8 @@ static int nlua_luv_thread_cfcpcall(lua_State *lstate, lua_CFunction func,
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nlua_luv_thread_common_cfpcall(lua_State *lstate, int nargs, int nresult,
|
static int nlua_luv_thread_common_cfpcall(lua_State *lstate, int nargs, int nresult, int flags,
|
||||||
int flags, bool is_callback)
|
bool is_callback)
|
||||||
FUNC_ATTR_NONNULL_ALL
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
#include <lua.h>
|
#include <lua.h>
|
||||||
|
|
||||||
#include "nvim/assert.h"
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
#include "nvim/assert.h"
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/ex_docmd.h"
|
#include "nvim/ex_docmd.h"
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
// This is an open source non-commercial project. Dear PVS-Studio, please check
|
// This is an open source non-commercial project. Dear PVS-Studio, please check
|
||||||
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||||
|
|
||||||
#include <lua.h>
|
|
||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
|
#include <lua.h>
|
||||||
|
|
||||||
|
#include "nvim/lua/spell.h"
|
||||||
#include "nvim/spell.h"
|
#include "nvim/spell.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/lua/spell.h"
|
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "lua/spell.c.generated.h"
|
# include "lua/spell.c.generated.h"
|
||||||
|
@@ -28,10 +28,10 @@
|
|||||||
#include "nvim/globals.h"
|
#include "nvim/globals.h"
|
||||||
#include "nvim/lua/converter.h"
|
#include "nvim/lua/converter.h"
|
||||||
#include "nvim/lua/executor.h"
|
#include "nvim/lua/executor.h"
|
||||||
|
#include "nvim/lua/spell.h"
|
||||||
#include "nvim/lua/stdlib.h"
|
#include "nvim/lua/stdlib.h"
|
||||||
#include "nvim/lua/treesitter.h"
|
#include "nvim/lua/treesitter.h"
|
||||||
#include "nvim/lua/xdiff.h"
|
#include "nvim/lua/xdiff.h"
|
||||||
#include "nvim/lua/spell.h"
|
|
||||||
#include "nvim/macros.h"
|
#include "nvim/macros.h"
|
||||||
#include "nvim/map.h"
|
#include "nvim/map.h"
|
||||||
#include "nvim/memline.h"
|
#include "nvim/memline.h"
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
#ifndef NVIM_MARKTREE_H
|
#ifndef NVIM_MARKTREE_H
|
||||||
#define NVIM_MARKTREE_H
|
#define NVIM_MARKTREE_H
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "nvim/assert.h"
|
#include "nvim/assert.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
#include "nvim/map.h"
|
#include "nvim/map.h"
|
||||||
#include "nvim/types.h"
|
|
||||||
#include "nvim/pos.h"
|
#include "nvim/pos.h"
|
||||||
|
#include "nvim/types.h"
|
||||||
|
|
||||||
#define MT_MAX_DEPTH 20
|
#define MT_MAX_DEPTH 20
|
||||||
#define MT_BRANCH_FACTOR 10
|
#define MT_BRANCH_FACTOR 10
|
||||||
|
@@ -16,11 +16,11 @@
|
|||||||
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
||||||
# include <util.h>
|
# include <util.h>
|
||||||
#elif defined(__sun)
|
#elif defined(__sun)
|
||||||
|
# include <fcntl.h>
|
||||||
|
# include <signal.h>
|
||||||
# include <sys/stream.h>
|
# include <sys/stream.h>
|
||||||
# include <sys/syscall.h>
|
# include <sys/syscall.h>
|
||||||
# include <fcntl.h>
|
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# include <signal.h>
|
|
||||||
#else
|
#else
|
||||||
# include <pty.h>
|
# include <pty.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -51,8 +51,8 @@
|
|||||||
// inclusion of the header even though it gets include out of order.
|
// inclusion of the header even though it gets include out of order.
|
||||||
# include <sys/stropts.h>
|
# include <sys/stropts.h>
|
||||||
|
|
||||||
static int openpty(int *amaster, int *aslave, char *name,
|
static int openpty(int *amaster, int *aslave, char *name, struct termios *termp,
|
||||||
struct termios *termp, struct winsize *winp)
|
struct winsize *winp)
|
||||||
{
|
{
|
||||||
int slave = -1;
|
int slave = -1;
|
||||||
int master = open("/dev/ptmx", O_RDWR);
|
int master = open("/dev/ptmx", O_RDWR);
|
||||||
@@ -129,8 +129,7 @@ static int login_tty(int fd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static pid_t forkpty(int *amaster, char *name,
|
static pid_t forkpty(int *amaster, char *name, struct termios *termp, struct winsize *winp)
|
||||||
struct termios *termp, struct winsize *winp)
|
|
||||||
{
|
{
|
||||||
int master, slave;
|
int master, slave;
|
||||||
if (openpty(&master, &slave, name, termp, winp) == -1) {
|
if (openpty(&master, &slave, name, termp, winp) == -1) {
|
||||||
|
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/eval.h"
|
||||||
#include "nvim/event/libuv_process.h"
|
#include "nvim/event/libuv_process.h"
|
||||||
#include "nvim/event/loop.h"
|
#include "nvim/event/loop.h"
|
||||||
#include "nvim/event/rstream.h"
|
#include "nvim/event/rstream.h"
|
||||||
#include "nvim/eval.h"
|
|
||||||
#include "nvim/ex_cmds.h"
|
#include "nvim/ex_cmds.h"
|
||||||
#include "nvim/fileio.h"
|
#include "nvim/fileio.h"
|
||||||
#include "nvim/lib/kvec.h"
|
#include "nvim/lib/kvec.h"
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
#include "nvim/path.h"
|
#include "nvim/path.h"
|
||||||
#include "nvim/screen.h"
|
#include "nvim/screen.h"
|
||||||
#include "nvim/strings.h"
|
#include "nvim/strings.h"
|
||||||
#include "nvim/types.h"
|
|
||||||
#include "nvim/tag.h"
|
#include "nvim/tag.h"
|
||||||
|
#include "nvim/types.h"
|
||||||
#include "nvim/ui.h"
|
#include "nvim/ui.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
|
@@ -5421,9 +5421,8 @@ static int vgr_process_args(exarg_T *eap, vgr_args_T *args)
|
|||||||
|
|
||||||
/// Search for a pattern in a list of files and populate the quickfix list with
|
/// Search for a pattern in a list of files and populate the quickfix list with
|
||||||
/// the matches.
|
/// the matches.
|
||||||
static int vgr_process_files(win_T *wp, qf_info_T *qi, vgr_args_T *cmd_args,
|
static int vgr_process_files(win_T *wp, qf_info_T *qi, vgr_args_T *cmd_args, bool *redraw_for_dummy,
|
||||||
bool *redraw_for_dummy, buf_T **first_match_buf,
|
buf_T **first_match_buf, char_u **target_dir)
|
||||||
char_u **target_dir)
|
|
||||||
{
|
{
|
||||||
int status = FAIL;
|
int status = FAIL;
|
||||||
unsigned save_qfid = qf_get_curlist(qi)->qf_id;
|
unsigned save_qfid = qf_get_curlist(qi)->qf_id;
|
||||||
|
@@ -4680,9 +4680,9 @@ static bool use_cursor_line_sign(win_T *wp, linenr_T lnum)
|
|||||||
// @param[in, out] sign_idxp Index of the displayed sign
|
// @param[in, out] sign_idxp Index of the displayed sign
|
||||||
static void get_sign_display_info(bool nrcol, win_T *wp, linenr_T lnum, sign_attrs_T sattrs[],
|
static void get_sign_display_info(bool nrcol, win_T *wp, linenr_T lnum, sign_attrs_T sattrs[],
|
||||||
int row, int startrow, int filler_lines, int filler_todo,
|
int row, int startrow, int filler_lines, int filler_todo,
|
||||||
int *c_extrap, int *c_finalp, char_u *extra,
|
int *c_extrap, int *c_finalp, char_u *extra, size_t extra_size,
|
||||||
size_t extra_size, char_u **pp_extra, int *n_extrap,
|
char_u **pp_extra, int *n_extrap, int *char_attrp,
|
||||||
int *char_attrp, int *draw_statep, int *sign_idxp)
|
int *draw_statep, int *sign_idxp)
|
||||||
{
|
{
|
||||||
int count = wp->w_scwidth;
|
int count = wp->w_scwidth;
|
||||||
// Draw cells with the sign value or blank.
|
// Draw cells with the sign value or blank.
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/charset.h"
|
|
||||||
#include "nvim/change.h"
|
#include "nvim/change.h"
|
||||||
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/edit.h"
|
#include "nvim/edit.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
|
Reference in New Issue
Block a user