summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-22 20:42:12 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-22 20:42:12 +0000
commitfe154990c1c57fac6d5a4b1bfb682e27adb4eb8c (patch)
treef2bbad2d3535a267d934e85eeadf1d652936d5eb
parent6f2465d336a9d4afe392db4084ef7e9db17e67c1 (diff)
downloadvim-git-fe154990c1c57fac6d5a4b1bfb682e27adb4eb8c.tar.gz
patch 8.2.4610: some conditions are always truev8.2.4610
Problem: Some conditions are always true. Solution: Remove the useless conditions. (closes #9993)
-rw-r--r--src/clientserver.c2
-rw-r--r--src/drawline.c3
-rw-r--r--src/drawscreen.c5
-rw-r--r--src/ex_cmds.c3
-rw-r--r--src/fileio.c2
-rw-r--r--src/message.c2
-rw-r--r--src/misc2.c2
-rw-r--r--src/ops.c2
-rw-r--r--src/sign.c2
-rw-r--r--src/spell.c7
-rw-r--r--src/version.c2
-rw-r--r--src/vim9cmds.c3
-rw-r--r--src/window.c6
13 files changed, 18 insertions, 23 deletions
diff --git a/src/clientserver.c b/src/clientserver.c
index 15e490fd5..bb2108d7d 100644
--- a/src/clientserver.c
+++ b/src/clientserver.c
@@ -420,7 +420,7 @@ cmdsrv_main(
* For --remote-wait: Wait until the server did edit each
* file. Also detect that the server no longer runs.
*/
- if (ret >= 0 && argtype == ARGTYPE_EDIT_WAIT)
+ if (argtype == ARGTYPE_EDIT_WAIT)
{
int numFiles = *argc - i - 1;
int j;
diff --git a/src/drawline.c b/src/drawline.c
index d8b7c4aad..747a1e33b 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1226,8 +1226,7 @@ win_line(
{
draw_state = WL_BRI;
// if need_showbreak is set, breakindent also applies
- if (wp->w_p_bri && n_extra == 0
- && (row != startrow || need_showbreak)
+ if (wp->w_p_bri && (row != startrow || need_showbreak)
# ifdef FEAT_DIFF
&& filler_lines == 0
# endif
diff --git a/src/drawscreen.c b/src/drawscreen.c
index cdfcac04d..a562c4d84 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -1950,9 +1950,8 @@ win_update(win_T *wp)
if (VIsual_active)
{
- if (VIsual_active
- && (VIsual_mode != wp->w_old_visual_mode
- || type == INVERTED_ALL))
+ if (VIsual_mode != wp->w_old_visual_mode
+ || type == INVERTED_ALL)
{
// If the type of Visual selection changed, redraw the whole
// selection. Also when the ownership of the X selection is
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 13cde84fd..be3584535 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2411,8 +2411,7 @@ getfile(
if (curbufIsChanged())
#endif
{
- if (other)
- --no_wait_return;
+ --no_wait_return;
no_write_message();
retval = GETFILE_NOT_WRITTEN; // file has been changed
goto theend;
diff --git a/src/fileio.c b/src/fileio.c
index 21417c27f..9ef2dbd3b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4933,7 +4933,7 @@ readdir_core(
break;
}
- if (!ignore && checkitem != NULL)
+ if (checkitem != NULL)
{
int r = checkitem(context, item);
diff --git a/src/message.c b/src/message.c
index af91bd813..2499723e4 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1803,7 +1803,7 @@ str2special(
int len = (*mb_ptr2len)(str);
// For multi-byte characters check for an illegal byte.
- if (has_mbyte && MB_BYTE2LEN(*str) > len)
+ if (MB_BYTE2LEN(*str) > len)
{
transchar_nonprint(curbuf, buf, c);
*sp = str + 1;
diff --git a/src/misc2.c b/src/misc2.c
index 38da7e59c..c23c689c0 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -596,7 +596,7 @@ check_cursor_col_win(win_T *win)
// Make sure that coladd is not more than the char width.
// Not for the last character, coladd is then used when the cursor
// is actually after the last character.
- if (win->w_cursor.col + 1 < len && win->w_cursor.coladd > 0)
+ if (win->w_cursor.col + 1 < len)
{
int cs, ce;
diff --git a/src/ops.c b/src/ops.c
index 1c13dac64..30e88c798 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1310,7 +1310,7 @@ op_tilde(oparg_T *oap)
changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
0L);
#ifdef FEAT_NETBEANS_INTG
- if (netbeans_active() && did_change)
+ if (netbeans_active())
{
char_u *ptr;
int count;
diff --git a/src/sign.c b/src/sign.c
index e1aae5121..3d9c387d4 100644
--- a/src/sign.c
+++ b/src/sign.c
@@ -847,7 +847,7 @@ sign_mark_adjust(
if (sign->se_lnum < line1)
continue;
new_lnum = sign->se_lnum;
- if (sign->se_lnum >= line1 && sign->se_lnum <= line2)
+ if (sign->se_lnum <= line2)
{
if (amount != MAXLNUM)
new_lnum += amount;
diff --git a/src/spell.c b/src/spell.c
index 81ba04977..5145ce198 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -1371,11 +1371,10 @@ spell_move_to(
// the cursor.
if (dir == BACKWARD
|| lnum != wp->w_cursor.lnum
- || (lnum == wp->w_cursor.lnum
- && (wrapped
- || (colnr_T)(curline ? p - buf + len
+ || (wrapped
+ || (colnr_T)(curline ? p - buf + len
: p - buf)
- > wp->w_cursor.col)))
+ > wp->w_cursor.col))
{
#ifdef FEAT_SYN_HL
if (has_syntax)
diff --git a/src/version.c b/src/version.c
index cd3d9cdee..c6425673d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4610,
+/**/
4609,
/**/
4608,
diff --git a/src/vim9cmds.c b/src/vim9cmds.c
index cc2c04158..072a106a5 100644
--- a/src/vim9cmds.c
+++ b/src/vim9cmds.c
@@ -1613,8 +1613,7 @@ compile_endtry(char_u *arg, cctx_T *cctx)
// End :catch or :finally scope: set instruction index in ISN_TRY
// instruction
try_isn->isn_arg.tryref.try_ref->try_endtry = instr->ga_len;
- if (cctx->ctx_skip != SKIP_YES
- && generate_instr(cctx, ISN_ENDTRY) == NULL)
+ if (generate_instr(cctx, ISN_ENDTRY) == NULL)
return NULL;
#ifdef FEAT_PROFILE
if (cctx->ctx_compile_type == CT_PROFILE)
diff --git a/src/window.c b/src/window.c
index 435ad037a..5bda6add9 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5691,8 +5691,7 @@ frame_setheight(frame_T *curfrp, int height)
break;
if (run == 2 || curfrp->fr_width == Columns)
{
- if (height > room + room_cmdline)
- height = room + room_cmdline;
+ height = room + room_cmdline;
break;
}
frame_setheight(curfrp->fr_parent, height
@@ -5876,8 +5875,7 @@ frame_setwidth(frame_T *curfrp, int width)
break;
if (run == 2 || curfrp->fr_height >= ROWS_AVAIL)
{
- if (width > room)
- width = room;
+ width = room;
break;
}
frame_setwidth(curfrp->fr_parent, width