aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/lang.c
Commit message (Collapse)AuthorAge
* vim-patch:partial:9.0.1196: code is indented more than necessary (#27315)zeertzjq2024-02-03
| | | | | | | | | | | Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes vim/vim#11813) https://github.com/vim/vim/commit/e8575988969579f9e1439181ae338b2ff74054a8 Skip list_alloc_with_items(). Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* refactor(IWYU): fix headersdundargoc2024-01-11
| | | | | | Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
* refactor: follow style guidedundargoc2023-12-30
|
* refactor: move some anonymous enums back to non-defs headers (#26622)zeertzjq2023-12-18
| | | | | | | | | | It isn't really useful to put anonymous enums only used as arguments to functions calls in _defs.h headers, as they will only be used by a file that calls those functions, which requires including a non-defs header. Also move os_msg() and os_errmsg() back to message.h, as on Windows they are actual functions instead of macros. Also remove gettext.h and globals.h from private/helpers.h.
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* build: adjust clang-tidy warning exclusion logicdundargoc2023-11-20
| | | | | | | Enable all clang-tidy warnings by default instead of disabling them. This ensures that we don't miss useful warnings on each clang-tidy version upgrade. A drawback of this is that it will force us to either fix or adjust the warnings as soon as possible.
* 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.
* docs: small fixes (#25585)dundargoc2023-10-29
| | | | Co-authored-by: tmummert <doczook@gmx.de> Co-authored-by: parikshit adhikari <parikshitadhikari@gmail.com>
* refactor(lang): reduce scope of HAVE_WORKING_LIBINTL #ifdefsbfredl2023-10-15
| | | | | | | | | | | | | | | | | A lot of code inside HAVE_WORKING_LIBINTL doesn't really depend on a "working libintl". For instance ex_language is also used for ":lang collate" and ":lang time". Also ":lang C" should not fail just because translations aren't available (it just means use the default text). References: https://github.com/neovim/neovim/pull/1 2d00ead2e57653b771354a564f9a760c2ce0d18e separate ifdefs for locale and gettext got merged together. https://github.com/neovim/neovim/commit/8253e29971c54310434ee93d987a99994769d717 Unmotivated switcharoo of get_mess_env() logic. If available, get_locale_val(LC_MESSAGES) is the correct implementation.
* refactor: move cmdline completion types to cmdexpand_defs.h (#25465)zeertzjq2023-10-02
|
* refactor(message): smsg_attr -> smsgbfredl2023-09-29
|
* 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.
* 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.
* fix(mac): use same $LANG fallback mechanism as VimMarco Hinz2022-04-28
| | | | | | | | | | | | | | | | | In a locale "en_US", "en" is the language and "US" is the region. Before this change, we were too clever for our own good and tried to handle the region as well. But if the macOS primary language is set to "English" and the region to "Norway", we would end up with "en_NO", which is a locale that does not exist. Now we only take the language into account. Taking the example from above would yield "en_US", which is a sensible fallback. If the region is important to you, set $LANG and the more specific LC_* variables in your shell config or alternatively use `:help :language`. References https://github.com/neovim/neovim/issues/18292
* fix: Include auto/config.h before HAVE_* preprocessor checksJames McCoy2020-12-15
| | | | Closes #13533
* vim-patch:8.2.1757: Mac: default locale is lacking the encoding (#12994)Jan Edmund Lazo2020-09-28
| | | | | | | | | vim-patch:8.2.1757: Mac: default locale is lacking the encoding Problem: Mac: default locale is lacking the encoding. Solution: Add ".UTF-8 to the locale. (Yee Cheng Chin, closes vim/vim#7022) https://github.com/vim/vim/commit/a5fe91e6dc610bc823bc3201e2c88179989b13fb Cherry-pick test_environ.vim changes from patch 8.2.1432.
* build: -Wmissing-prototypesJustin M. Keyes2019-02-04
| | | | | | | ref #343 Though I don't see a strong benefit, it isn't too much of a burden, and maybe avoids confusion in some cases.
* os/lang: use the correct LC_NUMERIC also for OS XBjörn Linse2018-12-13
|
* macOS: infer primary language if $LANG is empty #9345Marco Hinz2018-12-11
| | | | | | | | | | | | | | The macOS preferences have a section called `Language & Region`. There is always at least one language defined, the primary language. CFLocaleCopyPreferredLanguages() returns the languages defined in that section, the first element being the primary language. Use the primary language in case CFLocaleCopyCurrent() returns NULL. In the case that the above fallback does not work either, which is very unlikely, log the error and continue with an empty $LANG. References #9134
* Fix crash in lang_init() on macOS if lang_region = NULLbattlmonstr2018-08-01
| | | | | | | | | | This is a regression after PR #7704: mac: Set $LANG based on the system locale CFStringGetCStringPtr sometimes returns "lang_region" = NULL, in this case CFStringGetCString is used instead, which places output to "buf", but "buf" was not used by the code.
* Add missing PVS headers to new filesJames McCoy2018-03-11
|
* mac: Set $LANG based on the system localeJames McCoy2017-12-10
Unix's typical locale-related environment variables aren't always set appropriately on a Mac. Instead of relying on them, query the locale information using Mac specific APIs and then set $LANG appropriately for the rest of nvim. Closes #5873