| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
Co-authored-by: Dustin S. <dstackmasta27@gmail.com>
Co-authored-by: Ferenc Fejes <fejes@inf.elte.hu>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: brianhuster <phambinhanctb2004@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: too many strlen() calls in os_unix.c
Solution: refactor os_unix.c and remove calls to strlen()
(John Marriott)
closes: vim/vim#16496
https://github.com/vim/vim/commit/efc41a5958bf25b352e0916af5f57dafbbb44f17
Omit os_expand_wildcards() change: Nvim's code is more complicated and
harder to refactor.
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
|
|
|
|
| |
Ref:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
|
|
|
|
| |
Also print stderr error messages with ErrorMsg highlight group.
|
| |
|
|
|
| |
Result of `make iwyu` (after some "fixups").
|
|
|
|
|
|
|
|
|
|
|
| |
The newer UCRT runtime has native support for UTF-8, including forcing
it as the active codepage even before `main()` is called. This means
the c runtime will properly convert windows WCHAR:s into UTF-8 bytes,
as early as the argv/argc params to `main()` . Whereas MSVCRT does not
support this reliably and required us to use `wmain()`.
Only MSVC supports using manifest files directly as source files.
The solution for other Windows toolchains is to use a .rc file.
|
|
|
|
|
|
|
| |
Problem: Highlight group id is not propagated to the end of the message call
stack, where ext_messages are emitted.
Solution: Refactor message functions to pass along highlight group id
instead of attr id.
|
| |
|
|
|
|
| |
Problem: Can receive dozens of <MouseMove> events for same cell position. #30965
Solution: Leverage check_multiclick() to detect if cell position is unchanged.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
loop->children might have been a linked list because used to be
modified in place while looped over. However the loops that exists
rather schedules events to be processed later, outside of the loop,
so this can not happen anymore.
When a linked list is otherwise useful it is better to use
lib/queue_defs.h which defines an _intrusive_ linked list (i e it
doesn't need to do allocations for list items like klist ).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the api_info() output:
:new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
...
{'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}
The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
|
|
|
|
|
|
|
|
|
|
|
|
| |
/src/nvim/os/pty_proc_unix.c: 416 in pty_proc_init()
410 {
411 PtyProc rv;
412 rv.proc = proc_init(loop, kProcTypePty, data);
413 rv.width = 80;
414 rv.height = 24;
415 rv.tty_fd = -1;
>>> CID 509571: Uninitialized variables (UNINIT)
>>> Using uninitialized value "rv". Field "rv.winsize" is uninitialized.
416 return rv;
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- "process" is often used as a verb (`multiqueue_process_events`), which
is ambiguous for cases where it's used as a topic.
- The documented naming convention for processes is "proc".
- `:help dev-name-common`
- Shorter is better, when it doesn't harm readability or
discoverability.
Solution:
Rename "process" => "proc" in all C symbols and module names.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default "session name" for the builtin TUI is "ui".
before:
INF 2024-09-10T14:57:35.385 hello.sock os_exit:692: Nvim exit: 1
INF 2024-09-10T14:57:35.388 ?.4543 os_exit:692: Nvim exit: 1
after:
INF 2024-09-10T14:59:19.919 hello.sock os_exit:692: Nvim exit: 1
INF 2024-09-10T14:59:19.922 ui.5684 os_exit:692: Nvim exit: 1
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The name `os_inchar` (from Vim's old `mch_inchar`) is ambiguous:
"inchar" sounds like it could be reading or enqueuing (setting) input.
Its docstring is also ambiguous.
Solution:
- Rename `os_inchar` to `input_get`.
- Write some mf'ing docstrings.
- Add assert() in TRY_READ().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
If $NVIM_APPNAME is a relative dir path, Nvim fails to start its
primary/default server, and `v:servername` is empty.
Root cause is d34c64e342dfba9248d1055e702d02620a1b31a8, but this wasn't
noticed until 96128a5076b7 started reporting the error more loudly.
Solution:
- `server_address_new`: replace slashes "/" in the appname before using
it as a servername.
- `vim_mktempdir`: always prefer the system-wide top-level "nvim.user/"
directory. That isn't intended to be specific to NVIM_APPNAME; rather,
each *subdirectory* ("nvim.user/xxx") is owned by each Nvim instance.
Nvim "apps" can be identified by the server socket(s) stored in those
per-Nvim subdirs.
fix #30256
|
|
|
|
|
|
|
|
|
| |
Termkey is abandoned and it's now our code, so there's no reason not to
treat it as such. An alternative approach could be to have a proper repo
that we maintain such as with unibilium, although with this approach we
can make a few assumptions that will allow us to remove more code.
Also eliminate duplicate code from both termkey and libvterm.
|
| |
|
|
|
|
|
|
|
|
|
| |
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Lauri Heiskanen <lauri.heiskanen@nimble.fi>
Co-authored-by: Piotr Doroszewski <5605596+Doroszewski@users.noreply.github.com>
Co-authored-by: Tobiasz Laskowski <tobil4sk@outlook.com>
Co-authored-by: ariel-lindemann <41641978+ariel-lindemann@users.noreply.github.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
|
|
|
|
|
|
|
| |
Problem: Adding support for modern Nvim features (reflow, OSC 8, full
utf8/emoji support) requires coupling libvterm to Nvim internals
(e.g., utf8proc).
Solution: Vendor libvterm at v0.3.3.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: MS-Windows: always uses current directory for executables.
Solution: Check the NoDefaultCurrentDirectoryInExePath environment variable.
(Yasuhiro Matsumoto, closes vim/vim#10341)
https://github.com/vim/vim/commit/05cf63e9bdca1ac070df3e7d9c6dfc45e68ac916
Omit doc change: override in later doc update.
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
|
|
|
|
|
|
| |
This also makes shada reading slightly faster due to avoiding
some copying and allocation.
Use keysets to drive decoding of msgpack maps for shada entries.
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change, "static inline" functions in headers needed to have
their function attributes specified in a completely different way. The
prototype had to be duplicated, and REAL_FATTR_ had to be used instead
of the public FUNC_ATTR_ names.
TODO: need a check that a "header.h.inline.generated.h" file is not
forgotten when the first "static inline" function with attributes
is added to a header (they would just be silently missing).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Followup to #28515:
Rename the static os_homedir() to os_uv_homedir() to emphasize that it
is a wrapper around a libuv function.
Add the function os_get_homedir() to os/env.c to return the cached
homedir value as a const. Must be called after homedir is initialized or
it fails.
The difference between this function and the static os_uv_homedir() is
that the latter gets the homedir from libuv and is used to initialize
homedir in init_homedir(), while os_get_homedir() just returns homedir
as a const if it's initialized and is public.
Use the os_get_homedir() accessor for ~/ expansion on Windows to make
the code more concise.
Add a Windows section to main_spec.lua with tests for expanding ~/ and
~\ prefixes for files passed in on the command-line.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
|
|\
| |
| | |
refactor(shada): use msgpack_sbuffer less
|
| |
| |
| |
| |
| |
| |
| | |
Work towards getting rid of libmsgpack depedency eventually.
msgpack_sbuffer is just a string buffer, we can use our own
String type.
|
|/
|
|
|
|
|
|
| |
The latter was mostly relevant with the past char_u madness.
NOTE: STRCAT also functioned as a counterfeit "NOLINT" for clint
apparently. But NOLINT-ing every usecase is just the same as disabling
the check entirely.
|
|
|
|
| |
DynamicBuffer at home: KVÄCK
|
|
|
|
|
|
|
|
|
| |
If you like it you shouldn't put a ring on it.
This is what _every_ consumer of RStream used anyway, either by calling
rbuffer_reset, or rbuffer_consumed_compact (same as rbuffer_reset
without needing a scratch buffer), or by consuming everything in
each stream_read_cb call directly.
|
|
|
|
|
|
| |
fixes #29186 (likely)
fixup for #29093 064483a2b
|
| |
|
|\
| |
| | |
refactor(input): don't use a ring for input
|
| |
| |
| |
| | |
Since paste data is handled via a separate channel, the data processed via `input_buffer` is typically just explicit keys as typed in by the user. Therefore it should be fine to use `memmove()` to always put the remaining data in front when refilling the buffer.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a structural refactor with no logical changes, yet. Done in
preparation for simplifying rstream/rbuffer which will require more
state inline in RStream.
The initial idea was to have RStream and WStream as sub-types
symetrically but that doesn't work, as sockets are both reading and
writing. Also there is very little write-specific state to start with,
so the benefit of a separate WStream struct is a lot smaller. Just
document what fields in `Stream` are write specific.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using a ring buffer for buffered synchronous fileio is just unnecessary
complexity.
- when reading, we always consume the _entire_ buffer before getting
into syscalls. Thus we reset the buffer to its initial position before
when we actually read.
- when writing and buffer is full, we always flush the entire buffer
before starting to buffer again. So we can reset the buffer to its
initial state.
Also no static buffers are needed for writing and skipping. Needing an
extra copy for each write completely defeated the purpose of
a ring buffer (if there had been one)
|
|\
| |
| | |
refactor(shada): remove ShaDaReadDef secondary wrapper
|
| |
| |
| |
| |
| |
| | |
`FileDescriptor` is already a wrapper around an fd and a buffer.
By allowing to just use the buffer without an fd, it can
already handle in-memory reads.
|
|/
|
|
|
|
|
| |
FileDescriptor is used to buffer togheter many small writes to fewer
syscalls. if the data to write already is in a single buffer, it is
perfectly fine to just use os_write directly (which will take care of
the reverse problem: splitting a too big write into many syscalls)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use uv_fs_realpath() instead.
It seems that uv_fs_realpath() has some problems on non-Linux platforms:
- macOS and other BSDs: this function will fail with UV_ELOOP if more
than 32 symlinks are found while resolving the given path. This limit
is hardcoded and cannot be sidestepped.
- Windows: while this function works in the common case, there are a
number of corner cases where it doesn't:
- Paths in ramdisk volumes created by tools which sidestep the Volume
Manager (such as ImDisk) cannot be resolved.
- Inconsistent casing when using drive letters.
- Resolved path bypasses subst'd drives.
Ref: https://docs.libuv.org/en/v1.x/fs.html#c.uv_fs_realpath
I don't know if the old implementation that uses uv_chdir() and uv_cwd()
also suffers from the same problems.
- For the ELOOP case, chdir() seems to have the same limitations.
- On Windows, Vim doesn't use anything like chdir() either. It uses
_wfullpath(), while libuv uses GetFinalPathNameByHandleW().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no "rule" or bad practice or whatever that says we cannot
generate c files. it is is just that we have ~20 generated headers
and ~2 generated sources and there is nothing in these two generated
source files which sets them aparts. Lua bindings are not different from
rpc bindings, and pathdef is not different from versiondef.
So to simplify build logic and ease the future port to build.zig,
streamline the build to only have generated headers, no direct generated
.c files.
Also "nlua_add_api_functions" had its prototype duplicated twice which
defeated the point of having mandatory prototypes (one source of truth).
|
|
|
|
|
|
| |
Problem: Using xstrlcpy() when the exact length of the string to be
copied is known is not ideal because it requires adding 1 to
the length and an unnecessary strlen().
Solution: Add xmemcpyz() and use it in place of such xstrlcpy() calls.
|
|
|
|
|
|
|
|
|
| |
ref https://github.com/neovim/neovim/issues/28384
Allows Windows file APIs (and anything that uses them) to bypass the 260-character `MAX_PATH` limitation on Windows 10 1607 or later.
NOTE: This change by itself does not change the behaviour of running Neovim. The system must also have the Windows registry key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled` set to a `REG_DWORD` with value 1.
See https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later for more information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the filename passed to vim_FullName() is a relative directory, and
does not exist, it is appended to the current working directory. Since
the return value of append_path() was ignored, and if the buffer length
was too small to fit getcwd() + dirname(filename), it would still try to
append the basename(filename).
This was manifesting as a failure in test/unit/path_spec.lua in:
itp('fails and uses filename if given filename contains non-existing directory', ..
This failure occurs when running the tests from directory with a short
path such as: /work/src/nv
test/unit/path_spec.lua:420: Expected objects to be the same.
Passed in:
(string) '/work/src/nv/test.file'
Expected:
(string) 'non_existing_dir/test.file'
This return value for the second call to append_path() to append
basename(filename) was checked, and this is where it would fail for
normal / longer getcwd()s.
|
|
|
|
|
|
|
|
|
| |
Problem: Dialog for file changed outside of Vim not tested.
Solution: Add a test. Move FileChangedShell test. Add 'L' flag to
feedkeys().
https://github.com/vim/vim/commit/5e66b42aae7c67a3ef67617d4bd43052ac2b73ce
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
| |
Also:
- Don't use NUMBUFLEN as buffer length as its unrelated.
- Restore accidentally removed comment from last commit.
|