aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/strings.c
Commit message (Collapse)AuthorAge
* refactor: move function macros out of vim_defs.h (#26300)zeertzjq2023-11-29
|
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* refactor: rename types.h to types_defs.hdundargoc2023-11-27
|
* refactor: enable formatting for ternariesdundargoc2023-11-20
| | | | | | This requires removing the "Inner expression should be aligned" rule from clint as it prevents essentially any formatting regarding ternary operators.
* refactor: follow style guidedundargoc2023-11-19
| | | | | - reduce variable scope - prefer initialization over declaration and assignment
* refactor: follow style guidedundargoc2023-11-13
| | | | | | - reduce variable scope - prefer initialization over declaration and assignment - use bool to represent boolean values
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)zeertzjq2023-11-10
| | | | When the given length is exactly the number of bytes to copy, xmemdupz() makes the intention clearer.
* vim-patch:9.0.2041: trim(): hard to use default mask (#25692)zeertzjq2023-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: trim(): hard to use default mask (partly revert v9.0.2040) Solution: use default mask when it is empty The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. Currently, an empty 'mask' will make 'trim()' call return 'text' value that is passed in unmodified. It is unlikely that someone is using it, so the chances of scripts being broken by this change are low. Also, this reverts commit 9.0.2040 (which uses v:none for the default and requires to use an empty string instead). closes: vim/vim#13358 https://github.com/vim/vim/commit/8079917447e7436dccc2e4cd4a4a56ae0a4712f2 vim-patch:9.0.2040: trim(): hard to use default mask Problem: trim(): hard to use default mask Solution: Use default 'mask' when it is v:none The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. 'v:none' is already used to mean "use the default argument value" in user defined functions. See |none-function_argument| in help. closes: vim/vim#13363 https://github.com/vim/vim/commit/6e6386716f9494ae86027c6d34f657fd03dfec42 Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
* vim-patch:9.0.1997: Some unused code in move.c and string.cdundargoc2023-10-07
| | | | | | | | | | | Problem: Some unused code in move.c and string.c Solution: Remove it closes: vim/vim#13288 https://github.com/vim/vim/commit/580c1fcb4ad85360cd3a361c3c8e37b534153d60 Co-authored-by: dundargoc <gocdundar@gmail.com>
* vim-patch:9.0.1990: strange error numberzeertzjq2023-10-07
| | | | | | | | | | | | Problem: strange error number Solution: change error number, add doc tag for E1507 closes: vim/vim#13270 https://github.com/vim/vim/commit/ea746f9e862092aef3d4e95c64d116759b9fabe0 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
* build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
|
* vim-patch:9.0.1950: Vim9: error codes spread out (#25405)zeertzjq2023-09-29
| | | | | | | | | | | | | | Problem: Vim9: error codes spread out Solution: group them together and reserve 100 more for future use Reserve 100 error codes for future enhancements to the Vim9 class support closes: vim/vim#13207 https://github.com/vim/vim/commit/413f83990f15d5d59d27ab741670f527a7a3feb8 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.1884: Wrong order of arguments for error messages (#25055)zeertzjq2023-09-09
| | | | | | | | | | Problem: Wrong order of arguments for error messages Solution: Reverse order or arguments for e_aptypes_is_null_nr_str closes: vim/vim#13051 https://github.com/vim/vim/commit/1bd2cb11694690a77e4141bce2e34d9dfb882f1c Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
* vim-patch:9.0.1863: wrong format specifiers in e_aptypes_is_null_str_nr (#25015)zeertzjq2023-09-04
| | | | | | | | Problem: wrong format specifiers in e_aptypes_is_null_str_nr Solution: Fix the wrong format specifier closes: vim/vim#13020 https://github.com/vim/vim/commit/7db89bdc23e53c7bc43af6f1c7281bc69a6a3098
* vim-patch:9.0.1856: issues with formatting positional arguments (#25013)zeertzjq2023-09-04
| | | | | | | | | | | | | Problem: issues with formatting positional arguments Solution: fix them, add tests and documentation closes: vim/vim#12140 closes: vim/vim#12985 Tentatively fix message_test. Check NULL ptr. https://github.com/vim/vim/commit/aa90d4f031f73a34aaef5746931ea746849a2231 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
* vim-patch:9.0.1515: reverse() does not work for a Stringzeertzjq2023-08-19
| | | | | | | | | | | | | | | | | | | Problem: reverse() does not work for a String. Solution: Implement reverse() for a String. (Yegappan Lakshmanan, closes vim/vim#12179) https://github.com/vim/vim/commit/03ff1c2dde7f15eca5c9baa6dafbda9b49bedc3b vim-patch:9.0.1738: Duplicate code to reverse a string Problem: Duplicate code to reverse a string Solution: Move reverse_text() to strings.c and remove string_reverse(). closes: vim/vim#12847 https://github.com/vim/vim/commit/4dd266cb66d901cf5324f09405cfea3f004bd29f Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* fix(printf): make positional %zd and %zu work (#24722)zeertzjq2023-08-15
|
* vim-patch:9.0.1704: Cannot use positional arguments for printf() (#24719)zeertzjq2023-08-15
| | | | | | | | | | Problem: Cannot use positional arguments for printf() Solution: Support positional arguments in string formatting closes: vim/vim#12140 https://github.com/vim/vim/commit/0c6181fec4c362eb9682d5af583341eb20cb1af5 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
* fix(runtime): respect 'fileignorecase' when sourcing (#24344)zeertzjq2023-07-14
|
* perf(rtp): reduce rtp scans (#24191)Lewis Russell2023-07-13
| | | | | | | | | | | * perf(rtp): reduce rtp scans Problem: Scanning the filesystem is expensive and particularly affects startuptime. Solution: Reduce the amount of redundant directory scans by relying less on glob patterns and handle vim and lua sourcing lower down.
* fix(messages): use "Vimscript" instead of "VimL" #24111Justin M. Keyes2023-06-22
| | | | followup to #24109 fix #16150
* vim-patch:9.0.1629: having utf16idx() rounding up is inconvenient (#24019)zeertzjq2023-06-14
| | | | | | | | Problem: Having utf16idx() rounding up is inconvenient. Solution: Make utf16idx() round down. (Yegappan Lakshmanan, closes vim/vim#12523) https://github.com/vim/vim/commit/95707037afa1aeae4f3494dc623a721ceed7fc4e Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.1617: charidx() result is not consistent with byteidx() (#23963)zeertzjq2023-06-09
| | | | | | | | | | Problem: charidx() and utf16idx() result is not consistent with byteidx(). Solution: When the index is equal to the length of the text return the lenght of the text instead of -1. (Yegappan Lakshmanan, closes vim/vim#12503) https://github.com/vim/vim/commit/577922b917e48285a7a312daf7b5bbc6e272939c Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.1524: passing -1 for bool is not always rejectedzeertzjq2023-05-08
| | | | | | | Problem: Passing -1 for bool is not always rejected. Solution: Check for error in a better way. (closes vim/vim#12358) https://github.com/vim/vim/commit/8cf51376b842e0060edf08bd2e5bd9933c552ecf
* vim-patch:9.0.1522: some functions give two error messageszeertzjq2023-05-08
| | | | | | | | | | | | Problem: Some functions give two error messages. Solution: Do not give a second error message. (closes vim/vim#12352) https://github.com/vim/vim/commit/e4098457ab9c94225b1b0e3c5e06b82b75587971 It seems that tv_get_bool() is actually not exactly the same as tv_get_number(), so change it to a function instead. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2607: strcharpart() cannot include composing characterszeertzjq2023-05-04
| | | | | | | | | Problem: strcharpart() cannot include composing characters. Solution: Add the {skipcc} argument. https://github.com/vim/vim/commit/02b4d9b18a03549b68e364e428392b7a62766c74 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: uncrustifydundargoc2023-04-26
| | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
* vim-patch:9.0.1485: no functions for converting from/to UTF-16 index (#23318)zeertzjq2023-04-26
| | | | | | | | | Problem: no functions for converting from/to UTF-16 index. Solution: Add UTF-16 flag to existing funtions and add strutf16len() and utf16idx(). (Yegappan Lakshmanan, closes vim/vim#12216) https://github.com/vim/vim/commit/67672ef097dd708244ff042a8364994da2b91e75 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.3139: functions for string manipulation are spread out (#23316)zeertzjq2023-04-26
| | | | | | | | | Problem: Functions for string manipulation are spread out. Solution: Move string related functions to a new source file. (Yegappan Lakshmanan, closes vim/vim#8470) https://github.com/vim/vim/commit/a2438132a675be4dde3acbdf03ba1fdb2f09427c Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* refactor: remove redundant castsii142023-04-07
|
* refactor: remove redundant castsii142023-04-07
|
* refactor: replace char_u with char 25 (#21838)dundargoc2023-01-19
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 22 (#21786)dundargoc2023-01-17
| | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 20 (#21714)dundargoc2023-01-13
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 16 - remove STRNCMP (#21208)dundargoc2022-12-21
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-11-26
| | | | Work on https://github.com/neovim/neovim/issues/459
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* Merge pull request #20821 from dundargoc/refactor/clang-tidybfredl2022-11-08
|\ | | | | refactor: fix clang-tidy warnings
| * refactor: fix clang-tidy warningsdundargoc2022-11-06
| | | | | | | | | | | | | | | | Enable and fix bugprone-misplaced-widening-cast warning. Fix some modernize-macro-to-enum and readability-else-after-return warnings, but don't enable them. While the warnings can be useful, they are in general too noisy to enable.
* | refactor: more clint (#20910)Lewis Russell2022-11-07
|/
* build(lint): remove clint.py rules for braces #20880dundargoc2022-11-01
| | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also https://github.com/neovim/neovim/pull/18563
* vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)dundargoc2022-09-18
| | | | | | | Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes vim/vim#3932) https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9
* refactor: replace char_u with charDundar Göc2022-09-11
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-09-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-09-06
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: migrate comment style 2 #20080dundargoc2022-09-06
|
* refactor: migrate comment style (#20012)Lewis Russell2022-09-02
| | | | | | | | | Done automatically using the following perl command: perl -pi -0777pe 's#\n\K */\*\n(.+?)\s*\*/\n#join("\n", map { $_ =~ s:^\s*\K \*://:; $_ } split("\n", $1)) . "\n"#sge' src/nvim/**/*.c Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: replace char_u with charDundar Göc2022-09-01
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 4 (#19987)dundargoc2022-08-30
| | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459