Mercurial > vim
annotate src/proto/buffer.pro @ 13782:3be5e8306a3e v8.0.1763
patch 8.0.1763: :argedit does not reuse an empty unnamed buffer
commit https://github.com/vim/vim/commit/46a53dfc29689c6a0d80e3820e8b0a48dba6b6ec
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 24 21:58:51 2018 +0200
patch 8.0.1763: :argedit does not reuse an empty unnamed buffer
Problem: :argedit does not reuse an empty unnamed buffer.
Solution: Add the BLN_CURBUF flag and fix all the side effects. (Christian
Brabandt, closes #2713)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 24 Apr 2018 22:00:07 +0200 |
parents | b5806be0b36d |
children | dc67449d648c |
rev | line source |
---|---|
7 | 1 /* buffer.c */ |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
2 int open_buffer(int read_stdin, exarg_T *eap, int flags); |
9475
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
7668
diff
changeset
|
3 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
|
4 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
|
5 int buf_valid(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
6 void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
7 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
|
8 void buf_freeall(buf_T *buf, int flags); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
9 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
|
10 void handle_swap_exists(bufref_T *old_curbuf); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
11 char_u *do_bufdel(int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
12 int do_buffer(int action, int start, int dir, int count, int forceit); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
13 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
|
14 void enter_buffer(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
15 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
|
16 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
|
17 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
|
18 int curbuf_reusable(void); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
19 buf_T *buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
20 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
|
21 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
|
22 void buflist_getfpos(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
23 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
|
24 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
|
25 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
|
26 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
|
27 buf_T *buflist_findnr(int nr); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
28 char_u *buflist_nr2name(int n, int fullname, int helptail); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
29 void get_winopts(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
30 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
|
31 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
|
32 void buflist_list(exarg_T *eap); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
33 int buflist_name_nr(int fnum, char_u **fname, linenr_T *lnum); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
34 int setfname(buf_T *buf, char_u *ffname, char_u *sfname, int message); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
35 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
|
36 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
|
37 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
|
38 char_u *getaltfname(int errmsg); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
39 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
|
40 void buflist_slash_adjust(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
41 void buflist_altfpos(win_T *win); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
42 int otherfile(char_u *ffname); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
43 void buf_setino(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
44 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
|
45 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
|
46 void maketitle(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
47 void resettitle(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
48 void free_titles(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
49 int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
50 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
|
51 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
|
52 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
|
53 char_u *alist_name(aentry_T *aep); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
54 void do_arg_all(int count, int forceit, int keep_tabs); |
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); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
57 int read_viminfo_bufferlist(vir_T *virp, int writing); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
58 void write_viminfo_bufferlist(FILE *fp); |
11788
77bf0346687e
patch 8.0.0776: function prototypes missing without the quickfix feature
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
59 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
|
60 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
|
61 int bt_help(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
|
62 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
|
63 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
|
64 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
|
65 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
|
66 char_u *buf_spname(buf_T *buf); |
11959
91a26b7a4119
patch 8.0.0860: side effects when channel appends to a buffer
Christian Brabandt <cb@256bit.org>
parents:
11800
diff
changeset
|
67 void switch_to_win_for_buf(buf_T *buf, win_T **save_curwinp, tabpage_T **save_curtabp, bufref_T *save_curbuf); |
91a26b7a4119
patch 8.0.0860: side effects when channel appends to a buffer
Christian Brabandt <cb@256bit.org>
parents:
11800
diff
changeset
|
68 void restore_win_for_buf(win_T *save_curwin, tabpage_T *save_curtab, bufref_T *save_curbuf); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
69 int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
70 void buf_addsign(buf_T *buf, int id, linenr_T lnum, int typenr); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
71 linenr_T buf_change_sign_type(buf_T *buf, int markId, int typenr); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
72 int buf_getsigntype(buf_T *buf, linenr_T lnum, int type); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
73 linenr_T buf_delsign(buf_T *buf, int id); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
74 int buf_findsign(buf_T *buf, int id); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
75 int buf_findsign_id(buf_T *buf, linenr_T lnum); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
76 int buf_findsigntype_id(buf_T *buf, linenr_T lnum, int typenr); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
77 int buf_signcount(buf_T *buf, linenr_T lnum); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
78 void buf_delete_signs(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
79 void buf_delete_all_signs(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
80 void sign_list_placed(buf_T *rbuf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
81 void sign_mark_adjust(linenr_T line1, linenr_T line2, long amount, long amount_after); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
82 void set_buflisted(int on); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
5202
diff
changeset
|
83 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
|
84 void wipe_buffer(buf_T *buf, int aucmd); |
7 | 85 /* vim: set ft=c : */ |