Mercurial > vim
annotate src/proto/buffer.pro @ 34383:a84fe48ae523 v9.1.0118
patch 9.1.0118: Use different restoration strategy in win_splitmove
Commit: https://github.com/vim/vim/commit/704966c2545897dfcf426dd9ef946aeb6fa80c38
Author: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Date: Tue Feb 20 22:00:33 2024 +0100
patch 9.1.0118: Use different restoration strategy in win_splitmove
Problem: saving and restoring all frames to split-move is overkill now
that WinNewPre is not fired when split-moving.
Solution: defer the flattening of frames until win_split_ins begins
reorganising them, and attempt to restore the layout by
undoing our changes. (Sean Dewar)
This also means we no longer must allocate.
related: #14042
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 20 Feb 2024 22:30:07 +0100 |
parents | 9716c7d24c12 |
children | 780b6f4c3d1f |
rev | line source |
---|---|
7 | 1 /* buffer.c */ |
17823
7e6b7a4f13bc
patch 8.1.1908: every popup window consumes a buffer number
Bram Moolenaar <Bram@vim.org>
parents:
17789
diff
changeset
|
2 int get_highest_fnum(void); |
17225
09fa437d33d8
patch 8.1.1612: cannot show an existing buffer in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17151
diff
changeset
|
3 void buffer_ensure_loaded(buf_T *buf); |
31018
9716c7d24c12
patch 9.0.0844: handling 'statusline' errors is spread out
Bram Moolenaar <Bram@vim.org>
parents:
29310
diff
changeset
|
4 int open_buffer(int read_stdin, exarg_T *eap, int flags_arg); |
9475
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
7668
diff
changeset
|
5 void set_bufref(bufref_T *bufref, buf_T *buf); |
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
7668
diff
changeset
|
6 int bufref_valid(bufref_T *bufref); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
7 int buf_valid(buf_T *buf); |
23624
f9d02c83f306
patch 8.2.2354: crash with a weird combination of autocommands
Bram Moolenaar <Bram@vim.org>
parents:
22822
diff
changeset
|
8 int close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last, int ignore_abort); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
9 void buf_clear_file(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
10 void buf_freeall(buf_T *buf, int flags); |
22713
e871a824efc9
patch 8.2.1905: the wininfo list may contain stale entries
Bram Moolenaar <Bram@vim.org>
parents:
18886
diff
changeset
|
11 void free_wininfo(wininfo_T *wip); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
12 void goto_buffer(exarg_T *eap, int start, int dir, int count); |
9487
69ed2c9d34a6
commit https://github.com/vim/vim/commit/7c0a2f367f2507669560b1a66423155c70d2e75b
Christian Brabandt <cb@256bit.org>
parents:
9475
diff
changeset
|
13 void handle_swap_exists(bufref_T *old_curbuf); |
29310
f103da6ba95f
patch 8.2.5171: dependencies and proto files are outdated
Bram Moolenaar <Bram@vim.org>
parents:
23624
diff
changeset
|
14 int do_buffer(int action, int start, int dir, int count, int forceit); |
15470
55ccc2d353bd
patch 8.1.0743: giving error messages is not flexible
Bram Moolenaar <Bram@vim.org>
parents:
15330
diff
changeset
|
15 char *do_bufdel(int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
16 void set_curbuf(buf_T *buf, int action); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
17 void do_autochdir(void); |
12146
59c1e09cf1a9
patch 8.0.0953: get "no write since last change" error in terminal window
Christian Brabandt <cb@256bit.org>
parents:
11959
diff
changeset
|
18 void no_write_message(void); |
13302
b5806be0b36d
patch 8.0.1525: using :wqa exits even if a job runs in a terminal window
Christian Brabandt <cb@256bit.org>
parents:
12146
diff
changeset
|
19 void no_write_message_nobang(buf_T *buf); |
13782
3be5e8306a3e
patch 8.0.1763: :argedit does not reuse an empty unnamed buffer
Christian Brabandt <cb@256bit.org>
parents:
13302
diff
changeset
|
20 int curbuf_reusable(void); |
15195
16b2f2db6f28
patch 8.1.0607: proto files are not in sync with the source code
Bram Moolenaar <Bram@vim.org>
parents:
14433
diff
changeset
|
21 buf_T *buflist_new(char_u *ffname_arg, char_u *sfname_arg, linenr_T lnum, int flags); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
22 void free_buf_options(buf_T *buf, int free_p_ff); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
23 int buflist_getfile(int n, linenr_T lnum, int options, int forceit); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
24 buf_T *buflist_findname_exp(char_u *fname); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
25 buf_T *buflist_findname(char_u *ffname); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
26 int buflist_findpat(char_u *pattern, char_u *pattern_end, int unlisted, int diffmode, int curtab_only); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
27 int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
28 buf_T *buflist_findnr(int nr); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
29 char_u *buflist_nr2name(int n, int fullname, int helptail); |
17458
cfdef48743ed
patch 8.1.1727: code for viminfo support is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17225
diff
changeset
|
30 void buflist_setfpos(buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
31 void get_winopts(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
32 pos_T *buflist_findfpos(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
33 linenr_T buflist_findlnum(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
34 void buflist_list(exarg_T *eap); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
35 int buflist_name_nr(int fnum, char_u **fname, linenr_T *lnum); |
15195
16b2f2db6f28
patch 8.1.0607: proto files are not in sync with the source code
Bram Moolenaar <Bram@vim.org>
parents:
14433
diff
changeset
|
36 int setfname(buf_T *buf, char_u *ffname_arg, char_u *sfname_arg, int message); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
37 void buf_set_name(int fnum, char_u *name); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
38 void buf_name_changed(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
39 buf_T *setaltfname(char_u *ffname, char_u *sfname, linenr_T lnum); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
40 char_u *getaltfname(int errmsg); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
41 int buflist_add(char_u *fname, int flags); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
42 void buflist_slash_adjust(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
43 void buflist_altfpos(win_T *win); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
44 int otherfile(char_u *ffname); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
45 void buf_setino(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
46 void fileinfo(int fullname, int shorthelp, int dont_truncate); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
47 void col_print(char_u *buf, size_t buflen, int col, int vcol); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
48 void maketitle(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
49 void resettitle(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
50 void free_titles(void); |
31018
9716c7d24c12
patch 9.0.0844: handling 'statusline' errors is spread out
Bram Moolenaar <Bram@vim.org>
parents:
29310
diff
changeset
|
51 int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, char_u *opt_name, int opt_scope, int fillchar, int maxwidth, stl_hlrec_T **hltab, stl_hlrec_T **tabtab); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
52 void get_rel_pos(win_T *wp, char_u *buf, int buflen); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
53 char_u *fix_fname(char_u *fname); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
54 void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
55 void ex_buffer_all(exarg_T *eap); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
56 void do_modelines(int flags); |
14433
4a94173743d9
patch 8.1.0230: directly checking 'buftype' value
Christian Brabandt <cb@256bit.org>
parents:
14019
diff
changeset
|
57 int bt_normal(buf_T *buf); |
11788
77bf0346687e
patch 8.0.0776: function prototypes missing without the quickfix feature
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
58 int bt_quickfix(buf_T *buf); |
77bf0346687e
patch 8.0.0776: function prototypes missing without the quickfix feature
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
59 int bt_terminal(buf_T *buf); |
11800
5ceaecedbad2
patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents:
11788
diff
changeset
|
60 int bt_help(buf_T *buf); |
14019
dc67449d648c
patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
13782
diff
changeset
|
61 int bt_prompt(buf_T *buf); |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
15470
diff
changeset
|
62 int bt_popup(buf_T *buf); |
17095
10e0d7d96cb0
patch 8.1.1547: functionality of bt_nofile() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
16778
diff
changeset
|
63 int bt_nofilename(buf_T *buf); |
11788
77bf0346687e
patch 8.0.0776: function prototypes missing without the quickfix feature
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
64 int bt_nofile(buf_T *buf); |
77bf0346687e
patch 8.0.0776: function prototypes missing without the quickfix feature
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
65 int bt_dontwrite(buf_T *buf); |
77bf0346687e
patch 8.0.0776: function prototypes missing without the quickfix feature
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
66 int bt_dontwrite_msg(buf_T *buf); |
77bf0346687e
patch 8.0.0776: function prototypes missing without the quickfix feature
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
67 int buf_hide(buf_T *buf); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
68 char_u *buf_spname(buf_T *buf); |
22822
0b4658e030cb
patch 8.2.1959: crash when terminal buffer name is made empty
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
69 char_u *buf_get_fname(buf_T *buf); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
70 void set_buflisted(int on); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
71 int buf_contents_changed(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
72 void wipe_buffer(buf_T *buf, int aucmd); |
7 | 73 /* vim: set ft=c : */ |