aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-04-26 23:23:44 +0200
committerGitHub <noreply@github.com>2023-04-26 23:23:44 +0200
commit3b0df1780e2c8526bda5dead18ee7cc45925caba (patch)
treec8415dc986f1cd3ddf6044b4ec0318a089db3ed7 /src/nvim/ops.c
parent7d0479c55810af9bf9f115ba69d1419ea81ec41e (diff)
downloadrneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.tar.gz
rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.tar.bz2
rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.zip
refactor: uncrustify
Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index b50ef72058..2919b94d41 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -2090,7 +2090,7 @@ void op_tilde(oparg_T *oap)
did_change = swapchars(oap->op_type, &pos,
oap->end.col - pos.col + 1);
} else {
- for (;;) {
+ while (true) {
did_change |= swapchars(oap->op_type, &pos,
pos.lnum == oap->end.lnum ? oap->end.col + 1 :
(int)strlen(ml_get_pos(&pos)));
@@ -2944,7 +2944,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
long cnt;
const pos_T orig_start = curbuf->b_op_start;
const pos_T orig_end = curbuf->b_op_end;
- unsigned int cur_ve_flags = get_ve_flags();
+ unsigned cur_ve_flags = get_ve_flags();
if (flags & PUT_FIXINDENT) {
orig_indent = get_indent();
@@ -3056,7 +3056,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
// For the = register we need to split the string at NL
// characters.
// Loop twice: count the number of lines and save them.
- for (;;) {
+ while (true) {
y_size = 0;
ptr = insert_string;
while (ptr != NULL) {
@@ -3717,7 +3717,7 @@ end:
/// there move it left.
void adjust_cursor_eol(void)
{
- unsigned int cur_ve_flags = get_ve_flags();
+ unsigned cur_ve_flags = get_ve_flags();
const bool adj_cursor = (curwin->w_cursor.col > 0
&& gchar_cursor() == NUL
@@ -6470,7 +6470,7 @@ static yankreg_T *adjust_clipboard_name(int *name, bool quiet, bool writing)
}
if (cb_flags & CB_UNNAMEDPLUS) {
- *name = (cb_flags & CB_UNNAMED && writing) ? '"': '+';
+ *name = (cb_flags & CB_UNNAMED && writing) ? '"' : '+';
target = &y_regs[PLUS_REGISTER];
} else {
*name = '*';