aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_session.c
Commit message (Collapse)AuthorAge
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
|
* build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
|
* build(IWYU): replace most private mappings with pragmas (#26247)zeertzjq2023-11-27
|
* refactor: follow style guidedundargoc2023-11-19
| | | | | - reduce variable scope - prefer initialization over declaration and assignment
* refactor: follow style guidedundargoc2023-11-13
| | | | | | - reduce variable scope - prefer initialization over declaration and assignment - use bool to represent boolean values
* vim-patch:8.2.4850: mksession mixes up "tabpages" and "curdir" argumentszeertzjq2023-11-13
| | | | | | | | | Problem: Mksession mixes up "tabpages" and "curdir" arguments. Solution: Correct logic for storing tabpage in session. (closes vim/vim#10312) https://github.com/vim/vim/commit/d7c9564d8d24343f2e27205633032dd6ebe5232c Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:partial:8.1.1218: cannot set a directory for a tab pagezeertzjq2023-11-13
| | | | | | | | | | | Problem: Cannot set a directory for a tab page. Solution: Add the tab-local directory. (Yegappan Lakshmanan, closes vim/vim#4212) https://github.com/vim/vim/commit/00aa069db8132851a91cfc5ca7f58ef945c75c73 Session-related changes only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* refactor: the long goodbyedundargoc2023-11-05
| | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
* refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | - 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
* build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
|
* refactor(ex_session.c): remove unnecessary char -> int -> char castzeertzjq2023-09-03
| | | | The two calls to get_view_file() both pass a char in a string, and get_view_file() assigns it to a char in a string.
* refactor: add const and remove unnecessary casts (#22841)ii142023-04-01
|
* vim-patch:8.2.1398: autoload script sourced twice if sourced directly (#22622)zeertzjq2023-03-11
| | | | | | | | | | | Problem: Autoload script sourced twice if sourced directly. Solution: Do not source an autoload script again. (issue vim/vim#6644) https://github.com/vim/vim/commit/daa2f36573db3e1df7eb1fdbc3a09a2815644048 Cherry-pick ret_sid changes from patch 8.2.0149. Use do_in_runtimepath() as that's what source_runtime() calls in Nvim. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: reduce scope of locals as per the style guide (#22206)dundargoc2023-02-11
|
* vim-patch:partial:9.0.1237: code is indented more than necessary (#21971)zeertzjq2023-01-24
| | | | | | | | | Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes vim/vim#11858) https://github.com/vim/vim/commit/6ec66660476562e643deceb7c325cd0e8c903663 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc2023-01-15
| | | Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
* refactor: replace char_u with char 21 (#21779)dundargoc2023-01-14
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 19 (#21241)dundargoc2023-01-10
| | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 17 - remove STRLCPY (#21235)dundargoc2023-01-09
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* 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: 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: replace char_u with charDundar Göc2022-10-15
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 4 (#19987)dundargoc2022-08-30
| | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Goc2022-08-25
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.1.1869: code for the argument list is spread out (#19791)zeertzjq2022-08-16
| | | | | | Problem: Code for the argument list is spread out. Solution: Put argument list code in arglist.c. (Yegappan Lakshmanan, closes vim/vim#4819) https://github.com/vim/vim/commit/4ad62155a1015751a6645aaecd94b02c94c8934b
* refactor: remove some unused includes (#19740)zeertzjq2022-08-12
| | | | Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers.
* fix(session): respect sessionoptions=terminal #19497Gustavo Sampaio2022-08-01
| | | | | fixes #13078 Co-authored-by: Yuta Katayama <8683947+yutkat@users.noreply.github.com>
* vim-patch:8.1.1547: functionality of bt_nofile() is confusingzeertzjq2022-07-15
| | | | | | Problem: Functionality of bt_nofile() is confusing. Solution: Split into bt_nofile() and bt_nofilename(). https://github.com/vim/vim/commit/26910de8b0da6abab87bd5a397330f9cbe483309
* vim-patch:8.2.3530: ":buf \{a}" fails while ":edit \{a}" workszeertzjq2022-07-10
| | | | | | Problem: ":buf \{a}" fails while ":edit \{a}" works. Solution: Unescape "\{". (closes vim/vim#8917) https://github.com/vim/vim/commit/21c1a0c2f10575dbb72fa873d33f0c1f6e170aa7
* refactor: replace char_uDundar Goc2022-07-02
| | | | Work on https://github.com/neovim/neovim/issues/459
* feat(marks): restore viewport on jump #15831Javier Lopez2022-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ** Refactor Previously most functions used to "get" a mark returned a position, changed the line number and sometimes changed even the current buffer. Now functions return a {x}fmark_T making calling context aware whether the mark is in another buffer without arcane casting. A new function is provided for switching to the mark buffer and returning a flag style Enum to convey what happen in the movement. If the cursor changed, line, columns, if it changed buffer, etc. The function to get named mark was split into multiple functions. - mark_get() -> fmark_T - mark_get_global() -> xfmark_T - mark_get_local() -> fmark_T - mark_get_motion() -> fmark_T - mark_get_visual() -> fmark_T Functions that manage the changelist and jumplist were also modified to return mark types. - get_jumplist -> fmark_T - get_changelist -> fmark_T The refactor is also seen mainly on normal.c, where all the mark movement has been siphoned through one function nv_gomark, while the other functions handle getting the mark and setting their movement flags. To handle whether context marks should be left, etc. ** Mark View While doing the refactor the concept of a mark view was also implemented: The view of a mark currently implemented as the number of lines between the mark position on creation and the window topline. This allows for moving not only back to the position of a mark but having the window look similar to when the mark was defined. This is done by carrying and extra element in the fmark_T struct, which can be extended later to also restore horizontal shift. *** User space features 1. There's a new option, jumpoptions+=view enables the mark view restoring automatically when using the jumplist, changelist, alternate-file and mark motions. <C-O> <C-I> g; g, <C-^> '[mark] `[mark] ** Limitations - The view information is not saved in shada. - Calls to get_mark should copy the value in the pointer since we are using pos_to_mark() to wrap and provide a homogeneous interfaces. This was also a limitation in the previous state of things.
* refactor: replace char_u #18429dundargoc2022-06-28
| | | Work on https://github.com/neovim/neovim/issues/459
* refactor: move some mapping-related code to a separate file (#19061)zeertzjq2022-06-23
| | | | | | | | | | | | | | | | | | | This marks the following Vim patches as ported: vim-patch:8.1.1785: map functionality mixed with character input Problem: Map functionality mixed with character input. Solution: Move the map functionality to a separate file. (Yegappan Lakshmanan, closes vim/vim#4740) Graduate the +localmap feature. https://github.com/vim/vim/commit/b66bab381c8ba71fd6e92327d1d34c6f8a65f2a7 vim-patch:8.2.3643: header for source file is outdated Problem: Header for source file is outdated. Solution: Make the header more accurate. (closes vim/vim#9186) https://github.com/vim/vim/commit/a3f83feb63eae5464a620ae793c002eb45f7a838 Also cherry-pick a change for <unique> mappings from patch 8.2.0807. Rename map_clear_mode() to do_mapclear().
* fix(mksession): don't store floats in session #18635Daniel Steinberg2022-05-22
| | | | | | | | | | | | | | | | | | Problem: If there are floating windows when `:mksession` runs, the session cannot be properly restored. Solution: Change `:mksession` to skip floating windows. This matches Vim's treatment of popup windows. An alternative approach could have `:mksession` save floating windows that can be _properly_ restored (rather than skip them entirely, which is what this PR does). While that would seemingly be a more complete fix, that could present additional issues since floating windows are ordinarily created by plugins, and they may no longer be properly under a plugin's control when restored. closes #18432
* vim-patch:8.2.4980: when 'shortmess' contains 'A' loading session may still ↵zeertzjq2022-05-20
| | | | | | | | | | | warn (#18636) Problem: When 'shortmess' contains 'A' loading a session may still warn for an existing swap file. (Melker Österberg) Solution: Keep the 'A' flag to 'shortmess' in the session file. (closes vim/vim#10443) https://github.com/vim/vim/commit/aaadb5b6f76ea03e5eb460121f3dbf46ad04ce50 Use readfile() with "B" flag in test as readblob() needs patch 8.2.2343.
* refactor: replace char_u variables and functions with charDundar Goc2022-05-16
| | | | Work on https://github.com/neovim/neovim/issues/459
* fix PVS warnings (#18459)dundargoc2022-05-15
| | | | | | | | | | | | | * fix(PVS/V547): remove ifs that are always true or false * fix(PVS/V560): remove partial conditions that are always true * fix(PVS/V1044): suppress warning about loop break conditions * fix(PVS/V1063): suppress "modulo by 1 operation is meaningless" * fix(PVS/V568): suppress "operator evaluates the size of a pointer" Also mark vim-patch:8.2.4958 as ported.
* Merge pull request #18489 from dundargoc/refactor/remove-char_ubfredl2022-05-13
|\ | | | | refactor: replace char_u variables and functions with char
| * refactor: replace char_u variables and functions with charDundar Goc2022-05-11
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
* | refactor: rename keymap.{c,h} to keycodes.{c,h} (#18535)zeertzjq2022-05-12
|/ | | | | | | | Most code in keymap.h is for keycode definitions, while most code in keymap.c is for the parsing and conversion of keycodes. The name "keymap" may also make people think these two files are for mappings, while in fact keycodes are used even when no mappings are involved, so "keycodes" should be a better file name than "keymap".
* vim-patch:8.2.4645: 'shortmess' changed when session does not store options ↵zeertzjq2022-03-31
| | | | | | | | (#17908) Problem: 'shortmess' changed when session does not store options. Solution: Save and restore 'shortmess' if needed. (James Charti, closes vim/vim#10037) https://github.com/vim/vim/commit/fd01280d01c2270a320d8c962d24140a8176a400
* refactor: convert function comments to doxygen format (#17710)dundargoc2022-03-24
|
* Merge pull request #17266 from famiu/feat/ui/global-statuslinebfredl2022-03-17
|\ | | | | feat(statusline): add global statusline
| * feat: add support for global statuslineFamiu Haque2022-03-18
| | | | | | | | | | | | | | | | | | | | Ref: #9342 Adds the option to have a single global statusline for the current window at the bottom of the screen instead of a statusline at the bottom of every window. Enabled by setting `laststatus = 3`. Due to the fact that statuslines at the bottom of windows are removed when global statusline is enabled, horizontal separators are used instead to separate horizontal splits. The horizontal separator character is configurable through the`horiz` item in `'fillchars'`. Separator connector characters are also used to connect the horizontal and vertical separators together, which are also configurable through the `horizup`, `horizdown`, `vertleft`, `vertright` and `verthoriz` items in `fillchars`. The window separators are highlighted using the `WinSeparator` highlight group, which supersedes `VertSplit` and is linked to `VertSplit` by default in order to maintain backwards compatibility.
* | vim-patch:8.2.4566: check for existing buffer in session file may not workzeertzjq2022-03-15
|/ | | | | | | Problem: Check for existing buffer in session file does not work for files in the home directory. Solution: Use fnamemodify(). (James Cherti, closes vim/vim#9945) Add a test. https://github.com/vim/vim/commit/7d42840033aedf36389208b62e28b4e0b251c199
* vim-patch:8.2.4090: after restoring a session buffer order can be quite ↵Evgeni Chasnovski2022-01-29
| | | | | | | | | | | | | | | | different (#17112) Problem: After restoring a session buffer order can be quite different. Solution: Create buffers first. (Evgeni Chasnovski, closes vim/vim#9520) https://github.com/vim/vim/commit/26ebf1f036517ebeacf571c333a83cca7e13bbe2 --------------- As in Vim, this basically reverts 8.1.0829 providing different solution (see vim/vim#9520). Regarding Neovim, this basically reverts changes from #15062. Test about restoring same terminals was a bit too restrictive with using actual buffer ids, which changed with this patch (now they should be in the same order as at `mksession` call), so I tweaked it.
* vim-patch:8.2.4007: session does not restore help buffer properlyzeertzjq2022-01-07
| | | | | | | | Problem: Session does not restore help buffer properly when "options' is missing from 'sessionoptions'. Solution: Use a ":help" command to create the help window. (closes vim/vim#9475, closes vim/vim#9458, closes vim/vim#9472) https://github.com/vim/vim/commit/8e7d9db32b53ca2b1cb7570d2042860bcd1e943f
* refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.