summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_meta/api.lua
AgeCommit message (Collapse)AuthorFiles
2023-12-14feat(nvim_open_term): convert LF => CRLF (#26384)Raphael1
Problem: Unlike termopen(), nvim_open_term() PTYs do not carriage-return the cursor on newline ("\n") input. nvim --clean :let chan_id = nvim_open_term(1, {}) :call chansend(chan_id, ["here", "are", "some", "lines"]) Actual behavior: here are some lines Expected behaviour: here are some lines Solution: Add `force_crlf` option, and enable it by default.
2023-12-05refactor(api): complete conversion from `Dictionary` to `Dict(opts)` (#26365)Riccardo Mazzarini1
2023-11-28Merge pull request #26249 from bfredl/concealcharbfredl1
feat(decoration): allow conceal_char to be a composing char
2023-11-28feat(decoration): allow conceal_char to be a composing charbfredl1
decor->text.str pointer must go. This removes it for conceal char, in preparation for a larger PR which will also handle the sign case. By actually allowing composing chars for a conceal chars, this becomes a feature and not just a refactor, as a bonus.
2023-11-28docs(lua): don't include remote-only API functions (#26266)zeertzjq1
2023-11-18Merge pull request #25724 from luukvbaal/signmergebfredl1
refactor(sign): move legacy signs to extmarks
2023-11-17refactor(sign): move legacy signs to extmarksLuuk van Baal1
Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
2023-11-16feat(tui): support DCS responses in TermResponse event (#26061)Gregory Anders1
2023-11-08Merge pull request #25767 from luukvbaal/signdelbfredl1
feat(extmarks): add 'invalidate' property
2023-11-08feat(extmarks): add 'invalidate' property to extmarksLuuk van Baal1
Problem: No way to have extmarks automatically removed when the range it is attached to is deleted. Solution: Add new 'invalidate' property that will hide a mark when the entirety of its range is deleted. When "undo_restore" is set to false, delete the mark from the buffer instead.
2023-11-06feat(tui): use TermResponse event for OSC responses (#25868)Gregory Anders1
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. The escape sequence is also included in the "data" field of the autocommand callback when the autocommand is defined in Lua. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: https://github.com/neovim/neovim/issues/25856
2023-10-29docs: small fixes (#25585)dundargoc1
Co-authored-by: tmummert <doczook@gmx.de> Co-authored-by: parikshit adhikari <parikshitadhikari@gmail.com>
2023-10-10docs: miscellaneous doc and type fixes (#25554)Maria José Solano1
2023-10-01Merge pull request #25455 from bfredl/highlight_namespace_gettersbfredl1
feat(ui): allow to get the highlight namespace. closes #24390
2023-10-01feat(ui): allow to get the highlight namespaceDaniel Steinberg1
2023-09-30feat(float): support toggle show float windowglepnir1
2023-09-26Merge pull request #25229 from glepnir/20323bfredl1
fix(highlight): add force in nvim_set_hl
2023-09-26fix(highlight): add force in nvim_set_hlglepnir1
2023-09-24docs: do not use deprecated functions #25334Maria José Solano1
2023-09-20docs: misc #24561Justin M. Keyes1
fix #24699 fix #25253
2023-09-19Merge pull request #25214 from bfredl/glyphcachebfredl1
refactor(grid): change schar_T representation to be more compact
2023-09-19Merge pull request #25148 from glepnir/fixed_optbfredl1
fix(float): add fixed option
2023-09-19refactor(grid): change schar_T representation to be more compactbfredl1
Previously, a screen cell would occupy 28+4=32 bytes per cell as we always made space for up to MAX_MCO+1 codepoints in a cell. As an example, even a pretty modest 50*80 screen would consume 50*80*2*32 = 256000, i e a quarter megabyte With the factor of two due to the TUI side buffer, and even more when using msg_grid and/or ext_multigrid. This instead stores a 4-byte union of either: - a valid UTF-8 sequence up to 4 bytes - an escape char which is invalid UTF-8 (0xFF) plus a 24-bit index to a glyph cache This avoids allocating space for huge composed glyphs _upfront_, while still keeping rendering such glyphs reasonably fast (1 hash table lookup + one plain index lookup). If the same large glyphs are using repeatedly on the screen, this is still a net reduction of memory/cache consumption. The only case which really gets worse is if you blast the screen full with crazy emojis and zalgo text and even this case only leads to 4 extra bytes per char. When only <= 4-byte glyphs are used, plus the 4-byte attribute code, i e 8 bytes in total there is a factor of four reduction of memory use. Memory which will be quite hot in cache as the screen buffer is scanned over in win_line() buffer text drawing A slight complication is that the representation depends on host byte order. I've tested this manually by compling and running this in qemu-s390x and it works fine. We might add a qemu based solution to CI at some point.
2023-09-18fix(float): add fixd optionglepnir1
2023-09-14docs: replace <pre> with ``` (#25136)Gregory Anders1
2023-09-12feat(extmark): support proper multiline rangesbfredl1
The removes the previous restriction that nvim_buf_set_extmark() could not be used to highlight arbitrary multi-line regions The problem can be summarized as follows: let's assume an extmark with a hl_group is placed covering the region (5,0) to (50,0) Now, consider what happens if nvim needs to redraw a window covering the lines 20-30. It needs to be able to ask the marktree what extmarks cover this region, even if they don't begin or end here. Therefore the marktree needs to be augmented with the information covers a point, not just what marks begin or end there. To do this, we augment each node with a field "intersect" which is a set the ids of the marks which overlap this node, but only if it is not part of the set of any parent. This ensures the number of nodes that need to be explicitly marked grows only logarithmically with the total number of explicitly nodes (and thus the number of of overlapping marks). Thus we can quickly iterate all marks which overlaps any query position by looking up what leaf node contains that position. Then we only need to consider all "start" marks within that leaf node, and the "intersect" set of that node and all its parents. Now, and the major source of complexity is that the tree restructuring operations (to ensure that each node has T-1 <= size <= 2*T-1) also need to update these sets. If a full inner node is split in two, one of the new parents might start to completely overlap some ranges and its ids will need to be moved from its children's sets to its own set. Similarly, if two undersized nodes gets joined into one, it might no longer completely overlap some ranges, and now the children which do needs to have the have the ids in its set instead. And then there are the pivots! Yes the pivot operations when a child gets moved from one parent to another.
2023-09-11fix(decorations): better approximation of botline #24794Jaehwang Jung1
Problem: * The guessed botline might be smaller than the actual botline e.g. when there are folds and the user is typing in insert mode. This may result in incorrect treesitter highlights for injections. * botline can be larger than the last line number of the buffer, which results in errors when placing extmarks. Solution: * Take a more conservative approximation. I am not sure if it is sufficient to guarantee correctness, but it seems to be good enough for the case mentioned above. * Clamp it to the last line number. Co-authored-by: Lewis Russell <me@lewisr.dev>
2023-09-11fix(api): more intuitive cursor updates in nvim_buf_set_textSergey Slipchenko1
Fixes #22526
2023-09-09fix(highlight): add create param in nvim_get_hlglepnir1
2023-08-26feat(highlight): add `FloatFooter` highlight groupEvgeni Chasnovski1
Problem: No clear separation of floating title and footer highlighting. Solution: Add new `FloatFooter` highlight group.
2023-08-26feat(float): implement footerEvgeni Chasnovski1
Problem: Now way to show text at the bottom part of floating window border (a.k.a. "footer"). Solution: Allows `footer` and `footer_pos` config fields similar to `title` and `title_pos`.
2023-08-26docs(msgpack_rpc): add "msgpack-rpc" client typeAlisue1
2023-08-03docs: miscJustin M. Keyes1
Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
2023-08-01feat(lua-types): types for vim.api.* (#24523)Lewis Russell1