aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-27 11:26:47 +0800
committerGitHub <noreply@github.com>2022-08-27 11:26:47 +0800
commit523600ea6cc1edb7b4d116fdf70437a6b7f226d1 (patch)
tree2a1bf551c23ca859cab41022b621b3ad7e3c75ce /src/nvim/main.c
parent814c173b9d5182ca221b7c3c370cb453ce3526ed (diff)
downloadrneovim-523600ea6cc1edb7b4d116fdf70437a6b7f226d1.tar.gz
rneovim-523600ea6cc1edb7b4d116fdf70437a6b7f226d1.tar.bz2
rneovim-523600ea6cc1edb7b4d116fdf70437a6b7f226d1.zip
vim-patch:8.2.1269: language and locale code spread out (#19964)
Problem: Language and locale code spread out. Solution: Move relevant code to src/locale.c. (Yegappan Lakshmanan, closes vim/vim#6509) https://github.com/vim/vim/commit/054f14bbe58fece17f1a74ca63f0b37518f0b4de Also remove redundant <locale.h> includes.
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index efa1f8e350..e2e150a892 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -25,23 +25,19 @@
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
+#include "nvim/garray.h"
+#include "nvim/grid.h"
#include "nvim/hashtab.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
#include "nvim/iconv.h"
#include "nvim/if_cscope.h"
#include "nvim/insexpand.h"
+#include "nvim/locale.h"
+#include "nvim/log.h"
#include "nvim/lua/executor.h"
#include "nvim/main.h"
#include "nvim/mapping.h"
-#include "nvim/ui_client.h"
-#include "nvim/vim.h"
-#ifdef HAVE_LOCALE_H
-# include <locale.h>
-#endif
-#include "nvim/garray.h"
-#include "nvim/grid.h"
-#include "nvim/log.h"
#include "nvim/mark.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
@@ -70,8 +66,10 @@
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/ui.h"
+#include "nvim/ui_client.h"
#include "nvim/ui_compositor.h"
#include "nvim/version.h"
+#include "nvim/vim.h"
#include "nvim/window.h"
#ifdef WIN32
# include "nvim/os/os_win_console.h"
@@ -801,30 +799,6 @@ static int get_number_arg(const char *p, int *idx, int def)
return def;
}
-#if defined(HAVE_LOCALE_H)
-/// Setup to use the current locale (for ctype() and many other things).
-static void init_locale(void)
-{
- setlocale(LC_ALL, "");
-
-# ifdef LC_NUMERIC
- // Make sure strtod() uses a decimal point, not a comma.
- setlocale(LC_NUMERIC, "C");
-# endif
-
- char localepath[MAXPATHL] = { 0 };
- snprintf(localepath, sizeof(localepath), "%s", get_vim_var_str(VV_PROGPATH));
- char *tail = path_tail_with_sep(localepath);
- *tail = NUL;
- tail = path_tail(localepath);
- xstrlcpy(tail, "share/locale",
- sizeof(localepath) - (size_t)(tail - localepath));
- bindtextdomain(PROJECT_NAME, localepath);
- textdomain(PROJECT_NAME);
- TIME_MSG("locale set");
-}
-#endif
-
static uint64_t server_connect(char *server_addr, const char **errmsg)
{
if (server_addr == NULL) {