diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2021-10-12 16:56:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-12 07:56:52 -0700 |
commit | 40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf (patch) | |
tree | c46f06f4c40d85e308017e379a97fd1aebcebef1 /src/nvim/api | |
parent | ee342d3cef97aa2414c05261b448228ae3277862 (diff) | |
download | rneovim-40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf.tar.gz rneovim-40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf.tar.bz2 rneovim-40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf.zip |
refactor: format all C files under nvim/ #15977
* refactor: format all C files under nvim
* refactor: disable formatting for Vim-owned files:
* src/nvim/indent_c.c
* src/nvim/regexp.c
* src/nvim/regexp_nfa.c
* src/nvim/testdir/samples/memfile_test.c
Diffstat (limited to 'src/nvim/api')
-rw-r--r-- | src/nvim/api/buffer.c | 15 | ||||
-rw-r--r-- | src/nvim/api/private/dispatch.c | 2 | ||||
-rw-r--r-- | src/nvim/api/private/helpers.c | 10 | ||||
-rw-r--r-- | src/nvim/api/private/helpers.h | 2 | ||||
-rw-r--r-- | src/nvim/api/vim.c | 2 | ||||
-rw-r--r-- | src/nvim/api/win_config.c | 2 |
6 files changed, 16 insertions, 17 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 569c0c9771..3a38a14cdd 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1166,8 +1166,7 @@ Boolean nvim_buf_del_mark(Buffer buffer, String name, Error *err) /// @return true if the mark was set, else false. /// @see |nvim_buf_del_mark()| /// @see |nvim_buf_get_mark()| -Boolean nvim_buf_set_mark(Buffer buffer, String name, - Integer line, Integer col, Error *err) +Boolean nvim_buf_set_mark(Buffer buffer, String name, Integer line, Integer col, Error *err) FUNC_API_SINCE(8) { bool res = false; @@ -1578,8 +1577,8 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer if (opts->id.type == kObjectTypeInteger && opts->id.data.integer > 0) { id = (uint64_t)opts->id.data.integer; } else if (HAS_KEY(opts->id)) { - api_set_error(err, kErrorTypeValidation, "id is not a positive integer"); - goto error; + api_set_error(err, kErrorTypeValidation, "id is not a positive integer"); + goto error; } int line2 = -1; @@ -1655,10 +1654,10 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer } #define OPTION_TO_BOOL(target, name, val) \ - target = api_object_to_bool(opts-> name, #name, val, err); \ - if (ERROR_SET(err)) { \ - goto error; \ - } + target = api_object_to_bool(opts-> name, #name, val, err); \ + if (ERROR_SET(err)) { \ + goto error; \ + } OPTION_TO_BOOL(decor.virt_text_hide, virt_text_hide, false); OPTION_TO_BOOL(decor.hl_eol, hl_eol, false); diff --git a/src/nvim/api/private/dispatch.c b/src/nvim/api/private/dispatch.c index ee0cdc4c07..519bf8ff14 100644 --- a/src/nvim/api/private/dispatch.c +++ b/src/nvim/api/private/dispatch.c @@ -14,8 +14,8 @@ #include "nvim/api/tabpage.h" #include "nvim/api/ui.h" #include "nvim/api/vim.h" -#include "nvim/api/window.h" #include "nvim/api/win_config.h" +#include "nvim/api/window.h" #include "nvim/log.h" #include "nvim/map.h" #include "nvim/msgpack_rpc/helpers.h" diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index d03a61d1cc..aed87048ce 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -4,9 +4,9 @@ #include <assert.h> #include <inttypes.h> #include <stdbool.h> +#include <stddef.h> #include <stdlib.h> #include <string.h> -#include <stddef.h> #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" @@ -831,10 +831,10 @@ void modify_keymap(Buffer buffer, bool is_unmap, String mode, String lhs, String MapArguments parsed_args = MAP_ARGUMENTS_INIT; if (opts) { #define KEY_TO_BOOL(name) \ - parsed_args. name = api_object_to_bool(opts-> name, #name, false, err); \ - if (ERROR_SET(err)) { \ - goto fail_and_free; \ - } + parsed_args. name = api_object_to_bool(opts-> name, #name, false, err); \ + if (ERROR_SET(err)) { \ + goto fail_and_free; \ + } KEY_TO_BOOL(nowait); KEY_TO_BOOL(noremap); diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index dc9452e832..08d2c8d90c 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -141,8 +141,8 @@ typedef struct { } while (0) #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "keysets.h.generated.h" # include "api/private/helpers.h.generated.h" +# include "keysets.h.generated.h" #endif diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 9b39b18c4e..0565f8cd77 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -2846,7 +2846,7 @@ Array nvim_get_mark(String name, Error *err) bufnr = mark.fmark.fnum; filename = (char *)buflist_nr2name(bufnr, true, true); allocated = true; - // Marks comes from shada + // Marks comes from shada } else { filename = (char *)mark.fname; bufnr = 0; diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index d82e7e8a03..d8105810aa 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -616,7 +616,7 @@ static bool parse_float_config(Dict(float_config) *config, FloatConfig *fconfig, fconfig->style = kWinStyleUnused; } else if (striequal(config->style.data.string.data, "minimal")) { fconfig->style = kWinStyleMinimal; - } else { + } else { api_set_error(err, kErrorTypeValidation, "Invalid value of 'style' key"); } } else if (HAS_KEY(config->style)) { |