mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor(uncrustify): disable formatting in problematic code sections
This commit is contained in:
parent
8c548c9e54
commit
995c186368
@ -546,6 +546,8 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// uncrustify:off
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
Object *opt;
|
Object *opt;
|
||||||
@ -559,6 +561,8 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
|
|||||||
{ NULL, NULL, NULL },
|
{ NULL, NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// uncrustify:on
|
||||||
|
|
||||||
for (int j = 0; hls[j].name && hls[j].dest; j++) {
|
for (int j = 0; hls[j].name && hls[j].dest; j++) {
|
||||||
if (HAS_KEY(*hls[j].opt)) {
|
if (HAS_KEY(*hls[j].opt)) {
|
||||||
*hls[j].dest = object_to_hl_id(*hls[j].opt, hls[j].name, err);
|
*hls[j].dest = object_to_hl_id(*hls[j].opt, hls[j].name, err);
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// uncrustify:off
|
|
||||||
|
|
||||||
#ifndef NVIM_ASSERT_H
|
#ifndef NVIM_ASSERT_H
|
||||||
#define NVIM_ASSERT_H
|
#define NVIM_ASSERT_H
|
||||||
|
|
||||||
@ -110,6 +108,8 @@
|
|||||||
# define STATIC_ASSERT_STATEMENT STATIC_ASSERT_EXPR
|
# define STATIC_ASSERT_STATEMENT STATIC_ASSERT_EXPR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// uncrustify:off
|
||||||
|
|
||||||
#define ASSERT_CONCAT_(a, b) a##b
|
#define ASSERT_CONCAT_(a, b) a##b
|
||||||
#define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b)
|
#define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b)
|
||||||
// These can't be used after statements in c89.
|
// These can't be used after statements in c89.
|
||||||
@ -125,6 +125,8 @@
|
|||||||
((enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)), }) 0)
|
((enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)), }) 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// uncrustify:on
|
||||||
|
|
||||||
/// @def STRICT_ADD
|
/// @def STRICT_ADD
|
||||||
/// @brief Adds (a + b) and stores result in `c`. Aborts on overflow.
|
/// @brief Adds (a + b) and stores result in `c`. Aborts on overflow.
|
||||||
///
|
///
|
||||||
|
@ -3972,12 +3972,16 @@ static int eval6(char_u **arg, typval_T *rettv, int evaluate, int want_string)
|
|||||||
if (op == '*') {
|
if (op == '*') {
|
||||||
f1 = f1 * f2;
|
f1 = f1 * f2;
|
||||||
} else if (op == '/') {
|
} else if (op == '/') {
|
||||||
|
// uncrustify:off
|
||||||
|
|
||||||
// Division by zero triggers error from AddressSanitizer
|
// Division by zero triggers error from AddressSanitizer
|
||||||
f1 = (f2 == 0 ? (
|
f1 = (f2 == 0 ? (
|
||||||
#ifdef NAN
|
#ifdef NAN
|
||||||
f1 == 0 ? (float_T)NAN :
|
f1 == 0 ? (float_T)NAN :
|
||||||
#endif
|
#endif
|
||||||
(f1 > 0 ? (float_T)INFINITY : (float_T)-INFINITY)) : f1 / f2);
|
(f1 > 0 ? (float_T)INFINITY : (float_T)-INFINITY)) : f1 / f2);
|
||||||
|
|
||||||
|
// uncrustify:on
|
||||||
} else {
|
} else {
|
||||||
emsg(_("E804: Cannot use '%' with Float"));
|
emsg(_("E804: Cannot use '%' with Float"));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
@ -4317,6 +4317,8 @@ skip:
|
|||||||
lnum -= regmatch.startpos[0].lnum;
|
lnum -= regmatch.startpos[0].lnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// uncrustify:off
|
||||||
|
|
||||||
#define PUSH_PREVIEW_LINES() \
|
#define PUSH_PREVIEW_LINES() \
|
||||||
do { \
|
do { \
|
||||||
if (preview) { \
|
if (preview) { \
|
||||||
@ -4336,6 +4338,8 @@ skip:
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
// uncrustify:on
|
||||||
|
|
||||||
// Push the match to preview_lines.
|
// Push the match to preview_lines.
|
||||||
PUSH_PREVIEW_LINES();
|
PUSH_PREVIEW_LINES();
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
// fileio.c: read from and write to a file
|
// fileio.c: read from and write to a file
|
||||||
|
|
||||||
// uncrustify:off
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -4912,11 +4910,15 @@ int buf_check_timestamp(buf_T *buf)
|
|||||||
char *mesg = NULL;
|
char *mesg = NULL;
|
||||||
char *mesg2 = "";
|
char *mesg2 = "";
|
||||||
bool helpmesg = false;
|
bool helpmesg = false;
|
||||||
|
|
||||||
|
// uncrustify:off
|
||||||
enum {
|
enum {
|
||||||
RELOAD_NONE,
|
RELOAD_NONE,
|
||||||
RELOAD_NORMAL,
|
RELOAD_NORMAL,
|
||||||
RELOAD_DETECT
|
RELOAD_DETECT
|
||||||
} reload = RELOAD_NONE;
|
} reload = RELOAD_NONE;
|
||||||
|
// uncrustify:on
|
||||||
|
|
||||||
bool can_reload = false;
|
bool can_reload = false;
|
||||||
uint64_t orig_size = buf->b_orig_size;
|
uint64_t orig_size = buf->b_orig_size;
|
||||||
int orig_mode = buf->b_orig_mode;
|
int orig_mode = buf->b_orig_mode;
|
||||||
|
Loading…
Reference in New Issue
Block a user