aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/fs.c2
-rw-r--r--src/nvim/os/input.h2
-rw-r--r--src/nvim/os/os.h4
-rw-r--r--src/nvim/os/os_defs.h2
-rw-r--r--src/nvim/os/os_win_console.c26
-rw-r--r--src/nvim/os/process.h1
-rw-r--r--src/nvim/os/time.h2
-rw-r--r--src/nvim/os/unix_defs.h2
-rw-r--r--src/nvim/os/win_defs.h7
9 files changed, 13 insertions, 35 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index bbf70a4830..9675cfbb0f 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -134,7 +134,7 @@ bool os_isdir(const char_u *name)
bool os_isdir_executable(const char *name)
FUNC_ATTR_NONNULL_ALL
{
- int32_t mode = os_getperm((const char *)name);
+ int32_t mode = os_getperm(name);
if (mode < 0) {
return false;
}
diff --git a/src/nvim/os/input.h b/src/nvim/os/input.h
index d571965408..7026781407 100644
--- a/src/nvim/os/input.h
+++ b/src/nvim/os/input.h
@@ -1,8 +1,8 @@
#ifndef NVIM_OS_INPUT_H
#define NVIM_OS_INPUT_H
-#include <stdint.h>
#include <stdbool.h>
+#include <stdint.h>
#include "nvim/api/private/defs.h"
#include "nvim/event/multiqueue.h"
diff --git a/src/nvim/os/os.h b/src/nvim/os/os.h
index 3e89e5a94a..bff2936f8e 100644
--- a/src/nvim/os/os.h
+++ b/src/nvim/os/os.h
@@ -9,11 +9,11 @@
#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
+# include "os/env.h.generated.h"
# include "os/fs.h.generated.h"
# include "os/mem.h.generated.h"
-# include "os/env.h.generated.h"
-# include "os/users.h.generated.h"
# include "os/stdpaths.h.generated.h"
+# include "os/users.h.generated.h"
#endif
#endif // NVIM_OS_OS_H
diff --git a/src/nvim/os/os_defs.h b/src/nvim/os/os_defs.h
index 1b7859b0d3..8049b3b80e 100644
--- a/src/nvim/os/os_defs.h
+++ b/src/nvim/os/os_defs.h
@@ -16,7 +16,7 @@
#define BASENAMELEN (NAME_MAX - 5)
// Use the system path length if it makes sense.
-# define DEFAULT_MAXPATHL 4096
+#define DEFAULT_MAXPATHL 4096
#if defined(PATH_MAX) && (PATH_MAX > DEFAULT_MAXPATHL)
# define MAXPATHL PATH_MAX
#else
diff --git a/src/nvim/os/os_win_console.c b/src/nvim/os/os_win_console.c
index 2c9cb699fc..18e2e02b81 100644
--- a/src/nvim/os/os_win_console.c
+++ b/src/nvim/os/os_win_console.c
@@ -46,29 +46,3 @@ void os_replace_stdout_and_stderr_to_conout(void)
const int conerr_fd = _open_osfhandle((intptr_t)conout_handle, 0);
assert(conerr_fd == STDERR_FILENO);
}
-
-void os_set_vtp(bool enable)
-{
- static TriState is_legacy = kNone;
- if (is_legacy == kNone) {
- uv_tty_vtermstate_t state;
- uv_tty_get_vterm_state(&state);
- is_legacy = (state == UV_TTY_UNSUPPORTED) ? kTrue : kFalse;
- }
- if (!is_legacy && !os_has_vti()) {
- uv_tty_set_vterm_state(enable ? UV_TTY_SUPPORTED : UV_TTY_UNSUPPORTED);
- }
-}
-
-static bool os_has_vti(void)
-{
- static TriState has_vti = kNone;
- if (has_vti == kNone) {
- HANDLE handle = (HANDLE)_get_osfhandle(input_global_fd());
- DWORD dwMode;
- if (handle != INVALID_HANDLE_VALUE && GetConsoleMode(handle, &dwMode)) {
- has_vti = !!(dwMode & ENABLE_VIRTUAL_TERMINAL_INPUT) ? kTrue : kFalse;
- }
- }
- return has_vti == kTrue;
-}
diff --git a/src/nvim/os/process.h b/src/nvim/os/process.h
index 1722d56bd3..faa4762cf1 100644
--- a/src/nvim/os/process.h
+++ b/src/nvim/os/process.h
@@ -2,6 +2,7 @@
#define NVIM_OS_PROCESS_H
#include <stddef.h>
+
#include "nvim/api/private/defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/os/time.h b/src/nvim/os/time.h
index ad4886446a..1b6c667dbb 100644
--- a/src/nvim/os/time.h
+++ b/src/nvim/os/time.h
@@ -1,8 +1,8 @@
#ifndef NVIM_OS_TIME_H
#define NVIM_OS_TIME_H
-#include <stdint.h>
#include <stdbool.h>
+#include <stdint.h>
#include <time.h>
typedef uint64_t Timestamp;
diff --git a/src/nvim/os/unix_defs.h b/src/nvim/os/unix_defs.h
index 60a2dfa882..4ed3b51694 100644
--- a/src/nvim/os/unix_defs.h
+++ b/src/nvim/os/unix_defs.h
@@ -1,8 +1,8 @@
#ifndef NVIM_OS_UNIX_DEFS_H
#define NVIM_OS_UNIX_DEFS_H
-#include <unistd.h>
#include <sys/param.h>
+#include <unistd.h>
// POSIX.1-2008 says that NAME_MAX should be in here
#include <limits.h>
diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h
index 66d72de08d..efef77be7b 100644
--- a/src/nvim/os/win_defs.h
+++ b/src/nvim/os/win_defs.h
@@ -7,11 +7,14 @@
// winsock2.h must be first to avoid incompatibilities
// with winsock.h (included by windows.h)
+
+// uncrustify:off
#include <winsock2.h>
-#include <windows.h>
-#include <sys/stat.h>
+// uncrustify:on
#include <io.h>
#include <stdio.h>
+#include <sys/stat.h>
+#include <windows.h>
// Windows does not have S_IFLNK but libuv defines it
// and sets the flag for us when calling uv_fs_stat.