| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
| |
- Move vimoption_T to option.h
- option_defs.h is for option-related types
- option_vars.h corresponds to Vim's option.h
- option_defs.h and option_vars.h don't include each other
|
| |
|
|
|
|
|
| |
problem: there are too many different functions in message.c
solution: fold some of the functions into themselves
|
|
|
|
|
|
|
|
|
|
|
| |
(#25317)
Problem: :unhide does not check for failing to close a window.
Solution: When closing a window fails continue with the next one. Do not
try closing the autocmd window. (closes vim/vim#9984)
https://github.com/vim/vim/commit/6f2465d336a9d4afe392db4084ef7e9db17e67c1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
| |
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com>
Co-authored-by: XTY <xty@xty.io>
Co-authored-by: Empa <emanuel@empa.xyz>
Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This involves two redesigns of the map.c implementations:
1. Change of macro style and code organization
The old khash.h and map.c implementation used huge #define blocks with a
lot of backslash line continuations.
This instead uses the "implementation file" .c.h pattern. Such a file is
meant to be included multiple times, with different macros set prior to
inclusion as parameters. we already use this pattern e.g. for
eval/typval_encode.c.h to implement different typval encoders reusing a
similar structure.
We can structure this code into two parts. one that only depends on key
type and is enough to implement sets, and one which depends on both key
and value to implement maps (as a wrapper around sets, with an added
value[] array)
2. Separate the main hash buckets from the key / value arrays
Change the hack buckets to only contain an index into separate key /
value arrays
This is a common pattern in modern, state of the art hashmap
implementations. Even though this leads to one more allocated array, it
is this often is a net reduction of memory consumption. Consider
key+value consuming at least 12 bytes per pair. On average, we will have
twice as many buckets per item.
Thus old implementation:
2*12 = 24 bytes per item
New implementation
1*12 + 2*4 = 20 bytes per item
And the difference gets bigger with larger items.
One might think we have pulled a fast one here, as wouldn't the average size of
the new key/value arrays be 1.5 slots per items due to amortized grows?
But remember, these arrays are fully dense, and thus the accessed memory,
measured in _cache lines_, the unit which actually matters, will be the
fully used memory but just rounded up to the nearest cache line
boundary.
This has some other interesting properties, such as an insert-only
set/map will be fully ordered by insert only. Preserving this ordering
in face of deletions is more tricky tho. As we currently don't use
ordered maps, the "delete" operation maintains compactness of the item
arrays in the simplest way by breaking the ordering. It would be
possible to implement an order-preserving delete although at some cost,
like allowing the items array to become non-dense until the next rehash.
Finally, in face of these two major changes, all code used in khash.h
has been integrated into map.c and friends. Given the heavy edits it
makes no sense to "layer" the code into a vendored and a wrapper part.
Rather, the layered cake follows the specialization depth: code shared
for all maps, code specialized to a key type (and its equivalence
relation), and finally code specialized to value+key type.
|
|
|
|
|
|
| |
Problem: Temporarily changing current window in a script causes
CursorMoved to be triggerd.
Solution: Don't trigger CursorMoved if neither curwin nor cursor
changed between two checks.
|
| |
|
|
|
|
|
| |
long is 32-bits even on 64-bit windows which makes the type suboptimal
for a codebase meant to be cross-platform.
|
|
|
|
|
|
|
|
|
|
| |
Problem: Empty CmdlineEnter autocommand causes errors in Ex mode.
Solution: Save and restore ex_pressedreturn. (Christian Brabandt,
closes # 12581, closes vim/vim#12578)
https://github.com/vim/vim/commit/590aae35575cbd74d80c41d87fc647f2812aad70
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
|
|
|
|
|
|
|
|
|
| |
Problem: Error from term_start() not caught by try/catch.
Solution: save and restore did_emsg when applying autocommands. (Ozaki
Kiichi, closes vim/vim#9361)
https://github.com/vim/vim/commit/c3f91c0648f4b04a6a9ceb4ccec45ea767a63796
Co-authored-by: ichizok <gclient.gaap@gmail.com>
|
| |
|
|
|
|
| |
This reverts commit 82cd0be2eaf71c0476e15c66ba3e83c76896d407.
|
|
|
|
|
|
|
| |
Problem: :stopinsert may not work in a popup close handler. (Ben Jackson)
Solution: Restore stop_insert_mode when appropriate. (closes vim/vim#12452,
closes vim/vim#12434)
https://github.com/vim/vim/commit/a40c0bcc83c32da02869f59b10538d6327df61c5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces the total number of khash_t instantiations from 22 to 8.
Make the khash internal functions take the size of values as a runtime
parameter. This is abstracted with typesafe Map containers which
are still specialized for both key, value type.
Introduce `Set(key)` type for when there is no value.
Refactor shada.c to use Map/Set instead of khash directly.
This requires `map_ref` operation to be more flexible.
Return pointers to both key and value, plus an indicator for new_item.
As a bonus, `map_key` is now redundant.
Instead of Map(cstr_t, FileMarks), use a pointer map as the FileMarks struct is
humongous.
Make `event_strings` actually work like an intern pool instead of wtf it
was doing before.
|
|
|
|
|
|
|
|
|
| |
Problem: Inconsistent capitalization in error messages.
Solution: Make capitalization consistent. (Doug Kearns)
https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Instead of nested linked lists, store autocommands in a flat, contiguous
kvec_t, with one kvec_t per event type. Previously patterns were stored
in each node of the outer linked list, so they can be matched only once
on repeating patterns. They are now reference counted and referenced in
each autocommand, and matching is skipped if the pattern repeats. Speeds
up creation and deletion, execution is not affected.
Co-authored-by: ii14 <ii14@users.noreply.github.com>
|
|
|
|
| |
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
|
|
|
|
|
|
|
|
|
|
| |
(#22984)
Problem: Ending Insert mode when accessing a hidden prompt buffer.
Solution: Don't stop Insert mode when it was active before. (closes vim/vim#12237)
https://github.com/vim/vim/commit/05a627c3d4e42a18f76c14828d68ee4747118211
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#22867)
Problem: Start Insert mode when accessing a hidden prompt buffer.
Solution: Call leaving_window() in aucmd_restbuf(). (Thorben Tröbst,
closes vim/vim#12148, closes vim/vim#12147)
https://github.com/vim/vim/commit/cde8de034524d00aba4ff4142e658baff511e12d
Cherry-pick test_prompt_buffer.vim changes from patch 9.0.0631.
Co-authored-by: orbital <orbital@holgerines.de>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
drawscreen.c vs screen.c makes absolutely no sense.
The screen exists only to draw upon it, therefore helper functions
are distributed randomly between screen.c and the file that
does the redrawing. In addition screen.c does a lot of drawing on the
screen.
It made more sense for vim/vim as our grid.c is their screen.c
Not sure if we want to dump all the code for option chars into
optionstr.c, so keep these in a optionchar.c for now.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The original motivation for this change came from developping
https://github.com/neovim/neovim/pull/22159, which will require adding
more autocommand creation to Neovim's startup sequence.
This change requires lightly editing a test that expected no autocommand
to have been created from lua.
|
|/
|
|
|
| |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
|
| |
These are just ordinary boring events now. Modes already redraw events
themselves.
|
|
|
|
|
|
|
| |
Problem: Cursor may move with autocmd in Visual mode.
Solution: Restore "VIsual_active" before calling check_cursor().
(closes vim/vim#11939)
https://github.com/vim/vim/commit/49f0524fb575bb1cf4881e472afab7d37c579440
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes vim/vim#11792)
https://github.com/vim/vim/commit/1cfb14aa972ccf3235ac67f07b7db1175b7c5384
Partial port as some highlight.c changes depend on previous patches.
Cherry-pick fname_match() change from patch 8.2.4959.
Omit internal_func_check_arg_types(): only used for Vim9 script.
N/A patches for version.c:
vim-patch:9.0.1167: EditorConfig files do not have their own filetype
Problem: EditorConfig files do not have their own filetype.
Solution: Add the "editorconfig" filetype. (Gregory Anders, closes vim/vim#11779)
https://github.com/vim/vim/commit/d41262ed06564cef98a3800e2928e6e0db91abbf
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
|
|
|
|
| |
Problem: Crash when doing crazy things with hidden buffers.
Solution: Dynamically allocate the list of autocommand windows.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: Leaking memory from autocmd windows.
Solution: Free window when auc_win is not NULL.
https://github.com/vim/vim/commit/84497cd06f06516f6ce727ea00c47792ce16dc70
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Using one window for executing autocommands is insufficient.
Solution: Use up to five windows for executing autocommands.
https://github.com/vim/vim/commit/e76062c078debed0df818f70e4db14ad7a7cb53a
N/A patches for version.c:
vim-patch:9.0.0966: some compilers don't allow a declaration after a label
Problem: Some compilers don't allow a declaration after a label.
Solution: Move the declaration to the start of the block. (John Marriott)
https://github.com/vim/vim/commit/f86490ed4fdab213a28f667abd055c023a73d645
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
| |
Work on https://github.com/neovim/neovim/issues/459
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#21161)
Problem: The WinScrolled autocommand event is not enough.
Solution: Add WinResized and provide information about what changed.
(closes vim/vim#11576)
https://github.com/vim/vim/commit/35fc61cb5b5eba8bbb9d8f0700332fbab38f40ca
Omit "func_name" comment in tv_dict_extend(): Vim9 script only.
Skip layout locking and E1312.
Skip list_alloc_with_items() and list_set_item().
Since this overrides remaining changes in patch 9.0.0913, that patch can
now be marked as fully ported:
vim-patch:9.0.0913: only change in current window triggers the WinScrolled event
N/A patches for version.c:
vim-patch:9.0.0919: build failure with tiny features
Problem: Build failure with tiny features.
Solution: Adjust #ifdef's.
https://github.com/vim/vim/commit/9c5b7cb4cf67c64648a324e9dfd1e17d793335a4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
| |
Problem: WinScrolled may trigger immediately when defined.
Solution: Initialize the fields in all windows. (closes vim/vim#11582)
https://github.com/vim/vim/commit/29967732761d1ffb5592db5f5aa7036f5b52abf1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: "au!" and "au! event" cannot be followed by another command as
documented.
Solution: When a bar is found set nextcmd.
https://github.com/vim/vim/commit/b8e642f7ace5382b4dacb7a8effd86f22b828cc1
Cherry-pick do_autocmd() "eap" argument from patch 8.2.3268.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
| |
(#20572)
Problem: <amatch> of MenuPopup event is expanded like a file name.
Solution: Do not expand <amatch> for MenuPopup. (closes vim/vim#11328)
https://github.com/vim/vim/commit/c601d988b6b1a672f71e3d61f4aaa4f7742a3a21
|
|\
| |
| | |
screen: refactor old curwin-heavy logic and graduate "msgsep" feature
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was used in the past with assumption that curwin/curbuf
is "special" but this has not been true since basically forever
at this point.
Reduce NOT_VALID/CLEAR panic in options.lua . These should not
be set if an effect of the option is causing something
which by itself invokes redraw_later().
|
|/
|
|
|
|
| |
Problem: Can define autocmd for every event by using "au!".
Solution: Check if a command is present also for "au!".
https://github.com/vim/vim/commit/b6db1467622be046dbf00b2213fd9f49f4f3cccb
|
|
|
|
|
|
| |
Problem: Autocmd code is indented more than needed.
Solution: Break out sooner. (Yegappan Lakshmanan, closes vim/vim#11208)
Also in user function code.
https://github.com/vim/vim/commit/e9dcf13a3007d4f603e007e0526b0005fd026bc5
|
|
|
|
|
| |
fixes #20106
fixes #20229
|
|
|
|
| |
Work on https://github.com/neovim/neovim/issues/459
|