refactor: enable formatting for ternaries

This requires removing the "Inner expression should be aligned" rule
from clint as it prevents essentially any formatting regarding ternary
operators.
This commit is contained in:
dundargoc
2023-11-16 10:59:11 +01:00
committed by dundargoc
parent ec79ff893d
commit a6e3d93421
59 changed files with 318 additions and 377 deletions

View File

@@ -88,9 +88,9 @@ static int validate_option_value_args(Dict(option) *opts, char *name, int *scope
int req_flags = *req_scope == kOptReqBuf ? SOPT_BUF : SOPT_WIN;
if (!(flags & req_flags)) {
char *tgt = *req_scope & kOptReqBuf ? "buf" : "win";
char *global = flags & SOPT_GLOBAL ? "global ": "";
char *req = flags & SOPT_BUF ? "buffer-local " :
flags & SOPT_WIN ? "window-local " : "";
char *global = flags & SOPT_GLOBAL ? "global " : "";
char *req = flags & SOPT_BUF ? "buffer-local "
: flags & SOPT_WIN ? "window-local " : "";
api_set_error(err, kErrorTypeValidation, "'%s' cannot be passed for %s%soption '%s'",
tgt, global, req, name);
@@ -495,7 +495,7 @@ OptVal get_option_value_strict(char *name, OptReqScope req_scope, void *from, Er
switchwin_T switchwin;
aco_save_T aco;
void *ctx = req_scope == kOptReqWin ? (void *)&switchwin
: (req_scope == kOptReqBuf ? (void *)&aco : NULL);
: (req_scope == kOptReqBuf ? (void *)&aco : NULL);
bool switched = switch_option_context(ctx, req_scope, from, err);
if (ERROR_SET(err)) {
return retv;