diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-05-25 20:31:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 12:31:14 -0600 |
commit | 9fec6dc9a25b5cf9c9a444ac2bd0728e8af3229e (patch) | |
tree | 83e044109d61242150b8c98897e179416025f576 /src/nvim/api | |
parent | 8c4e62351f67dd6a44f67f3a2b6f3a3551acf475 (diff) | |
download | rneovim-9fec6dc9a25b5cf9c9a444ac2bd0728e8af3229e.tar.gz rneovim-9fec6dc9a25b5cf9c9a444ac2bd0728e8af3229e.tar.bz2 rneovim-9fec6dc9a25b5cf9c9a444ac2bd0728e8af3229e.zip |
refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)
Diffstat (limited to 'src/nvim/api')
-rw-r--r-- | src/nvim/api/autocmd.c | 3 | ||||
-rw-r--r-- | src/nvim/api/buffer.c | 5 | ||||
-rw-r--r-- | src/nvim/api/deprecated.c | 3 | ||||
-rw-r--r-- | src/nvim/api/extmark.c | 6 | ||||
-rw-r--r-- | src/nvim/api/private/helpers.c | 7 | ||||
-rw-r--r-- | src/nvim/api/private/helpers.h | 2 | ||||
-rw-r--r-- | src/nvim/api/ui.c | 3 | ||||
-rw-r--r-- | src/nvim/api/vim.c | 5 | ||||
-rw-r--r-- | src/nvim/api/win_config.c | 2 | ||||
-rw-r--r-- | src/nvim/api/window.c | 1 |
10 files changed, 2 insertions, 35 deletions
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c index 4ee834d75a..19b4119344 100644 --- a/src/nvim/api/autocmd.c +++ b/src/nvim/api/autocmd.c @@ -31,7 +31,6 @@ goto goto_name; \ } - // ID for associating autocmds created via nvim_create_autocmd // Used to delete autocmds from nvim_del_autocmd static int64_t next_autocmd_id = 1; @@ -429,7 +428,6 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc AucmdExecutable aucmd = AUCMD_EXECUTABLE_INIT; Callback cb = CALLBACK_NONE; - if (!unpack_string_or_array(&event_array, &event, "event", true, err)) { goto cleanup; } @@ -550,7 +548,6 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc } }); - cleanup: aucmd_exec_free(&aucmd); api_free_array(event_array); diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 9842975d62..4fa8b13c54 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -35,7 +35,6 @@ # include "api/buffer.c.generated.h" #endif - /// \defgroup api-buffer /// /// \brief For more information on buffers, see |buffers| @@ -51,7 +50,6 @@ /// You can use |nvim_buf_is_loaded()| or |nvim_buf_line_count()| to check /// whether a buffer is loaded. - /// Returns the number of lines in the given buffer. /// /// @param buffer Buffer handle, or 0 for current buffer @@ -737,7 +735,6 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In (int)new_len - 1, (colnr_T)last_item.size, new_byte, kExtmarkUndo); - changed_lines((linenr_T)start_row, 0, (linenr_T)end_row + 1, (long)extra, true); @@ -1039,7 +1036,6 @@ void nvim_buf_del_var(Buffer buffer, String name, Error *err) dict_set_var(buf->b_vars, name, NIL, true, false, err); } - /// Gets a buffer option value /// /// @param buffer Buffer handle, or 0 for current buffer @@ -1336,7 +1332,6 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) return rv; } - /// call a function with buffer as temporary current buffer /// /// This temporarily switches current buffer to "buffer". diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c index f968593e47..abaac07755 100644 --- a/src/nvim/api/deprecated.c +++ b/src/nvim/api/deprecated.c @@ -78,7 +78,6 @@ void nvim_buf_clear_highlight(Buffer buffer, Integer ns_id, Integer line_start, nvim_buf_clear_namespace(buffer, ns_id, line_start, line_end, err); } - /// Set the virtual text (annotation) for a buffer line. /// /// @deprecated use nvim_buf_set_extmark to use full virtual text @@ -137,7 +136,6 @@ Integer nvim_buf_set_virtual_text(Buffer buffer, Integer src_id, Integer line, A return 0; } - Decoration *existing = decor_find_virttext(buf, (int)line, ns_id); if (existing) { @@ -292,7 +290,6 @@ void buffer_set_line_slice(Buffer buffer, Integer start, Integer end, Boolean in nvim_buf_set_lines(0, buffer, start, end, false, replacement, err); } - /// Sets a buffer-scoped (b:) variable /// /// @deprecated diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c index 94b2af9a6f..9d80a5be5f 100644 --- a/src/nvim/api/extmark.c +++ b/src/nvim/api/extmark.c @@ -94,7 +94,6 @@ static bool ns_initialized(uint32_t ns) return ns < (uint32_t)next_namespace_id; } - static Array extmark_to_array(const ExtmarkInfo *extmark, bool id, bool add_dict) { Array rv = ARRAY_DICT_INIT; @@ -233,7 +232,6 @@ ArrayOf(Integer) nvim_buf_get_extmark_by_id(Buffer buffer, Integer ns_id, } } - ExtmarkInfo extmark = extmark_from_id(buf, (uint32_t)ns_id, (uint32_t)id); if (extmark.row < 0) { return rv; @@ -333,7 +331,6 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e limit = INT64_MAX; } - bool reverse = false; int l_row; @@ -352,7 +349,6 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e reverse = true; } - ExtmarkInfoArray marks = extmark_get(buf, (uint32_t)ns_id, l_row, l_col, u_row, u_col, (int64_t)limit, reverse); @@ -675,7 +671,6 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer goto error; } - OPTION_TO_BOOL(decor.virt_lines_above, virt_lines_above, false); if (opts->priority.type == kObjectTypeInteger) { @@ -777,7 +772,6 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer col2 = 0; } - // TODO(bfredl): synergize these two branches even more if (ephemeral && decor_state.buf == buf) { decor_add_ephemeral((int)line, (int)col, line2, col2, &decor, (uint64_t)ns_id, id); diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index c251a4a25c..3cccbc3cdf 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -407,7 +407,6 @@ void set_option_to(uint64_t channel_id, void *to, int type, String name, Object }); } - buf_T *find_buffer_by_handle(Buffer buffer, Error *err) { if (buffer == 0) { @@ -1040,8 +1039,8 @@ Object copy_object(Object obj) } } -void set_option_value_for(char *key, long numval, char *stringval, int opt_flags, - int opt_type, void *from, Error *err) +void set_option_value_for(char *key, long numval, char *stringval, int opt_flags, int opt_type, + void *from, Error *err) { switchwin_T switchwin; aco_save_T aco; @@ -1080,7 +1079,6 @@ void set_option_value_for(char *key, long numval, char *stringval, int opt_flags try_end(err); } - static void set_option_value_err(char *key, long numval, char *stringval, int opt_flags, Error *err) { char *errmsg; @@ -1562,7 +1560,6 @@ void create_user_command(String name, Object command, Dict(user_command) *opts, goto err; } - if (api_object_to_bool(opts->register_, "register", false, err)) { argt |= EX_REGSTR; } else if (ERROR_SET(err)) { diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index bbbc3de7d5..8423db4970 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -146,7 +146,6 @@ typedef struct { code; \ } - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/helpers.h.generated.h" # include "keysets.h.generated.h" @@ -163,5 +162,4 @@ typedef struct { current_sctx = save_current_sctx; \ } while (0); - #endif // NVIM_API_PRIVATE_HELPERS_H diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 52f76f4650..dc04eedebc 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -196,7 +196,6 @@ void nvim_ui_detach(uint64_t channel_id, Error *err) remote_ui_disconnect(channel_id); } - void nvim_ui_try_resize(uint64_t channel_id, Integer width, Integer height, Error *err) FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { @@ -571,7 +570,6 @@ static void remote_ui_highlight_set(UI *ui, int id) Array args = ARRAY_DICT_INIT; UIData *data = ui->data; - if (data->hl_id == id) { return; } @@ -794,7 +792,6 @@ static void remote_ui_event(UI *ui, char *name, Array args, bool *args_consumed) } } - Array my_args = ARRAY_DICT_INIT; // Objects are currently single-reference // make a copy, but only if necessary diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 8e216c2031..7ca0912f82 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -209,7 +209,6 @@ static void on_redraw_event(void **argv) redraw_all_later(NOT_VALID); } - /// Sends input-keys to Nvim, subject to various quirks controlled by `mode` /// flags. This is a blocking call, unlike |nvim_input()|. /// @@ -441,7 +440,6 @@ String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, Bool return cstr_as_string(ptr); } - /// Execute Lua code. Parameters (if any) are available as `...` inside the /// chunk. The chunk can return a value. /// @@ -570,7 +568,6 @@ ArrayOf(String) nvim__get_runtime(Array pat, Boolean all, Dict(runtime) *opts, E return runtime_get_named(is_lua, pat, all); } - /// Changes the global working directory. /// /// @param dir Directory path @@ -1245,7 +1242,6 @@ static void term_close(void *data) channel_decref(chan); } - /// Send data to channel `id`. For a job, it writes it to the /// stdin of the process. For the stdio channel |channel-stdio|, /// it writes to Nvim's stdout. For an internal terminal instance @@ -2192,7 +2188,6 @@ void nvim__screenshot(String path) ui_call_screenshot(path); } - /// Deletes an uppercase/file named mark. See |mark-motions|. /// /// @note fails with error if a lowercase or buffer local named mark is used. diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index 0d8bdbec61..898d95f49a 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -22,7 +22,6 @@ # include "api/win_config.c.generated.h" #endif - /// Open a new window. /// /// Currently this is used to open floating and external windows. @@ -590,7 +589,6 @@ static bool parse_float_config(Dict(float_config) *config, FloatConfig *fconfig, return false; } - if (HAS_KEY(config->focusable)) { fconfig->focusable = api_object_to_bool(config->focusable, "'focusable' key", false, err); if (ERROR_SET(err)) { diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index 3a3a65f812..9f2afc67a6 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -373,7 +373,6 @@ Boolean nvim_win_is_valid(Window window) return ret; } - /// Closes the window and hide the buffer it contains (like |:hide| with a /// |window-ID|). /// |