summaryrefslogtreecommitdiff
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-05-29 16:17:08 +0200
committerBram Moolenaar <Bram@vim.org>2016-05-29 16:17:08 +0200
commit9f5842e63fc63d438cbffcec503e072a06f74dc2 (patch)
tree722a0cb6e032ac36deecd818f08991106d1fcadd /src/structs.h
parent324a78f3b649e7b14741519ecf19c4aba178772d (diff)
downloadvim-git-9f5842e63fc63d438cbffcec503e072a06f74dc2.tar.gz
patch 7.4.1857v7.4.1857
Problem: When a channel appends to a buffer that is 'nomodifiable' there is an error but appending is done anyway. Solution: Add the 'modifiable' option. Refuse to write to a 'nomodifiable' when the value is 1.
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/structs.h b/src/structs.h
index 12a8a4387..d5f8adc83 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1401,6 +1401,8 @@ typedef struct {
partial_T *ch_partial;
buf_T *ch_buffer; /* buffer to read from or write to */
+ int ch_nomodifiable; /* TRUE when buffer can be 'nomodifiable' */
+ int ch_nomod_error; /* TRUE when e_modifiable was given */
int ch_buf_append; /* write appended lines instead top-bot */
linenr_T ch_buf_top; /* next line to send */
linenr_T ch_buf_bot; /* last line to send */
@@ -1477,6 +1479,8 @@ struct channel_S {
#define JO_IN_BUF 0x4000000 /* "in_buf" (JO_OUT_BUF << 2) */
#define JO_CHANNEL 0x8000000 /* "channel" */
#define JO_BLOCK_WRITE 0x10000000 /* "block_write" */
+#define JO_OUT_MODIFIABLE 0x20000000 /* "out_modifiable" */
+#define JO_ERR_MODIFIABLE 0x40000000 /* "err_modifiable" (JO_OUT_ << 1) */
#define JO_ALL 0x7fffffff
#define JO_MODE_ALL (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE)
@@ -1500,6 +1504,7 @@ typedef struct
char_u jo_io_name_buf[4][NUMBUFLEN];
char_u *jo_io_name[4]; /* not allocated! */
int jo_io_buf[4];
+ int jo_modifiable[4];
channel_T *jo_channel;
linenr_T jo_in_top;