diff options
author | dundargoc <gocdundar@gmail.com> | 2023-11-16 10:59:11 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-11-20 19:57:09 +0100 |
commit | a6e3d93421ba13c407a96fac9cc01fa41ec7ad98 (patch) | |
tree | e84209969b11fe2f0dabcad00a271468b2199bc9 /src/nvim/undo.c | |
parent | ec79ff893d5906e1f0d90953cffa535ffae47823 (diff) | |
download | rneovim-a6e3d93421ba13c407a96fac9cc01fa41ec7ad98.tar.gz rneovim-a6e3d93421ba13c407a96fac9cc01fa41ec7ad98.tar.bz2 rneovim-a6e3d93421ba13c407a96fac9cc01fa41ec7ad98.zip |
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.
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r-- | src/nvim/undo.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c index fa778b6803..7cd9ae378f 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -1824,8 +1824,8 @@ bool u_undo_and_forget(int count, bool do_buf_event) if (curbuf->b_u_curhead) { to_forget->uh_alt_next.ptr = NULL; curbuf->b_u_curhead->uh_alt_prev.ptr = to_forget->uh_alt_prev.ptr; - curbuf->b_u_seq_cur = curbuf->b_u_curhead->uh_next.ptr ? - curbuf->b_u_curhead->uh_next.ptr->uh_seq : 0; + curbuf->b_u_seq_cur = curbuf->b_u_curhead->uh_next.ptr + ? curbuf->b_u_curhead->uh_next.ptr->uh_seq : 0; } else if (curbuf->b_u_newhead) { curbuf->b_u_seq_cur = curbuf->b_u_newhead->uh_seq; } @@ -2039,9 +2039,9 @@ void undo_time(int step, bool sec, bool file, bool absolute) while (uhp != NULL) { uhp->uh_walk = mark; - int val = dosec ? (int)(uhp->uh_time) : - dofile ? uhp->uh_save_nr - : uhp->uh_seq; + int val = dosec ? (int)(uhp->uh_time) + : dofile ? uhp->uh_save_nr + : uhp->uh_seq; if (round == 1 && !(dofile && val == 0)) { // Remember the header that is closest to the target. @@ -2049,7 +2049,7 @@ void undo_time(int step, bool sec, bool file, bool absolute) // "b_u_seq_cur"). When the timestamp is equal find the // highest/lowest sequence number. if ((step < 0 ? uhp->uh_seq <= curbuf->b_u_seq_cur - : uhp->uh_seq > curbuf->b_u_seq_cur) + : uhp->uh_seq > curbuf->b_u_seq_cur) && ((dosec && val == closest) ? (step < 0 ? uhp->uh_seq < closest_seq @@ -2505,8 +2505,8 @@ static void u_undoredo(int undo, bool do_buf_event) if (undo) { // We are below the previous undo. However, to make ":earlier 1s" // work we compute this as being just above the just undone change. - curbuf->b_u_seq_cur = curhead->uh_next.ptr ? - curhead->uh_next.ptr->uh_seq : 0; + curbuf->b_u_seq_cur = curhead->uh_next.ptr + ? curhead->uh_next.ptr->uh_seq : 0; } // Remember where we are for ":earlier 1f" and ":later 1f". |