aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.h
Commit message (Collapse)AuthorAge
* refactor(declarations): also generate prototypes for functions in headersbfredl2024-07-13
| | | | | | | | | | | 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).
* vim-patch:9.1.0557: moving in the buffer list doesn't work as documented ↵zeertzjq2024-07-11
| | | | | | | | | | | | | | | | | | | (#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>
* refactor: IWYU (#27186)zeertzjq2024-01-25
|
* perf(extmarks): add metadata for efficient filtering of special decorationsbfredl2024-01-22
| | | | | | | | | | | | | | | | | | 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.
* refactor(IWYU): fix headersdundargoc2024-01-11
| | | | | | 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.
* refactor: run IWYU on entire repodundargoc2023-12-21
| | | | Reference: https://github.com/neovim/neovim/issues/6371.
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* refactor: iwyu (#26269)zeertzjq2023-11-28
|
* build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
|
* build(IWYU): replace public-to-public mappings with pragmas (#26237)zeertzjq2023-11-27
|
* refactor: replace manual header guards with #pragma oncedundargoc2023-11-12
| | | | | 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.
* refactor: remove redundant castsdundargoc2023-11-11
|
* build(lint): remove unnecessary clint.py rulesdundargoc2023-10-23
| | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
* refactor(memline): distinguish mutating uses of ml_get_buf()bfredl2023-08-24
| | | | | | | | | | | | | | 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.
* refactor: adjust headers according to the style guide (#23934)dundargoc2023-06-06
| | | System headers should be included first to prevent naming conflicts.
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | 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.
* refactor: move tabline code to statusline.c (#21008)luukvbaal2022-11-10
| | | | | | | | * 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
* refactor: fix uncrustify lint errorsdundargoc2022-10-21
|
* refactor: clang-tidy fixes to silence clangd warning (#20683)dundargoc2022-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* refactor: move statusline code from buffer.c and [draw]screen.c to new filebfredl2022-08-19
| | | | | | | | | 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.
* refactor: remove some unused includes (#19820)zeertzjq2022-08-17
| | | Replace grid.h in screen.h and screen.h in buffer.h with grid_defs.h
* refactor: remove some unused includes (#19740)zeertzjq2022-08-12
| | | | Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers.
* refactor(build): remove unused includes #17078kylo2522022-04-26
| | | | Remove unused includes in src/nvim/buffer.c|h using the IWYU library. Yet another step towards #6371 and #549
* vim-patch:8.2.0004: get E685 and E931 if buffer reload is interruptedzeertzjq2022-04-08
| | | | | | 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
* vim-patch:8.2.4639: not sufficient parenthesis in preprocessor macrosBrian Leung2022-04-03
| | | | | | Problem: Not sufficient parenthesis in preprocessor macros. Solution: Add more parenthesis. https://github.com/vim/vim/commit/9dac9b1751dd43c02470cc6a2aecaeea27abcc80
* refactor: uncrustify #16090dundargoc2021-10-29
|
* refactor: format all C files under nvim/ #15977dundargoc2021-10-12
| | | | | | | | * 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
* buffer: move BUFEMPTY to a functionThomas Vigouroux2021-07-06
|
* vim-patch:8.2.1904: still using default option values after using ":badd +1"Jan Edmund Lazo2021-02-13
| | | | | | | 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
* dictwatcheradd(): support b:changedtick #9693demiurg3372019-03-14
| | | | | fixes #6635 closes #9693
* buffer: use aucmd_prepbuf() instead of switch_to_win_for_buf()Björn Linse2019-03-05
|
* api: add nvim_create_buf to create a new empty buffer.Björn Linse2019-02-09
| | | | | | | | | | | | 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
* *: Replace b_changedtick with new always-inline functionsZyX2018-06-22
| | | Ref #8474
* vim-patch:8.0.0621: :stag does not respect 'switchbuf'Jan Edmund Lazo2018-06-21
| | | | | | | | 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
* vim-patch:8.0.0607 (#6879)Daniel Hahler2017-06-11
| | | | | | | | 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
* vim-patch:7.4.1976James McCoy2017-06-04
| | | | | | | 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
* *: Silence some false positivesZyX2017-04-16
|
* refactor/single-include: buffer.h (#6396)relnod2017-03-30
|
* *: Move some dictionary functions to typval.h and use char*ZyX2017-03-29
| | | | Also fixes buffer reusage in setmatches() and complete().
* buffer: Hide one of the asserts from lua parserZyX2017-02-25
|
* eval: Do not allocate b:changedtick dictionary itemZyX2017-02-24
|
* buffer: Bind b:changedtick to b:['changedtick'], remove special casesZyX2017-02-23
|
* Make Nvim work with latest vim-patch v7.4.2024Marco Hinz2017-02-04
| | | | | | | | 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.
* vim-patch:7.4.2024Marco Hinz2017-02-04
| | | | | | | | | | 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
* vim-patch:7.4.2017Marco Hinz2017-02-04
| | | | | | | | | | | 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
* *: Fix errors from new linter checksZyX2016-06-11
|
* tabline: Add %[] atom to the tabline, for random commands on clickZyX2016-02-01
| | | | Currently untested and undocumented.
* buffer: Add WITH_BUFFER macro to simplify global buffer modificationThiago de Arruda2015-03-25
| | | | | | Most internal functions to modify buffers operate on the current buffer and require temporary switchs. This macro is a temporary workaround until a cleaner refactoring of the internal API is performed.
* Change buffer.h #defines to enums so they can be used in testsWayne Rowcliffe2014-07-22
|
* vim: include used definitions in headersNicolas Hillegeer2014-07-16
| | | | | | | | This is not an exhaustive commit, it merely ameliorates the situations a bit. There are quite a few header files that don't include all the types they use in their function/struct/... definitions. This throws of the testing infrastructure (but is not such a problem for the main binary that has the "tumbleweed of includes"-phenomenon).