summaryrefslogtreecommitdiffstats
path: root/src/diff.c
AgeCommit message (Collapse)Author
2024-03-16patch 9.1.0183: Wrong display or screenpos() result when toggling diff modev9.1.0183zeertzjq
Problem: Wrong display or screenpos() result when toggling diff mode. Solution: Reset w_skipcol when disabling 'wrap'. Reset w_leftcol when enabling 'wrap' (zeertzjq). fixes: #14210 closes: #14211 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-12patch 9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()v9.1.0172zeertzjq
Problem: More code can use ml_get_buf_len() instead of STRLEN(). Solution: Change more STRLEN() calls to ml_get_buf_len(). Also do not set ml_line_textlen in ml_replace_len() if "has_props" is set, because "len_arg" also includes the size of text properties in that case. (zeertzjq) closes: #14183 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-12patch 9.1.0099: Not able to use diff() with 'diffexpr'v9.1.0099Yegappan Lakshmanan
Problem: Not able to use diff() with 'diffexpr' (rickhowe, after v9.1.0096) Solution: Use a default context length of 0, update diff() help text, add a test for using diff() with 'diffexpr' (Yegappan Lakshmanan) closes: #14013 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-11patch 9.1.0096: diff() function uses 'diffexpr'v9.1.0096Yegappan Lakshmanan
Problem: diff() function uses 'diffexpr' (rickhowe) Solution: Make diff() always use internal diff(), add support for unified diff context length, sort diff() options in help (Yegappan Lakshmanan) fixes: #13989 closes: #14010 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-03patch 9.1.0072: Not able to build without FEAT_DIFFv9.1.0072Yegappan Lakshmanan
Problem: Not able to build without FEAT_DIFF (John Marriott, after 9.1.0071) Solution: Adjust #ifdefs (Yegappan Lakshmanan) closes: #13964 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-01patch 9.1.0071: Need a diff() Vim script functionv9.1.0071Yegappan Lakshmanan
Problem: Need a diff() Vim script function Solution: Add the diff() Vim script function using the xdiff internal diff library, add support for "unified" and "indices" mode. (Yegappan Lakshmanan) fixes: #4241 closes: #12321 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-04patch 9.1.0006: is*() and to*() function may be unsafev9.1.0006Keith Thompson
Problem: is*() and to*() function may be unsafe Solution: Add SAFE_* macros and start using those instead (Keith Thompson) Use SAFE_() macros for is*() and to*() functions The standard is*() and to*() functions declared in <ctype.h> have undefined behavior for negative arguments other than EOF. If plain char is signed, passing an unchecked value from argv for from user input to one of these functions has undefined behavior. Solution: Add SAFE_*() macros that cast the argument to unsigned char. Most implementations behave sanely for negative arguments, and most character values in practice are non-negative, but it's still best to avoid undefined behavior. The change from #13347 has been omitted, as this has already been separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a (v9.0.2054) fixes: #13332 closes: #13347 Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-29patch 9.0.1958: cannot complete option valuesv9.0.1958Yee Cheng Chin
Problem: cannot complete option values Solution: Add completion functions for several options Add cmdline tab-completion for setting string options Add tab-completion for setting string options on the cmdline using `:set=` (along with `:set+=` and `:set-=`). The existing tab completion for setting options currently only works when nothing is typed yet, and it only fills in with the existing value, e.g. when the user does `:set diffopt=<Tab>` it will be completed to `set diffopt=internal,filler,closeoff` and nothing else. This isn't too useful as a user usually wants auto-complete to suggest all the possible values, such as 'iblank', or 'algorithm:patience'. For set= and set+=, this adds a new optional callback function for each option that can be invoked when doing completion. This allows for each option to have control over how completion works. For example, in 'diffopt', it will suggest the default enumeration, but if `algorithm:` is selected, it will further suggest different algorithm types like 'meyers' and 'patience'. When using set=, the existing option value will be filled in as the first choice to preserve the existing behavior. When using set+= this won't happen as it doesn't make sense. For flag list options (e.g. 'mouse' and 'guioptions'), completion will take into account existing typed values (and in the case of set+=, the existing option value) to make sure it doesn't suggest duplicates. For set-=, there is a new `ExpandSettingSubtract` function which will handle flag list and comma-separated options smartly, by only suggesting values that currently exist in the option. Note that Vim has some existing code that adds special handling for 'filetype', 'syntax', and misc dir options like 'backupdir'. This change preserves them as they already work, instead of converting to the new callback API for each option. closes: #13182 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-04-04patch 9.0.1440: "rvim" can execute a shell through :diffpatchv9.0.1440Bram Moolenaar
Problem: "rvim" can execute a shell through :diffpatch. Solution: Disallow the shell "patch" command.
2023-03-07patch 9.0.1391: "clear" macros are not always usedv9.0.1391Yegappan Lakshmanan
Problem: "clear" macros are not always used. Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more places. (Yegappan Lakshmanan, closes #12104)
2023-03-07patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected filev9.0.1390Yegappan Lakshmanan
Problem: FOR_ALL_ macros are defined in an unexpected file. Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS. (Yegappan Lakshmanan, closes #12109)
2023-01-22patch 9.0.1234: the code style has to be checked manuallyv9.0.1234Bram Moolenaar
Problem: The code style has to be checked manually. Solution: Add basic code style checks in a test. Fix or avoid uncovered problems.
2023-01-09patch 9.0.1166: code is indented more than necessaryv9.0.1166Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
2022-12-26patch 9.0.1098: code uses too much indentv9.0.1098Yegappan Lakshmanan
Problem: Code uses too much indent. Solution: Use an early return. (Yegappan Lakshmanan, closes #11747)
2022-11-28patch 9.0.0965: using one window for executing autocommands is insufficientv9.0.0965Bram Moolenaar
Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands.
2022-08-14patch 9.0.0206: redraw flags are not named specificallyv9.0.0206Bram Moolenaar
Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen().
2022-07-31patch 9.0.0124: code has more indent than neededv9.0.0124zeertzjq
Problem: Code has more indent than needed. Solution: Use continue and return statements. (closes #10824)
2022-07-28patch 9.0.0101: invalid memory access in diff mode with "dp" and undov9.0.0101Bram Moolenaar
Problem: Invalid memory access in diff mode with "dp" and undo. Solution: Make sure the line number does not go below one.
2022-07-02patch 9.0.0026: accessing freed memory with diff putv9.0.0026Bram Moolenaar
Problem: Accessing freed memory with diff put. Solution: Bail out when diff pointer is no longer valid.
2022-06-26patch 8.2.5164: invalid memory access after diff buffer manipulationsv8.2.5164Bram Moolenaar
Problem: Invalid memory access after diff buffer manipulations. Solution: Use zero offset when change removes all lines in a diff block.
2022-06-26patch 8.2.5163: crash when deleting buffers in diff modev8.2.5163Bram Moolenaar
Problem: Crash when deleting buffers in diff mode. Solution: Recompute diffs later. Skip window without a valid buffer.
2022-04-15patch 8.2.4753: error from setting an option is silently ignoredv8.2.4753Bram Moolenaar
Problem: Error from setting an option is silently ignored. Solution: Handle option value errors better. Fix uses of N_().
2022-03-25patch 8.2.4624: old Coverity warning for resource leakv8.2.4624Bram Moolenaar
Problem: Old Coverity warning for resource leak. Solution: Close the file if memory allocation fails.
2022-01-05patch 8.2.4012: error messages are spread outv8.2.4012Bram Moolenaar
Problem: Error messages are spread out. Solution: Move the last error messages to errors.h.
2022-01-05patch 8.2.4010: error messages are spread outv8.2.4010Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-05patch 8.2.4008: error messages are spread outv8.2.4008Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-01patch 8.2.3967: error messages are spread outv8.2.3967Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-30patch 8.2.3943: compiler warning from gcc for uninitialized variablev8.2.3943Bram Moolenaar
Problem: Compiler warning from gcc for uninitialized variable. Solution: Initialize variable. (closes #9429)
2021-12-29patch 8.2.3931: Coverity reports a memory leakv8.2.3931Bram Moolenaar
Problem: Coverity reports a memory leak. Solution: Free memory in case of failure.
2021-12-28patch 8.2.3925: diff mode confused by NUL bytesv8.2.3925Bram Moolenaar
Problem: Diff mode confused by NUL bytes. Solution: Handle NUL bytes differently. (Christian Brabandt, closes #9421, closes #9418)
2021-12-28patch 8.2.3921: the way xdiff is used is inefficientv8.2.3921Lewis Russell
Problem: The way xdiff is used is inefficient. Solution: Use hunk_func instead of the out_line callback. (Lewis Russell, closes #9344)
2021-12-27patch 8.2.3914: various spelling mistakes in commentsv8.2.3914Dominique Pelle
Problem: Various spelling mistakes in comments. Solution: Fix the mistakes. (Dominique Pellé, closes #9416)
2021-12-16patch 8.2.3830: error messages are spread outv8.2.3830Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2021-10-22patch 8.2.3556: filler lines are incorrect for other window in diff modev8.2.3556Bram Moolenaar
Problem: Filler lines are incorrect for other window in diff mode after making a change. Solution: Copy filler lines from the current window. (closes #8809)
2021-09-01patch 8.2.3394: filler lines are wrong when changing text in diff modev8.2.3394Bram Moolenaar
Problem: Filler lines are wrong when changing text in diff mode. Solution: Don't change the filler lines on every change. Check scrollbinding when updating the filler lines. (closes #8809)
2021-08-31patch 8.2.3390: included xdiff code is outdatedv8.2.3390Christian Brabandt
Problem: Included xdiff code is outdated. Solution: Sync with xdiff in git 2.33. (Christian Brabandt, closes #8431)
2021-07-27patch 8.2.3229: Vim9: runtime and compile time type checks are not the samev8.2.3229Yegappan Lakshmanan
Problem: Vim9: runtime and compile time type checks are not the same. Solution: Add more runtime type checks for builtin functions. (Yegappan Lakshmanan, closes #8646)
2021-07-21patch 8.2.3194: Vim9: argument types are not checked at compile timev8.2.3194Yegappan Lakshmanan
Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks, simplify some. (Yegappan Lakshmanan, closes #8598)
2021-07-20patch 8.2.3188: Vim9: argument types are not checked at compile timev8.2.3188Yegappan Lakshmanan
Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks, also at runtime. (Yegappan Lakshmanan, closes #8587)
2021-07-17patch 8.2.3173: Vim9: argument types are not checked at compile timev8.2.3173Yegappan Lakshmanan
Problem: Vim9: argument types are not checked at compile time. Solution: Add more type checks. (Yegappan Lakshmanan, closes #8581)
2021-05-24patch 8.2.2880: unified diff fails if actually usedv8.2.2880glacambre
Problem: Unified diff fails if actually used. Solution: Invoke :diffupdate in the test. Fix the check for working external diff. (Ghjuvan Lacambre, Christian Brabandt, closes #8197)
2021-02-10patch 8.2.2490: 'wrap' option is always reset when starting diff modev8.2.2490Bram Moolenaar
Problem: 'wrap' option is always reset when starting diff mode. Solution: Add the "followwrap" item in 'diffopt'. (Rick Howe, closes #7797)
2020-10-24patch 8.2.1898: command modifier parsing always uses global cmdmodv8.2.1898Bram Moolenaar
Problem: Command modifier parsing always uses global cmdmod. Solution: Pass in cmdmod_T to use. Rename struct fields consistently.
2020-06-09patch 8.2.0938: NFA regexp uses tolower ()to compare ignore-casev8.2.0938Bram Moolenaar
Problem: NFA regexp uses tolower() to compare ignore-case. (Thayne McCombs) Solution: Use utf_fold() when possible. (ref. neovim #12456)
2020-06-07patch 8.2.0928: many type casts are used for vim_strnsave()v8.2.0928Bram Moolenaar
Problem: Many type casts are used for vim_strnsave(). Solution: Make the length argument size_t instead of int. (Ken Takata, closes #5633) Remove some type casts.
2020-05-30patch 8.2.0853: ml_delete() often called with FALSE argumentv8.2.0853Bram Moolenaar
Problem: ml_delete() often called with FALSE argument. Solution: Use ml_delete_flags(x, ML_DEL_MESSAGE) when argument is TRUE.
2020-04-12patch 8.2.0559: clearing a struct is verbosev8.2.0559Bram Moolenaar
Problem: Clearing a struct is verbose. Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
2020-04-02patch 8.2.0500: using the same loop in many placesv8.2.0500Bram Moolenaar
Problem: Using the same loop in many places. Solution: Define more FOR_ALL macros. (Yegappan Lakshmanan, closes #5339)
2019-12-01patch 8.1.2378: using old C style commentsv8.1.2378Bram Moolenaar
Problem: Using old C style comments. Solution: Use // comments where appropriate.
2019-11-16patch 8.1.2302: :lockmarks does not work for '[ and ']v8.1.2302Bram Moolenaar
Problem: :lockmarks does not work for '[ and ']. Solution: save and restore '[ and '] marks. (James McCoy, closes #5222)