To: vim_dev@googlegroups.com Subject: Patch 8.2.4610 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4610 Problem: Some conditions are always true. Solution: Remove the useless conditions. (closes #9993) Files: src/clientserver.c, src/drawline.c, src/drawscreen.c, src/ex_cmds.c, src/fileio.c, src/message.c, src/misc2.c, src/ops.c, src/sign.c, src/spell.c, src/vim9cmds.c, src/window.c *** ../vim-8.2.4609/src/clientserver.c 2022-03-21 19:52:50.724673262 +0000 --- src/clientserver.c 2022-03-22 20:38:51.026757322 +0000 *************** *** 420,426 **** * 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) { int numFiles = *argc - i - 1; int j; --- 420,426 ---- * For --remote-wait: Wait until the server did edit each * file. Also detect that the server no longer runs. */ ! if (argtype == ARGTYPE_EDIT_WAIT) { int numFiles = *argc - i - 1; int j; *** ../vim-8.2.4609/src/drawline.c 2022-03-13 13:40:42.237939908 +0000 --- src/drawline.c 2022-03-22 20:38:51.026757322 +0000 *************** *** 1226,1233 **** { draw_state = WL_BRI; // if need_showbreak is set, breakindent also applies ! if (wp->w_p_bri && n_extra == 0 ! && (row != startrow || need_showbreak) # ifdef FEAT_DIFF && filler_lines == 0 # endif --- 1226,1232 ---- { draw_state = WL_BRI; // if need_showbreak is set, breakindent also applies ! if (wp->w_p_bri && (row != startrow || need_showbreak) # ifdef FEAT_DIFF && filler_lines == 0 # endif *** ../vim-8.2.4609/src/drawscreen.c 2022-03-19 11:09:52.519730941 +0000 --- src/drawscreen.c 2022-03-22 20:38:51.026757322 +0000 *************** *** 1950,1958 **** if (VIsual_active) { ! if (VIsual_active ! && (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 --- 1950,1957 ---- if (VIsual_active) { ! 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 *** ../vim-8.2.4609/src/ex_cmds.c 2022-03-05 21:13:22.747737446 +0000 --- src/ex_cmds.c 2022-03-22 20:38:51.030757310 +0000 *************** *** 2411,2418 **** if (curbufIsChanged()) #endif { ! if (other) ! --no_wait_return; no_write_message(); retval = GETFILE_NOT_WRITTEN; // file has been changed goto theend; --- 2411,2417 ---- if (curbufIsChanged()) #endif { ! --no_wait_return; no_write_message(); retval = GETFILE_NOT_WRITTEN; // file has been changed goto theend; *** ../vim-8.2.4609/src/fileio.c 2022-02-21 15:07:07.777267539 +0000 --- src/fileio.c 2022-03-22 20:38:51.030757310 +0000 *************** *** 4933,4939 **** break; } ! if (!ignore && checkitem != NULL) { int r = checkitem(context, item); --- 4933,4939 ---- break; } ! if (checkitem != NULL) { int r = checkitem(context, item); *** ../vim-8.2.4609/src/message.c 2022-02-11 15:12:06.053929449 +0000 --- src/message.c 2022-03-22 20:38:51.030757310 +0000 *************** *** 1803,1809 **** int len = (*mb_ptr2len)(str); // For multi-byte characters check for an illegal byte. ! if (has_mbyte && MB_BYTE2LEN(*str) > len) { transchar_nonprint(curbuf, buf, c); *sp = str + 1; --- 1803,1809 ---- int len = (*mb_ptr2len)(str); // For multi-byte characters check for an illegal byte. ! if (MB_BYTE2LEN(*str) > len) { transchar_nonprint(curbuf, buf, c); *sp = str + 1; *** ../vim-8.2.4609/src/misc2.c 2022-02-09 12:58:16.502258779 +0000 --- src/misc2.c 2022-03-22 20:38:51.030757310 +0000 *************** *** 596,602 **** // 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) { int cs, ce; --- 596,602 ---- // 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) { int cs, ce; *** ../vim-8.2.4609/src/ops.c 2022-02-15 11:48:17.533999966 +0000 --- src/ops.c 2022-03-22 20:38:51.030757310 +0000 *************** *** 1310,1316 **** changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, 0L); #ifdef FEAT_NETBEANS_INTG ! if (netbeans_active() && did_change) { char_u *ptr; int count; --- 1310,1316 ---- changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, 0L); #ifdef FEAT_NETBEANS_INTG ! if (netbeans_active()) { char_u *ptr; int count; *** ../vim-8.2.4609/src/sign.c 2022-01-28 15:28:00.212927659 +0000 --- src/sign.c 2022-03-22 20:38:51.030757310 +0000 *************** *** 847,853 **** if (sign->se_lnum < line1) continue; new_lnum = sign->se_lnum; ! if (sign->se_lnum >= line1 && sign->se_lnum <= line2) { if (amount != MAXLNUM) new_lnum += amount; --- 847,853 ---- if (sign->se_lnum < line1) continue; new_lnum = sign->se_lnum; ! if (sign->se_lnum <= line2) { if (amount != MAXLNUM) new_lnum += amount; *** ../vim-8.2.4609/src/spell.c 2022-02-16 19:24:03.626162408 +0000 --- src/spell.c 2022-03-22 20:38:51.030757310 +0000 *************** *** 1371,1381 **** // the cursor. if (dir == BACKWARD || lnum != wp->w_cursor.lnum ! || (lnum == wp->w_cursor.lnum ! && (wrapped ! || (colnr_T)(curline ? p - buf + len : p - buf) ! > wp->w_cursor.col))) { #ifdef FEAT_SYN_HL if (has_syntax) --- 1371,1380 ---- // the cursor. if (dir == BACKWARD || lnum != wp->w_cursor.lnum ! || (wrapped ! || (colnr_T)(curline ? p - buf + len : p - buf) ! > wp->w_cursor.col)) { #ifdef FEAT_SYN_HL if (has_syntax) *** ../vim-8.2.4609/src/vim9cmds.c 2022-03-15 12:28:06.041374341 +0000 --- src/vim9cmds.c 2022-03-22 20:38:51.030757310 +0000 *************** *** 1613,1620 **** // 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) return NULL; #ifdef FEAT_PROFILE if (cctx->ctx_compile_type == CT_PROFILE) --- 1613,1619 ---- // 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 (generate_instr(cctx, ISN_ENDTRY) == NULL) return NULL; #ifdef FEAT_PROFILE if (cctx->ctx_compile_type == CT_PROFILE) *** ../vim-8.2.4609/src/window.c 2022-03-22 18:12:57.529367476 +0000 --- src/window.c 2022-03-22 20:38:51.034757297 +0000 *************** *** 5691,5698 **** break; if (run == 2 || curfrp->fr_width == Columns) { ! if (height > room + room_cmdline) ! height = room + room_cmdline; break; } frame_setheight(curfrp->fr_parent, height --- 5691,5697 ---- break; if (run == 2 || curfrp->fr_width == Columns) { ! height = room + room_cmdline; break; } frame_setheight(curfrp->fr_parent, height *************** *** 5876,5883 **** break; if (run == 2 || curfrp->fr_height >= ROWS_AVAIL) { ! if (width > room) ! width = room; break; } frame_setwidth(curfrp->fr_parent, width --- 5875,5881 ---- break; if (run == 2 || curfrp->fr_height >= ROWS_AVAIL) { ! width = room; break; } frame_setwidth(curfrp->fr_parent, width *** ../vim-8.2.4609/src/version.c 2022-03-22 18:12:57.529367476 +0000 --- src/version.c 2022-03-22 20:40:05.530534404 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4610, /**/ -- Q: How does a UNIX Guru do Sex ? A: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///