summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/path.h
AgeCommit message (Collapse)AuthorFiles
2026-04-24fix(path): normalize path slashes on Windows #37729tao1
Problem: On Windows, path separators may become inconsistent for various reasons, which makes normalization quite painful. Solution: Normalize paths to `/` at the entry boundaries and always use it internally, converting back only in rare cases where `\` is really needed (e.g. cmd.exe/bat scripts?). This is the first commit in a series of incremental steps. Note: * some funcs won't respect shellslash. e.g. `expand/fnamemodify` * some funcs still respect shellslash, but will be updated in a follow PR. e.g. `ex_pwd/f_chdir/f_getcwd` * uv's built-in funcs always return `\`. e.g. `uv.cwd/uv.exepath` Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-04-06vim-patch:9.2.0291: too many strlen() callszeertzjq1
Problem: too many strlen() calls Solution: refactor concat_fname() and remove calls to strlen() (John Marriott) Function `concat_fnames()` can make up to 5 calls to `STRLEN()` (either directly or indirectly via `STRCAT()`). In many cases the lengths of arguments `fname1` and/or `fname2` are either known or can simply be calculated. This Commit refactors this function to accept the lengths of arguments `fname1` and `fname2` as arguments. It also adds new argument `ret` to return the resulting string as a `string_T`. Additionally: - function `add_pack_dir_to_rtp()` in `scriptfile.c`: Use a `string_T` to store local variables `new_rtp` and `afterdir`. Replace calls to `STRCAT()` with calls to `STRCPY()`. Change type of variable `keep` to `size_t` for consistency with other lengths. - function `qf_get_fnum()` in `quickfix.c`: Use a `string_T` to store local variables `ptr` and `bufname` - function `qf_push_dir()` in `quickfix.c`: Use a `string_T` to store local variable `dirname`. Replace call to `vim_strsave()` with `vim_strnsave()`. - function `qf_guess_filepath()` in `quickfix.c`: Use a `string_T` to store local variable `fullname`. - function `make_percent_swname()` in `memline.c`: Rename some variables to better reflect their use. Use a `string_T` to store local variables `d` and `fixed_name`. Slightly refactor to remove need to create an extra string. - function `get_file_in_dir()` in `memline.c`: Use a `string_T` to store local variables `tail` and `retval`. Move some variables closer to where they are used. - function `cs_resolve_file()` in `if_cscope.c`: Use a `string_T` to store local variable `csdir`. Remove one call to `STRLEN()`. - function `add_pathsep()` in `filepath.c`: Refactor and remove 1 call to `STRLEN()` - function `set_init_xdg_rtp()` in `option.c`: Use a `string_T` to store local variable `vimrc_xdg`. closes: vim/vim#19854 https://github.com/vim/vim/commit/cb51add7ae400a47407fb7fb7b7a54e238d4fdf4 Co-authored-by: John Marriott <basilisk@internode.on.net> Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-14refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl1
These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
2024-07-12vim-patch:9.1.0568: Cannot expand paths from 'cdpath' settingzeertzjq1
Problem: Cannot expand paths from 'cdpath' setting (Daniel Hahler) Solution: Implement 'cdpath' completion, add the new 'dir_in_path' completion type (LemonBoy) fixes vim/vim#374 closes: vim/vim#15205 https://github.com/vim/vim/commit/a20bf69a3b32024cb7809be87af33bf9dc490a19 Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-11-30refactor(IWYU): fix includes for cmdhist.h (#26324)zeertzjq1
2023-11-28refactor: fix runtime_defs.h (#26259)zeertzjq1
2023-11-27refactor: rename types.h to types_defs.hdundargoc1
2023-11-27refactor: move Arena and ArenaMem to memory_defs.h (#26240)zeertzjq1
2023-11-26refactor: move garray_T to garray_defs.h (#26227)zeertzjq1
2023-11-12refactor: replace manual header guards with #pragma oncedundargoc1
It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard.
2023-04-19fix(runtime): do not allow breakcheck inside runtime path calculationbfredl1
problem: breakcheck might run arbitrary lua code, which might require modules and thus invoke runtime path calculation recursively. solution: Block the use of breakcheck when expanding glob patterns inside 'runtimepath' fixes #23012
2023-01-13build: remove clint error suppression #21782dundargoc1
Fix remaining clint errors and remove error suppression completely. Rename the lint targets to align with the established naming convention: - lintc-clint lints with clint.py. - lintc-uncrustify lints with uncrustify. - lintc runs both targets. lintc is also provided as a make target for convenience. After this change we can remove these files: https://github.com/neovim/doc/tree/gh-pages/reports/clint https://github.com/neovim/doc/blob/main/ci/clint-errors.sh
2022-09-02refactor: migrate comment style (#20012)Lewis Russell1
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>
2021-10-29refactor: uncrustify #16090dundargoc1
2021-10-12refactor: format all C files under nvim/ #15977dundargoc1
* refactor: format all C files under nvim * refactor: disable formatting for Vim-owned files: * src/nvim/indent_c.c * src/nvim/regexp.c * src/nvim/regexp_nfa.c * src/nvim/testdir/samples/memfile_test.c
2019-10-05vim-patch:8.1.1371: cannot recover from a swap file #11081Jurica Bradarić1
Problem: Cannot recover from a swap file. Solution: Do not expand environment variables in the swap file name. Do not check the extension when we already know a file is a swap file. (Ken Takata, closes 4415, closes vim/vim#4369) https://github.com/vim/vim/commit/99499b1c05f85f83876b828eea3f6e14f0f407b4
2016-05-02Linting.KillTheMule1
2016-05-02vim-patch:7.4.672KillTheMule1
Problem: When completing a shell command, directories in the current directory are not listed. Solution: When "." is not in $PATH also look in the current directory for directories. https://github.com/vim/vim/commit/b5971141dff0c69355fd64196fcc0d0d071d4c82 Most of it applied manually.
2016-04-20vim-patch:7.4.1120Jurica Bradaric1
Problem: delete(x, 'rf') fails if a directory is empty. (Lcd) Solution: Ignore not finding matches in an empty directory. https://github.com/vim/vim/commit/336bd622c31e1805495c034e1a8cfadcc0bbabc7
2016-04-20vim-patch:7.4.1116Jurica Bradaric1
Problem: delete(x, 'rf') does not delete files starting with a dot. Solution: Also delete files starting with a dot. https://github.com/vim/vim/commit/b0967d587fc420fa02832533d4915c85d1a78c17
2016-01-22vim-patch:7.4.654Jurica Bradaric1
Problem: glob() and globpath() cannot include links to non-existing files. (Charles Campbell) Solution: Add an argument to include all links with glob(). (James McCoy) Also for globpath(). https://github.com/vim/vim/commit/a245bc79b4c6b83a4b5b6cdb95c4d2165762a20b
2014-12-18vim-patch:7.4.423Florian Walch1
Problem: expand("$shell") does not work as documented. Solution: Do not escape the $ when expanding environment variables. https://code.google.com/p/vim/source/detail?r=v7-4-423
2014-06-12move EW_* defines to path.hBrandon Coleman1
2014-06-02Add automatic generation of headersZyX1
- The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception.
2014-06-02Move documentation from function declarations to definitionsZyX1
Uses a perl script to move it (scripts/movedocs.pl)
2014-05-15Introduce nvim namespace: Fix define guards.Eliseo Martínez1
Change define guards from NEOVIM_XXX_H to NVIM_XXX_H: - Change header files. - Change clint correct guard name calculation.
2014-05-15Introduce nvim namespace: Fix project-local includes.Eliseo Martínez1
Prepend 'nvim/' in all project-local (non-system) includes.
2014-05-15Introduce nvim namespace: Move files.Eliseo Martínez1
Move files from src/ to src/nvim/. - src/nvim/ becomes the new root dir for nvim executable sources. - src/libnvim/ is planned to become root dir of the neovim library.