aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
Commit message (Collapse)AuthorAge
...
* refactor: make char * parameters const in message.cii142023-04-07
| | | | Add const to char * parameters in message.c functions and remove some redundant casts.
* refactor: remove use of reserved c++ keywordsii142023-04-06
| | | | | | libnvim couldn't be easily used in C++ due to the use of reserved keywords. Additionally, add explicit casts to *alloc function calls used in inline functions, as C++ doesn't allow implicit casts from void pointers.
* refactor: add const and remove unnecessary casts (#22841)ii142023-04-01
|
* refactor(build): graduate HAVE_LOCALE_H featurebfredl2023-03-03
| | | | | | Merge locale.h into os/lang.h Having a source file with the same name as a system header we use is considered an anti-pattern.
* refactor(build): remove unused stdlib function and include checksbfredl2023-03-03
| | | | | | In addition: merge some checks for the same feature into one test_compile. This reduces the total number of test compiles which speeds up the cmake configure stage.
* fix(MSVC): set the active code page to utf-8 (#22384)dundargoc2023-02-26
| | | | | | | | Neovim expects character encoding to be UTF-8, and deviation from this causes bugs such as lua files not being recognized for non-ascii paths. This changes the behavior of fopen, which defaults to using the currently active codepage. Closes: https://github.com/neovim/neovim/issues/18122
* feat: $NVIM_APPNAME #22128Ghjuvan Lacambre2023-02-16
| | | | | | | | | | | | | | | | | | | | This commit implements the ability to control all of the XDG paths Neovim should use. This is done by setting an environment variable named NVIM_APPNAME. For example, setting $NVIM_APPNAME makes Neovim look for its configuration directory in $XDG_CONFIG_HOME/$NVIM_APPNAME instead of $XDG_CONFIG_HOME/nvim. If NVIM_APPNAME is not set or is an empty string, "nvim" will be used as default. The usecase for this feature is to enable an easy way to switch from configuration to configuration. One might argue that the various $XDG environment variables can already be used for this usecase. However, setting $XDG environment variables also affects tools spawned by Neovim. For example, while setting $XDG_CONFIG_HOME will enable Neovim to use a different configuration directory, it will also prevent Git from finding its "default" configuration. Closes https://github.com/neovim/neovim/issues/21691
* Merge pull request #22056 from lewis6991/refactor/fileio_moreLewis Russell2023-02-15
|\ | | | | refactor `fileio.c`
| * refactor(fileio.c): normalize ifdefsLewis Russell2023-02-01
| | | | | | | | | | As well as improving readbability, this also avoids all Treesitter parsing errors which cannot handle elaborate use of the preprocessor.
| * refactor(fileio.c): remove HAVE_ACL ifdefsLewis Russell2023-02-01
| |
* | fix(tui): exit on input eofzeertzjq2023-02-14
| |
* | build: enable MSVC level 3 warnings (#21934)dundargoc2023-02-11
| | | | | | | | | | | | MSVC has 4 different warning levels: 1 (severe), 2 (significant), 3 (production quality) and 4 (informational). Enabling level 3 warnings mostly revealed conversion problems, similar to GCC/clang -Wconversion flag.
* | refactor(exit): pass error message to preserve_exit() (#22097)zeertzjq2023-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1. Some calls to preserve_exit() don't put a message in IObuff, so the IObuff printed by preserve_exit() contains unrelated information. 2. If a TUI client runs out of memory or receives a deadly signal, the error message is shown on alternate screen and cannot be easily seen because the TUI exits alternate screen soon afterwards. Solution: Pass error message to preserve_exit() and exit alternate screen before printing it. Note that this doesn't fix the problem that server error messages cannot be easily seen on exit. This is tracked in #21608 and #21843.
* | fix(lua): mark some eval functions that can run in API-fastLewis Russell2023-02-02
|/
* fix: add manifest file to correctly determine Windows version (#21953)dundargoc2023-01-23
| | | | | | | | | In Windows 8.1 and later, GetVersionEx does not automatically give the correct information if a manifest file doesn't explicitly mention we support that version. This will enable further detection for Windows 8.1 and Windows 10/11 when using windowsversion(), with an easy way to add future versions. A list of all operating system versions can be found here: https://learn.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version
* fix(Windows): restore console title at exit #21922Enan Ajmain2023-01-23
| | | Fixes #21404
* 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 24 (#21823)dundargoc2023-01-18
| | | | | 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
* Merge pull request #21831 from bfredl/nofdbfredl2023-01-16
|\ | | | | fix(ui): re-organize tty fd handling and fix issues
| * fix(ui): re-organize tty fd handling and fix issuesbfredl2023-01-16
| | | | | | | | | | | | | | - Use the correct fd to replace stdin on windows (CONIN) - Don't start the TUI if there are no tty fd (not a regression, but makes sense regardless) - De-mythologize "global input fd". it is just STDIN.
* | fix(exepath)!: prefers extensionless for powershellAnton Kriese2023-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: exepath("test") should prefer ".bat" when shell=powershell. Current behavior differs from Vim 8.2.3071. TEST CASE: 1. in a folder which is in $PATH, create files "test" "test.bat". - "(Get-Command test).Path test" returns "test.bat". 2. compare nvim: nvim --clean :set shell=powershell :echo exepath("test") 3. should returns "path\to\test.bat" (before this patch it returns "path\to\test"). SOLUTION: After this patch, the binary files "text.exe", "test.bat", "test.com" will be found, but the file "test" (without any extension) will not be found (matches Vim 8.2.3071). But powershell's `where` and `Get-Command` _do_ find the extensionless 'test' file. But Nvim with ":set shell=cmd.exe", doesn't find "test" either (before and after this patch), even though `where test` returns correct path in cmd. - `where` is a program to find files in general, not just executable files. -`Get-Command` returning extensionless (and thus non-executable) file is puzzling even to Chris Dent, [PowerShell expert][1] (asked on Discord). [1]: https://www.amazon.com/Mastering-PowerShell-Scripting-Automate-environment-ebook/dp/B0971MG88X Co-authored-by: Enan Ajmain <3nan.ajmain@gmail.com> Helped-by: erw7 <erw7.github@gmail.com> Fixes #21045
* | refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc2023-01-15
|/ | | Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
* refactor: replace char_u with char 21 (#21779)dundargoc2023-01-14
| | | | | refactor: replace char_u with char 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(pty): remove old logic for inheriting termios from host terminalbfredl2023-01-10
|
* refactor: replace char_u with char 18 (#21237)dundargoc2023-01-09
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 17 - remove STRLCPY (#21235)dundargoc2023-01-09
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* Merge pull request #21675 from bfredl/nonstdiobfredl2023-01-09
|\ | | | | fix(embed): handle stdio in server properly
| * fix(embed): handle stdio in server properlybfredl2023-01-09
| | | | | | | | | | Rename stdin/stdout in the server, so that RPC data won't get corrupted. This also restores the use of stderr to write directly to the terminal.
* | refactor: replace char_u with chardundargoc2023-01-09
|/ | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: extract code to open stdin for readingJustin M. Keyes2023-01-05
|
* refactor: eliminate os_unix.c #21621Justin M. Keyes2023-01-02
|
* 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
* vim-patch:8.1.1313: warnings for using localtime() and ctime() (#21229)zeertzjq2022-11-29
| | | | | | | | Problem: Warnings for using localtime() and ctime(). Solution: Use localtime_r() if available. Avoid using ctime(). https://github.com/vim/vim/commit/63d2555c9cefbbeeca3ec87fdd5d241e9488f9dd Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0733: use of strftime() is not safe (#21228)zeertzjq2022-11-29
| | | | | | | | | | Problem: Use of strftime() is not safe. Solution: Check the return value of strftime(). Use a larger buffer and correctly pass the available space. (Dominique Pellé, closes vim/vim#11348) https://github.com/vim/vim/commit/84d14ccdb50dc9f362066a2c83bfaf331314e5ea Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
* refactor: replace char_u with chardundargoc2022-11-28
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.2.4155: translating strftime() argument results in check errorzeertzjq2022-11-25
| | | | | | | | | Problem: Translating strftime() argument results in check error. Solution: Add gettext comment. https://github.com/vim/vim/commit/7e93577a957e4f402bb690c4c8629fd831e24a9d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* Merge pull request #20151 from dundargoc/refactor/char_u/13bfredl2022-11-22
|\ | | | | refactor: replace char_u with char 13: remove `STRLEN` part 3
| * refactor: replace char_u with charDundar Göc2022-11-19
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
* | fix: pvs warnings (#21145)dundargoc2022-11-22
|/ | | | | | | | | | | * fix(PVS/V009): start file with special comment * fix(PVS/V501): identical sub-expressions for comparison * fix(PVS/V560): part of conditional expression is always true/false * fix(PVS/V593): review expression of type A = B < C * fix(PVS/V614): potentially uninitialized variable used
* vim-patch:8.2.3041: detecting if the process of a swap file is running failszeertzjq2022-11-17
| | | | | | | | | | Problem: Detecting if the process of a swap file is running fails if the process is owned by another user. Solution: Check for the ESRCH error. (closes vim/vim#8436) https://github.com/vim/vim/commit/44dea9da4b2a21dd1e03f2bd94b4f2679d4613e5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* Merge pull request #20157 from dundargoc/build/iwyubfredl2022-11-15
|\ | | | | build: allow IWYU to fix includes for all .c files
| * 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.
* | ci(windows): treat compiler warnings as errorsdundargoc2022-11-14
|/ | | | Reduce the warning level from 3 to 1 and fix all warnings.
* 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.
* | feat: ":write ++p" creates parent dirs #20835Victor Blanchard2022-11-06
| | | | | | | | | | | | | | | | | | | | | | - `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if they do not exist - Note: `:foo ++…` is usually for options. No existing options have a single-char abbreviation (presumably by design), so it's safe to special-case `++p` here. - Same for `writefile(…, 'foo/bar/baz.txt', 'p')` - `BufWriteCmd` can see the ++p flag via `v:cmdarg`. closes #19884
* | fix(stdpath): default to /tmp if stdpath('run') cannot be created #20952zeertzjq2022-11-06
|/ | | Fix #20949
* fix: avoid unsigned overflow in home_replace() (#20854)zeertzjq2022-10-30
|