summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/buffer.h
AgeCommit message (Collapse)AuthorFiles
2025-08-14refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl1
These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
2025-05-01refactor: move StringBuilder to types_defs.h (#33745)Gregory Anders1
2025-04-30feat(terminal): parse current buffer contents in nvim_open_term() (#33720)Gregory Anders1
When nvim_open_term() is called with a non-empty buffer, the buffer contents are piped into the PTY.
2024-07-13refactor(declarations): also generate prototypes for functions in headersbfredl1
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).
2024-07-11vim-patch:9.1.0557: moving in the buffer list doesn't work as documented ↵zeertzjq1
(#29653) Problem: moving in the buffer list doesn't work as documented (SenileFelineS) Solution: Skip non-help buffers, when run from normal buffers, else only move from help buffers to the next help buffer (LemonBoy) As explained in the help section for :bnext and :bprev the commands should jump from help buffers to help buffers (and from regular ones to regular ones). fixes: vim/vim#4478 closes: vim/vim#15198 https://github.com/vim/vim/commit/893eeeb44583ca33276e263165b2a6e50fd297d0 Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-01-25refactor: IWYU (#27186)zeertzjq1
2024-01-22perf(extmarks): add metadata for efficient filtering of special decorationsbfredl1
This expands on the global "don't pay for what you don't use" rules for these special extmark decorations: - inline virtual text, which needs to be processed in plines.c when we calculate the size of text on screen - virtual lines, which are needed when calculating "filler" lines - signs, with text and/or highlights, both of which needs to be processed for the entire line already at the beginning of a line. This adds a count to each node of the marktree, for how many special marks of each kind can be found in the subtree for this node. This makes it possible to quickly skip over these extra checks, when working in regions of the buffer not containing these kind of marks, instead of before where this could just be skipped if the entire _buffer_ didn't contain such marks.
2024-01-11refactor(IWYU): fix headersdundargoc1
Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
2023-12-21refactor: run IWYU on entire repodundargoc1
Reference: https://github.com/neovim/neovim/issues/6371.
2023-11-28refactor: fix headers with IWYUdundargoc1
2023-11-28refactor: iwyu (#26269)zeertzjq1
2023-11-27build(IWYU): fix includes for undo_defs.hdundargoc1
2023-11-27build(IWYU): replace public-to-public mappings with pragmas (#26237)zeertzjq1
2023-11-12refactor: replace manual header guards with #pragma oncedundargoc1
It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard.
2023-11-11refactor: remove redundant castsdundargoc1
2023-10-23build(lint): remove unnecessary clint.py rulesdundargoc1
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
2023-08-24refactor(memline): distinguish mutating uses of ml_get_buf()bfredl1
ml_get_buf() takes a third parameters to indicate whether the caller wants to mutate the memline data in place. However the vast majority of the call sites is using this function just to specify a buffer but without any mutation. This makes it harder to grep for the places which actually perform mutation. Solution: Remove the bool param from ml_get_buf(). it now works like ml_get() except for a non-current buffer. Add a new ml_get_buf_mut() function for the mutating use-case, which can be grepped along with the other ml_replace() etc functions which can modify the memline.
2023-06-06refactor: adjust headers according to the style guide (#23934)dundargoc1
System headers should be included first to prevent naming conflicts.
2022-11-15build: allow IWYU to fix includes for all .c filesdundargoc1
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.
2022-11-10refactor: move tabline code to statusline.c (#21008)luukvbaal1
* refactor: move tabline code to statusline.c Problem: Tabline code is closely related to statusline, but still left over in drawscreen.c and screen.c. Solution: Move it to statusline.c. * refactor: add statusline_defs.h
2022-10-21refactor: fix uncrustify lint errorsdundargoc1
2022-10-21refactor: clang-tidy fixes to silence clangd warning (#20683)dundargoc1
* refactor: readability-uppercase-literal-suffix * refactor: readability-named-parameter * refactor: bugprone-suspicious-string-compare * refactor: google-readability-casting * refactor: readability-redundant-control-flow * refactor: bugprone-too-small-loop-variable * refactor: readability-non-const-parameter * refactor: readability-avoid-const-params-in-decls * refactor: google-readability-todo * refactor: readability-inconsistent-declaration-parameter-name * refactor: bugprone-suspicious-missing-comma * refactor: remove noisy or slow warnings
2022-08-19refactor: move statusline code from buffer.c and [draw]screen.c to new filebfredl1
problem: code for drawing statusline is arbitrarily spreadout between drawscreen.c, screen.c and buffer.c solution: move it to a new file statusline.c - rename archaic internal name "status match" to public name "wildmenu" - showruler() does not show the ruler. it show anything which displays info about the cursor. Rename it accordingy.
2022-08-17refactor: remove some unused includes (#19820)zeertzjq1
Replace grid.h in screen.h and screen.h in buffer.h with grid_defs.h
2022-08-12refactor: remove some unused includes (#19740)zeertzjq1
Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers.
2022-04-26refactor(build): remove unused includes #17078kylo2521
Remove unused includes in src/nvim/buffer.c|h using the IWYU library. Yet another step towards #6371 and #549
2022-04-08vim-patch:8.2.0004: get E685 and E931 if buffer reload is interruptedzeertzjq1
Problem: Get E685 and E931 if buffer reload is interrupted. Solution: Do not abort deleting a dummy buffer. (closes vim/vim#5361) https://github.com/vim/vim/commit/a6e8f888e7fc31b8ab7233509254fb2e2fe4089f
2022-04-03vim-patch:8.2.4639: not sufficient parenthesis in preprocessor macrosBrian Leung1
Problem: Not sufficient parenthesis in preprocessor macros. Solution: Add more parenthesis. https://github.com/vim/vim/commit/9dac9b1751dd43c02470cc6a2aecaeea27abcc80
2021-10-29refactor: uncrustify #16090dundargoc1
2021-10-12refactor: format all C files under nvim/ #15977dundargoc1
* refactor: format all C files under nvim * refactor: disable formatting for Vim-owned files: * src/nvim/indent_c.c * src/nvim/regexp.c * src/nvim/regexp_nfa.c * src/nvim/testdir/samples/memfile_test.c
2021-07-06buffer: move BUFEMPTY to a functionThomas Vigouroux1
2021-02-13vim-patch:8.2.1904: still using default option values after using ":badd +1"Jan Edmund Lazo1
Problem: Still using default option values after using ":badd +1". Solution: Find a window where options were set. Don't set the window when using ":badd". https://github.com/vim/vim/commit/89b693e5627715cde080c3580c7b641c9bf0c06a
2019-03-14dictwatcheradd(): support b:changedtick #9693demiurg3371
fixes #6635 closes #9693
2019-03-05buffer: use aucmd_prepbuf() instead of switch_to_win_for_buf()Björn Linse1
2019-02-09api: add nvim_create_buf to create a new empty buffer.Björn Linse1
Loading existing files into a buffer is non-trivial and requires a window. Creating an unnamed emtpy buffer is trivial and safe though, thus worth a special case. Change nvim_buf_set_option to use aucmd_prepbuf. This is necessary to allow some options to be set on a not yet displayed buffer, such as 'buftype' option. vim-patch:7.4.1858: Add BLN_NEW to enforce buflist_new creating new buffer
2018-06-22*: Replace b_changedtick with new always-inline functionsZyX1
Ref #8474
2018-06-21vim-patch:8.0.0621: :stag does not respect 'switchbuf'Jan Edmund Lazo1
Problem: The ":stag" command does not respect 'switchbuf'. Solution: Check 'switchbuf' for tag commands that may open a new window. (Ingo Karkat, closes vim/vim#1681) Define macros for the return values of getfile(). https://github.com/vim/vim/commit/8ad80dea089ffeb1a845199c013e9bb4be1cd22e
2017-06-11vim-patch:8.0.0607 (#6879)Daniel Hahler1
Problem: When creating a bufref, then using :bwipe and :new it might get the same memory and bufref_valid() returns true. Solution: Add br_fnum to check the buffer number didn't change. https://github.com/vim/vim/commit/45e5fd135da5710f24a1acc142692f120f8b0b78
2017-06-04vim-patch:7.4.1976James McCoy1
Problem: Number variables are not 64 bits while they could be. Solution: Add the num64 feature. (Ken Takata) https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
2017-04-16*: Silence some false positivesZyX1
2017-03-30refactor/single-include: buffer.h (#6396)relnod1
2017-03-29*: Move some dictionary functions to typval.h and use char*ZyX1
Also fixes buffer reusage in setmatches() and complete().
2017-02-25buffer: Hide one of the asserts from lua parserZyX1
2017-02-24eval: Do not allocate b:changedtick dictionary itemZyX1
2017-02-23buffer: Bind b:changedtick to b:['changedtick'], remove special casesZyX1
2017-02-04Make Nvim work with latest vim-patch v7.4.2024Marco Hinz1
v7.4.2024 changed a few function signatures of functions that we use in Neovim-specific code, e.g. the API. Due to that the commit for 7.4.2024 doesn't build on its own, only together with this commit.
2017-02-04vim-patch:7.4.2024Marco Hinz1
Problem: More buf_valid() calls can be optimized. Solution: Use bufref_valid() instead. NOTE: Some changes related to channels and the Python and Netbeans interfaces were obviously left out. https://github.com/vim/vim/commit/7c0a2f367f2507669560b1a66423155c70d2e75b
2017-02-04vim-patch:7.4.2017Marco Hinz1
Problem: When there are many errors adding them to the quickfix list takes a long time. Solution: Add BLN_NOOPT. Don't call buf_valid() in buf_copy_options(). Remember the last file name used. When going through the buffer list start from the end of the list. Only call buf_valid() when autocommands were executed. https://github.com/vim/vim/commit/8240433f48f7383c281ba2453cc55f10b8ec47d9
2016-06-11*: Fix errors from new linter checksZyX1
2016-02-01tabline: Add %[] atom to the tabline, for random commands on clickZyX1
Currently untested and undocumented.