mirror of
https://github.com/neovim/neovim.git
synced 2025-09-10 21:38:19 +00:00
refactor(uncrustify): format all c code under /src/nvim/
This commit is contained in:
@@ -140,9 +140,9 @@ typedef struct {
|
|||||||
|
|
||||||
// Useful macro for executing some `code` for each item in an array.
|
// Useful macro for executing some `code` for each item in an array.
|
||||||
#define FOREACH_ITEM(a, __foreach_item, code) \
|
#define FOREACH_ITEM(a, __foreach_item, code) \
|
||||||
for (size_t (__foreach_item ## _index) = 0; (__foreach_item ## _index) < (a).size; \
|
for (size_t (__foreach_item##_index) = 0; (__foreach_item##_index) < (a).size; \
|
||||||
(__foreach_item ## _index)++) { \
|
(__foreach_item##_index)++) { \
|
||||||
Object __foreach_item = (a).items[__foreach_item ## _index]; \
|
Object __foreach_item = (a).items[__foreach_item##_index]; \
|
||||||
code; \
|
code; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
// autocmd.c: Autocommand related functions
|
// autocmd.c: Autocommand related functions
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "lauxlib.h"
|
||||||
#include "nvim/api/private/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/autocmd.h"
|
#include "nvim/autocmd.h"
|
||||||
@@ -28,8 +29,6 @@
|
|||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/window.h"
|
#include "nvim/window.h"
|
||||||
|
|
||||||
#include "lauxlib.h"
|
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "auevents_name_map.generated.h"
|
# include "auevents_name_map.generated.h"
|
||||||
# include "autocmd.c.generated.h"
|
# include "autocmd.c.generated.h"
|
||||||
|
@@ -538,7 +538,6 @@ void decor_add_ephemeral(int start_row, int start_col, int end_row, int end_col,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int decor_virt_lines(win_T *wp, linenr_T lnum, VirtLines *lines)
|
int decor_virt_lines(win_T *wp, linenr_T lnum, VirtLines *lines)
|
||||||
{
|
{
|
||||||
buf_T *buf = wp->w_buffer;
|
buf_T *buf = wp->w_buffer;
|
||||||
|
@@ -16,8 +16,8 @@ static kvec_t(DecorProvider) decor_providers = KV_INITIAL_VALUE;
|
|||||||
LUA_NOREF, LUA_NOREF, LUA_NOREF, \
|
LUA_NOREF, LUA_NOREF, LUA_NOREF, \
|
||||||
LUA_NOREF, -1 }
|
LUA_NOREF, -1 }
|
||||||
|
|
||||||
static bool decor_provider_invoke(NS ns_id, const char *name, LuaRef ref,
|
static bool decor_provider_invoke(NS ns_id, const char *name, LuaRef ref, Array args,
|
||||||
Array args, bool default_true, char **perr)
|
bool default_true, char **perr)
|
||||||
{
|
{
|
||||||
Error err = ERROR_INIT;
|
Error err = ERROR_INIT;
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef NVIM_DIGRAPH_H
|
#ifndef NVIM_DIGRAPH_H
|
||||||
#define NVIM_DIGRAPH_H
|
#define NVIM_DIGRAPH_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/types.h"
|
#include "nvim/types.h"
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
|
@@ -15,8 +15,8 @@
|
|||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/context.h"
|
#include "nvim/context.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/digraph.h"
|
|
||||||
#include "nvim/diff.h"
|
#include "nvim/diff.h"
|
||||||
|
#include "nvim/digraph.h"
|
||||||
#include "nvim/edit.h"
|
#include "nvim/edit.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/decode.h"
|
#include "nvim/eval/decode.h"
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/diff.h"
|
#include "nvim/diff.h"
|
||||||
#include "nvim/edit.h"
|
#include "nvim/edit.h"
|
||||||
#include "nvim/eval/userfunc.h"
|
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
|
#include "nvim/eval/userfunc.h"
|
||||||
#include "nvim/ex_cmds.h"
|
#include "nvim/ex_cmds.h"
|
||||||
#include "nvim/ex_docmd.h"
|
#include "nvim/ex_docmd.h"
|
||||||
#include "nvim/ex_eval.h"
|
#include "nvim/ex_eval.h"
|
||||||
|
@@ -4,8 +4,9 @@
|
|||||||
// highlight_group.c: code for managing highlight groups
|
// highlight_group.c: code for managing highlight groups
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "nvim/autocmd.h"
|
|
||||||
#include "nvim/api/private/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
|
#include "nvim/autocmd.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cursor_shape.h"
|
#include "nvim/cursor_shape.h"
|
||||||
#include "nvim/fold.h"
|
#include "nvim/fold.h"
|
||||||
@@ -34,10 +35,10 @@ Map(cstr_t, int) highlight_unames = MAP_INIT;
|
|||||||
/// The "term", "cterm" and "gui" arguments can be any combination of the
|
/// The "term", "cterm" and "gui" arguments can be any combination of the
|
||||||
/// following names, separated by commas (but no spaces!).
|
/// following names, separated by commas (but no spaces!).
|
||||||
static char *(hl_name_table[]) =
|
static char *(hl_name_table[]) =
|
||||||
{ "bold", "standout", "underline", "underlineline", "undercurl", "underdot",
|
{ "bold", "standout", "underline", "underlineline", "undercurl", "underdot",
|
||||||
"underdash", "italic", "reverse", "inverse", "strikethrough", "nocombine", "NONE" };
|
"underdash", "italic", "reverse", "inverse", "strikethrough", "nocombine", "NONE" };
|
||||||
static int hl_attr_table[] =
|
static int hl_attr_table[] =
|
||||||
{ HL_BOLD, HL_STANDOUT, HL_UNDERLINE, HL_UNDERLINELINE, HL_UNDERCURL, HL_UNDERDOT, HL_UNDERDASH,
|
{ HL_BOLD, HL_STANDOUT, HL_UNDERLINE, HL_UNDERLINELINE, HL_UNDERCURL, HL_UNDERDOT, HL_UNDERDASH,
|
||||||
HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_STRIKETHROUGH, HL_NOCOMBINE, 0 };
|
HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_STRIKETHROUGH, HL_NOCOMBINE, 0 };
|
||||||
|
|
||||||
/// Structure that stores information about a highlight group.
|
/// Structure that stores information about a highlight group.
|
||||||
@@ -1572,8 +1573,7 @@ const char *highlight_color(const int id, const char *const what, const int mode
|
|||||||
/// @param id highlight group id
|
/// @param id highlight group id
|
||||||
/// @param force_newline always start a new line
|
/// @param force_newline always start a new line
|
||||||
/// @return true when started a new line.
|
/// @return true when started a new line.
|
||||||
bool syn_list_header(const bool did_header, const int outlen, const int id,
|
bool syn_list_header(const bool did_header, const int outlen, const int id, bool force_newline)
|
||||||
bool force_newline)
|
|
||||||
{
|
{
|
||||||
int endcol = 19;
|
int endcol = 19;
|
||||||
bool newline = true;
|
bool newline = true;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef NVIM_HIGHLIGHT_GROUP_H
|
#ifndef NVIM_HIGHLIGHT_GROUP_H
|
||||||
#define NVIM_HIGHLIGHT_GROUP_H
|
#define NVIM_HIGHLIGHT_GROUP_H
|
||||||
|
|
||||||
#include "nvim/types.h"
|
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
|
#include "nvim/types.h"
|
||||||
|
|
||||||
#define MAX_HL_ID 20000 // maximum value for a highlight ID.
|
#define MAX_HL_ID 20000 // maximum value for a highlight ID.
|
||||||
|
|
||||||
|
@@ -835,8 +835,8 @@ static uint64_t server_connect(char *server_addr, const char **errmsg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Handle remote subcommands
|
/// Handle remote subcommands
|
||||||
static void remote_request(mparm_T *params, int remote_args,
|
static void remote_request(mparm_T *params, int remote_args, char *server_addr, int argc,
|
||||||
char *server_addr, int argc, char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
const char *connect_error = NULL;
|
const char *connect_error = NULL;
|
||||||
uint64_t chan = server_connect(server_addr, &connect_error);
|
uint64_t chan = server_connect(server_addr, &connect_error);
|
||||||
@@ -884,7 +884,7 @@ static void remote_request(mparm_T *params, int remote_args,
|
|||||||
TriState should_exit = kNone;
|
TriState should_exit = kNone;
|
||||||
TriState tabbed = kNone;
|
TriState tabbed = kNone;
|
||||||
|
|
||||||
for (size_t i = 0; i < rvobj.data.dictionary.size ; i++) {
|
for (size_t i = 0; i < rvobj.data.dictionary.size; i++) {
|
||||||
if (strcmp(rvobj.data.dictionary.items[i].key.data, "errmsg") == 0) {
|
if (strcmp(rvobj.data.dictionary.items[i].key.data, "errmsg") == 0) {
|
||||||
if (rvobj.data.dictionary.items[i].value.type != kObjectTypeString) {
|
if (rvobj.data.dictionary.items[i].value.type != kObjectTypeString) {
|
||||||
mch_errmsg("vim._cs_remote returned an unexpected type for 'errmsg'\n");
|
mch_errmsg("vim._cs_remote returned an unexpected type for 'errmsg'\n");
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
// match.c: functions for highlighting matches
|
// match.c: functions for highlighting matches
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/fold.h"
|
#include "nvim/fold.h"
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
// regexp.c
|
// regexp.c
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "regexp.h.generated.h"
|
# include "regexp.h.generated.h"
|
||||||
|
|
||||||
# include "regexp_bt.h.generated.h"
|
# include "regexp_bt.h.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ typedef enum {
|
|||||||
WC_TOP_LEFT = 0,
|
WC_TOP_LEFT = 0,
|
||||||
WC_TOP_RIGHT,
|
WC_TOP_RIGHT,
|
||||||
WC_BOTTOM_LEFT,
|
WC_BOTTOM_LEFT,
|
||||||
WC_BOTTOM_RIGHT
|
WC_BOTTOM_RIGHT,
|
||||||
} WindowCorner;
|
} WindowCorner;
|
||||||
|
|
||||||
/// By default, all windows are drawn on a single rectangular grid, represented by
|
/// By default, all windows are drawn on a single rectangular grid, represented by
|
||||||
|
@@ -5,8 +5,6 @@
|
|||||||
// sign.c: functions for managing with signs
|
// sign.c: functions for managing with signs
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "nvim/sign.h"
|
|
||||||
|
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
@@ -18,6 +16,7 @@
|
|||||||
#include "nvim/move.h"
|
#include "nvim/move.h"
|
||||||
#include "nvim/option.h"
|
#include "nvim/option.h"
|
||||||
#include "nvim/screen.h"
|
#include "nvim/screen.h"
|
||||||
|
#include "nvim/sign.h"
|
||||||
#include "nvim/syntax.h"
|
#include "nvim/syntax.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/window.h"
|
#include "nvim/window.h"
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
// testing.c: Support for tests
|
// testing.c: Support for tests
|
||||||
|
|
||||||
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/encode.h"
|
#include "nvim/eval/encode.h"
|
||||||
#include "nvim/ex_docmd.h"
|
#include "nvim/ex_docmd.h"
|
||||||
#include "nvim/eval.h"
|
|
||||||
#include "nvim/os/os.h"
|
#include "nvim/os/os.h"
|
||||||
#include "nvim/testing.h"
|
#include "nvim/testing.h"
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef NVIM_TESTING_H
|
#ifndef NVIM_TESTING_H
|
||||||
#define NVIM_TESTING_H
|
#define NVIM_TESTING_H
|
||||||
|
|
||||||
#include "nvim/eval/typval.h"
|
|
||||||
#include "nvim/eval/funcs.h"
|
#include "nvim/eval/funcs.h"
|
||||||
|
#include "nvim/eval/typval.h"
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "testing.h.generated.h"
|
# include "testing.h.generated.h"
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
#include "nvim/option.h"
|
#include "nvim/option.h"
|
||||||
#include "nvim/os/input.h"
|
#include "nvim/os/input.h"
|
||||||
#include "nvim/os/os.h"
|
#include "nvim/os/os.h"
|
||||||
#include "nvim/tui/tui.h"
|
|
||||||
#include "nvim/tui/input.h"
|
#include "nvim/tui/input.h"
|
||||||
|
#include "nvim/tui/tui.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# include "nvim/os/os_win_console.h"
|
# include "nvim/os/os_win_console.h"
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/cursor_shape.h"
|
#include "nvim/cursor_shape.h"
|
||||||
#include "nvim/msgpack_rpc/channel.h"
|
|
||||||
#include "nvim/diff.h"
|
#include "nvim/diff.h"
|
||||||
#include "nvim/event/loop.h"
|
#include "nvim/event/loop.h"
|
||||||
#include "nvim/ex_cmds2.h"
|
#include "nvim/ex_cmds2.h"
|
||||||
@@ -25,6 +24,7 @@
|
|||||||
#include "nvim/mbyte.h"
|
#include "nvim/mbyte.h"
|
||||||
#include "nvim/memory.h"
|
#include "nvim/memory.h"
|
||||||
#include "nvim/move.h"
|
#include "nvim/move.h"
|
||||||
|
#include "nvim/msgpack_rpc/channel.h"
|
||||||
#include "nvim/normal.h"
|
#include "nvim/normal.h"
|
||||||
#include "nvim/option.h"
|
#include "nvim/option.h"
|
||||||
#include "nvim/os/input.h"
|
#include "nvim/os/input.h"
|
||||||
|
@@ -1,20 +1,20 @@
|
|||||||
// 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 <assert.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "nvim/vim.h"
|
#include "nvim/api/private/dispatch.h"
|
||||||
|
#include "nvim/api/private/helpers.h"
|
||||||
|
#include "nvim/highlight.h"
|
||||||
#include "nvim/log.h"
|
#include "nvim/log.h"
|
||||||
#include "nvim/map.h"
|
#include "nvim/map.h"
|
||||||
#include "nvim/ui_client.h"
|
|
||||||
#include "nvim/api/private/helpers.h"
|
|
||||||
#include "nvim/msgpack_rpc/channel.h"
|
#include "nvim/msgpack_rpc/channel.h"
|
||||||
#include "nvim/api/private/dispatch.h"
|
|
||||||
#include "nvim/ui.h"
|
|
||||||
#include "nvim/highlight.h"
|
|
||||||
#include "nvim/screen.h"
|
#include "nvim/screen.h"
|
||||||
|
#include "nvim/ui.h"
|
||||||
|
#include "nvim/ui_client.h"
|
||||||
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
static Map(String, UIClientHandler) ui_client_handlers = MAP_INIT;
|
static Map(String, UIClientHandler) ui_client_handlers = MAP_INIT;
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ static HlAttrs ui_client_dict2hlattrs(Dictionary d, bool rgb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
#include "ui_events_client.generated.h"
|
# include "ui_events_client.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ui_client_event_grid_resize(Array args)
|
void ui_client_event_grid_resize(Array args)
|
||||||
|
@@ -6,8 +6,9 @@
|
|||||||
typedef void (*UIClientHandler)(Array args);
|
typedef void (*UIClientHandler)(Array args);
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
#include "ui_client.h.generated.h"
|
# include "ui_client.h.generated.h"
|
||||||
#include "ui_events_client.h.generated.h"
|
|
||||||
|
# include "ui_events_client.h.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // NVIM_UI_CLIENT_H
|
#endif // NVIM_UI_CLIENT_H
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Uncrustify-0.74.0
|
# Uncrustify-0.74.0_f
|
||||||
|
|
||||||
#
|
#
|
||||||
# General options
|
# General options
|
||||||
|
Reference in New Issue
Block a user