|
Karsten Hopp |
a7e629 |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
a7e629 |
Subject: Patch 7.4.171
|
|
Karsten Hopp |
a7e629 |
Fcc: outbox
|
|
Karsten Hopp |
a7e629 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
a7e629 |
Mime-Version: 1.0
|
|
Karsten Hopp |
a7e629 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
a7e629 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
a7e629 |
------------
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
Patch 7.4.171
|
|
Karsten Hopp |
a7e629 |
Problem: Redo does not set v:count and v:count1.
|
|
Karsten Hopp |
a7e629 |
Solution: Use a separate buffer for redo, so that we can set the counts when
|
|
Karsten Hopp |
a7e629 |
performing redo.
|
|
Karsten Hopp |
a7e629 |
Files: src/getchar.c, src/globals.h, src/normal.c, src/proto/getchar.pro,
|
|
Karsten Hopp |
a7e629 |
src/structs.h
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
*** ../vim-7.4.170/src/getchar.c 2013-06-29 13:43:27.000000000 +0200
|
|
Karsten Hopp |
a7e629 |
--- src/getchar.c 2014-02-11 14:54:46.830097259 +0100
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 40,52 ****
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
#define MINIMAL_SIZE 20 /* minimal size for b_str */
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! static struct buffheader redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
! static struct buffheader old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
|
|
Karsten Hopp |
a7e629 |
! static struct buffheader save_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
! static struct buffheader save_old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
! static struct buffheader recordbuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
static int typeahead_char = 0; /* typeahead char that's not flushed */
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
--- 40,52 ----
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
#define MINIMAL_SIZE 20 /* minimal size for b_str */
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! static buffheader_T redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
! static buffheader_T old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
|
|
Karsten Hopp |
a7e629 |
! static buffheader_T save_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
! static buffheader_T save_old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
! static buffheader_T recordbuff = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
static int typeahead_char = 0; /* typeahead char that's not flushed */
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 112,122 ****
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
static int last_recorded_len = 0; /* number of last recorded chars */
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! static char_u *get_buffcont __ARGS((struct buffheader *, int));
|
|
Karsten Hopp |
a7e629 |
! static void add_buff __ARGS((struct buffheader *, char_u *, long n));
|
|
Karsten Hopp |
a7e629 |
! static void add_num_buff __ARGS((struct buffheader *, long));
|
|
Karsten Hopp |
a7e629 |
! static void add_char_buff __ARGS((struct buffheader *, int));
|
|
Karsten Hopp |
a7e629 |
! static int read_stuff __ARGS((int advance));
|
|
Karsten Hopp |
a7e629 |
static void start_stuff __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
static int read_redo __ARGS((int, int));
|
|
Karsten Hopp |
a7e629 |
static void copy_redo __ARGS((int));
|
|
Karsten Hopp |
a7e629 |
--- 112,123 ----
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
static int last_recorded_len = 0; /* number of last recorded chars */
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! static char_u *get_buffcont __ARGS((buffheader_T *, int));
|
|
Karsten Hopp |
a7e629 |
! static void add_buff __ARGS((buffheader_T *, char_u *, long n));
|
|
Karsten Hopp |
a7e629 |
! static void add_num_buff __ARGS((buffheader_T *, long));
|
|
Karsten Hopp |
a7e629 |
! static void add_char_buff __ARGS((buffheader_T *, int));
|
|
Karsten Hopp |
a7e629 |
! static int read_readbuffers __ARGS((int advance));
|
|
Karsten Hopp |
a7e629 |
! static int read_readbuf __ARGS((buffheader_T *buf, int advance));
|
|
Karsten Hopp |
a7e629 |
static void start_stuff __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
static int read_redo __ARGS((int, int));
|
|
Karsten Hopp |
a7e629 |
static void copy_redo __ARGS((int));
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 137,145 ****
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
void
|
|
Karsten Hopp |
a7e629 |
free_buff(buf)
|
|
Karsten Hopp |
a7e629 |
! struct buffheader *buf;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! struct buffblock *p, *np;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
for (p = buf->bh_first.b_next; p != NULL; p = np)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
--- 138,146 ----
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
void
|
|
Karsten Hopp |
a7e629 |
free_buff(buf)
|
|
Karsten Hopp |
a7e629 |
! buffheader_T *buf;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! buffblock_T *p, *np;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
for (p = buf->bh_first.b_next; p != NULL; p = np)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 155,168 ****
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static char_u *
|
|
Karsten Hopp |
a7e629 |
get_buffcont(buffer, dozero)
|
|
Karsten Hopp |
a7e629 |
! struct buffheader *buffer;
|
|
Karsten Hopp |
a7e629 |
int dozero; /* count == zero is not an error */
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
long_u count = 0;
|
|
Karsten Hopp |
a7e629 |
char_u *p = NULL;
|
|
Karsten Hopp |
a7e629 |
char_u *p2;
|
|
Karsten Hopp |
a7e629 |
char_u *str;
|
|
Karsten Hopp |
a7e629 |
! struct buffblock *bp;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/* compute the total length of the string */
|
|
Karsten Hopp |
a7e629 |
for (bp = buffer->bh_first.b_next; bp != NULL; bp = bp->b_next)
|
|
Karsten Hopp |
a7e629 |
--- 156,169 ----
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static char_u *
|
|
Karsten Hopp |
a7e629 |
get_buffcont(buffer, dozero)
|
|
Karsten Hopp |
a7e629 |
! buffheader_T *buffer;
|
|
Karsten Hopp |
a7e629 |
int dozero; /* count == zero is not an error */
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
long_u count = 0;
|
|
Karsten Hopp |
a7e629 |
char_u *p = NULL;
|
|
Karsten Hopp |
a7e629 |
char_u *p2;
|
|
Karsten Hopp |
a7e629 |
char_u *str;
|
|
Karsten Hopp |
a7e629 |
! buffblock_T *bp;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/* compute the total length of the string */
|
|
Karsten Hopp |
a7e629 |
for (bp = buffer->bh_first.b_next; bp != NULL; bp = bp->b_next)
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 230,240 ****
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static void
|
|
Karsten Hopp |
a7e629 |
add_buff(buf, s, slen)
|
|
Karsten Hopp |
a7e629 |
! struct buffheader *buf;
|
|
Karsten Hopp |
a7e629 |
char_u *s;
|
|
Karsten Hopp |
a7e629 |
long slen; /* length of "s" or -1 */
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! struct buffblock *p;
|
|
Karsten Hopp |
a7e629 |
long_u len;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
if (slen < 0)
|
|
Karsten Hopp |
a7e629 |
--- 231,241 ----
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static void
|
|
Karsten Hopp |
a7e629 |
add_buff(buf, s, slen)
|
|
Karsten Hopp |
a7e629 |
! buffheader_T *buf;
|
|
Karsten Hopp |
a7e629 |
char_u *s;
|
|
Karsten Hopp |
a7e629 |
long slen; /* length of "s" or -1 */
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! buffblock_T *p;
|
|
Karsten Hopp |
a7e629 |
long_u len;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
if (slen < 0)
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 270,276 ****
|
|
Karsten Hopp |
a7e629 |
len = MINIMAL_SIZE;
|
|
Karsten Hopp |
a7e629 |
else
|
|
Karsten Hopp |
a7e629 |
len = slen;
|
|
Karsten Hopp |
a7e629 |
! p = (struct buffblock *)lalloc((long_u)(sizeof(struct buffblock) + len),
|
|
Karsten Hopp |
a7e629 |
TRUE);
|
|
Karsten Hopp |
a7e629 |
if (p == NULL)
|
|
Karsten Hopp |
a7e629 |
return; /* no space, just forget it */
|
|
Karsten Hopp |
a7e629 |
--- 271,277 ----
|
|
Karsten Hopp |
a7e629 |
len = MINIMAL_SIZE;
|
|
Karsten Hopp |
a7e629 |
else
|
|
Karsten Hopp |
a7e629 |
len = slen;
|
|
Karsten Hopp |
a7e629 |
! p = (buffblock_T *)lalloc((long_u)(sizeof(buffblock_T) + len),
|
|
Karsten Hopp |
a7e629 |
TRUE);
|
|
Karsten Hopp |
a7e629 |
if (p == NULL)
|
|
Karsten Hopp |
a7e629 |
return; /* no space, just forget it */
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 289,295 ****
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static void
|
|
Karsten Hopp |
a7e629 |
add_num_buff(buf, n)
|
|
Karsten Hopp |
a7e629 |
! struct buffheader *buf;
|
|
Karsten Hopp |
a7e629 |
long n;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
char_u number[32];
|
|
Karsten Hopp |
a7e629 |
--- 290,296 ----
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static void
|
|
Karsten Hopp |
a7e629 |
add_num_buff(buf, n)
|
|
Karsten Hopp |
a7e629 |
! buffheader_T *buf;
|
|
Karsten Hopp |
a7e629 |
long n;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
char_u number[32];
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 304,310 ****
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static void
|
|
Karsten Hopp |
a7e629 |
add_char_buff(buf, c)
|
|
Karsten Hopp |
a7e629 |
! struct buffheader *buf;
|
|
Karsten Hopp |
a7e629 |
int c;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
a7e629 |
--- 305,311 ----
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static void
|
|
Karsten Hopp |
a7e629 |
add_char_buff(buf, c)
|
|
Karsten Hopp |
a7e629 |
! buffheader_T *buf;
|
|
Karsten Hopp |
a7e629 |
int c;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 354,399 ****
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
! * Get one byte from the stuff buffer.
|
|
Karsten Hopp |
a7e629 |
* If advance == TRUE go to the next char.
|
|
Karsten Hopp |
a7e629 |
* No translation is done K_SPECIAL and CSI are escaped.
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static int
|
|
Karsten Hopp |
a7e629 |
! read_stuff(advance)
|
|
Karsten Hopp |
a7e629 |
int advance;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! char_u c;
|
|
Karsten Hopp |
a7e629 |
! struct buffblock *curr;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! if (stuffbuff.bh_first.b_next == NULL) /* buffer is empty */
|
|
Karsten Hopp |
a7e629 |
return NUL;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! curr = stuffbuff.bh_first.b_next;
|
|
Karsten Hopp |
a7e629 |
! c = curr->b_str[stuffbuff.bh_index];
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
if (advance)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! if (curr->b_str[++stuffbuff.bh_index] == NUL)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! stuffbuff.bh_first.b_next = curr->b_next;
|
|
Karsten Hopp |
a7e629 |
vim_free(curr);
|
|
Karsten Hopp |
a7e629 |
! stuffbuff.bh_index = 0;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
return c;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
! * Prepare the stuff buffer for reading (if it contains something).
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static void
|
|
Karsten Hopp |
a7e629 |
start_stuff()
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! if (stuffbuff.bh_first.b_next != NULL)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! stuffbuff.bh_curr = &(stuffbuff.bh_first);
|
|
Karsten Hopp |
a7e629 |
! stuffbuff.bh_space = 0;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
--- 355,425 ----
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
+ /* First read ahead buffer. Used for translated commands. */
|
|
Karsten Hopp |
a7e629 |
+ static buffheader_T readbuf1 = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
+
|
|
Karsten Hopp |
a7e629 |
+ /* Second read ahead buffer. Used for redo. */
|
|
Karsten Hopp |
a7e629 |
+ static buffheader_T readbuf2 = {{NULL, {NUL}}, NULL, 0, 0};
|
|
Karsten Hopp |
a7e629 |
+
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
! * Get one byte from the read buffers. Use readbuf1 one first, use readbuf2
|
|
Karsten Hopp |
a7e629 |
! * if that one is empty.
|
|
Karsten Hopp |
a7e629 |
* If advance == TRUE go to the next char.
|
|
Karsten Hopp |
a7e629 |
* No translation is done K_SPECIAL and CSI are escaped.
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static int
|
|
Karsten Hopp |
a7e629 |
! read_readbuffers(advance)
|
|
Karsten Hopp |
a7e629 |
int advance;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! int c;
|
|
Karsten Hopp |
a7e629 |
!
|
|
Karsten Hopp |
a7e629 |
! c = read_readbuf(&readbuf1, advance);
|
|
Karsten Hopp |
a7e629 |
! if (c == NUL)
|
|
Karsten Hopp |
a7e629 |
! c = read_readbuf(&readbuf2, advance);
|
|
Karsten Hopp |
a7e629 |
! return c;
|
|
Karsten Hopp |
a7e629 |
! }
|
|
Karsten Hopp |
a7e629 |
!
|
|
Karsten Hopp |
a7e629 |
! static int
|
|
Karsten Hopp |
a7e629 |
! read_readbuf(buf, advance)
|
|
Karsten Hopp |
a7e629 |
! buffheader_T *buf;
|
|
Karsten Hopp |
a7e629 |
! int advance;
|
|
Karsten Hopp |
a7e629 |
! {
|
|
Karsten Hopp |
a7e629 |
! char_u c;
|
|
Karsten Hopp |
a7e629 |
! buffblock_T *curr;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! if (buf->bh_first.b_next == NULL) /* buffer is empty */
|
|
Karsten Hopp |
a7e629 |
return NUL;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! curr = buf->bh_first.b_next;
|
|
Karsten Hopp |
a7e629 |
! c = curr->b_str[buf->bh_index];
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
if (advance)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! if (curr->b_str[++buf->bh_index] == NUL)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! buf->bh_first.b_next = curr->b_next;
|
|
Karsten Hopp |
a7e629 |
vim_free(curr);
|
|
Karsten Hopp |
a7e629 |
! buf->bh_index = 0;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
return c;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
! * Prepare the read buffers for reading (if they contains something).
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
static void
|
|
Karsten Hopp |
a7e629 |
start_stuff()
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! if (readbuf1.bh_first.b_next != NULL)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! readbuf1.bh_curr = &(readbuf1.bh_first);
|
|
Karsten Hopp |
a7e629 |
! readbuf1.bh_space = 0;
|
|
Karsten Hopp |
a7e629 |
! }
|
|
Karsten Hopp |
a7e629 |
! if (readbuf2.bh_first.b_next != NULL)
|
|
Karsten Hopp |
a7e629 |
! {
|
|
Karsten Hopp |
a7e629 |
! readbuf2.bh_curr = &(readbuf2.bh_first);
|
|
Karsten Hopp |
a7e629 |
! readbuf2.bh_space = 0;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 403,409 ****
|
|
Karsten Hopp |
a7e629 |
int
|
|
Karsten Hopp |
a7e629 |
stuff_empty()
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! return (stuffbuff.bh_first.b_next == NULL);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
--- 429,446 ----
|
|
Karsten Hopp |
a7e629 |
int
|
|
Karsten Hopp |
a7e629 |
stuff_empty()
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! return (readbuf1.bh_first.b_next == NULL
|
|
Karsten Hopp |
a7e629 |
! && readbuf2.bh_first.b_next == NULL);
|
|
Karsten Hopp |
a7e629 |
! }
|
|
Karsten Hopp |
a7e629 |
!
|
|
Karsten Hopp |
a7e629 |
! /*
|
|
Karsten Hopp |
a7e629 |
! * Return TRUE if readbuf1 is empty. There may still be redo characters in
|
|
Karsten Hopp |
a7e629 |
! * redbuf2.
|
|
Karsten Hopp |
a7e629 |
! */
|
|
Karsten Hopp |
a7e629 |
! int
|
|
Karsten Hopp |
a7e629 |
! readbuf1_empty()
|
|
Karsten Hopp |
a7e629 |
! {
|
|
Karsten Hopp |
a7e629 |
! return (readbuf1.bh_first.b_next == NULL);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 428,434 ****
|
|
Karsten Hopp |
a7e629 |
init_typebuf();
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
start_stuff();
|
|
Karsten Hopp |
a7e629 |
! while (read_stuff(TRUE) != NUL)
|
|
Karsten Hopp |
a7e629 |
;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
if (flush_typeahead) /* remove all typeahead */
|
|
Karsten Hopp |
a7e629 |
--- 465,471 ----
|
|
Karsten Hopp |
a7e629 |
init_typebuf();
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
start_stuff();
|
|
Karsten Hopp |
a7e629 |
! while (read_readbuffers(TRUE) != NUL)
|
|
Karsten Hopp |
a7e629 |
;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
if (flush_typeahead) /* remove all typeahead */
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 483,489 ****
|
|
Karsten Hopp |
a7e629 |
redobuff = old_redobuff;
|
|
Karsten Hopp |
a7e629 |
old_redobuff.bh_first.b_next = NULL;
|
|
Karsten Hopp |
a7e629 |
start_stuff();
|
|
Karsten Hopp |
a7e629 |
! while (read_stuff(TRUE) != NUL)
|
|
Karsten Hopp |
a7e629 |
;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
--- 520,526 ----
|
|
Karsten Hopp |
a7e629 |
redobuff = old_redobuff;
|
|
Karsten Hopp |
a7e629 |
old_redobuff.bh_first.b_next = NULL;
|
|
Karsten Hopp |
a7e629 |
start_stuff();
|
|
Karsten Hopp |
a7e629 |
! while (read_readbuffers(TRUE) != NUL)
|
|
Karsten Hopp |
a7e629 |
;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 638,644 ****
|
|
Karsten Hopp |
a7e629 |
stuffReadbuff(s)
|
|
Karsten Hopp |
a7e629 |
char_u *s;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_buff(&stuffbuff, s, -1L);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
void
|
|
Karsten Hopp |
a7e629 |
--- 675,681 ----
|
|
Karsten Hopp |
a7e629 |
stuffReadbuff(s)
|
|
Karsten Hopp |
a7e629 |
char_u *s;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_buff(&readbuf1, s, -1L);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
void
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 646,652 ****
|
|
Karsten Hopp |
a7e629 |
char_u *s;
|
|
Karsten Hopp |
a7e629 |
long len;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_buff(&stuffbuff, s, len);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
#if defined(FEAT_EVAL) || defined(PROTO)
|
|
Karsten Hopp |
a7e629 |
--- 683,689 ----
|
|
Karsten Hopp |
a7e629 |
char_u *s;
|
|
Karsten Hopp |
a7e629 |
long len;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_buff(&readbuf1, s, len);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
#if defined(FEAT_EVAL) || defined(PROTO)
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 692,698 ****
|
|
Karsten Hopp |
a7e629 |
stuffcharReadbuff(c)
|
|
Karsten Hopp |
a7e629 |
int c;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_char_buff(&stuffbuff, c);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
--- 729,735 ----
|
|
Karsten Hopp |
a7e629 |
stuffcharReadbuff(c)
|
|
Karsten Hopp |
a7e629 |
int c;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_char_buff(&readbuf1, c);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 702,708 ****
|
|
Karsten Hopp |
a7e629 |
stuffnumReadbuff(n)
|
|
Karsten Hopp |
a7e629 |
long n;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_num_buff(&stuffbuff, n);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
--- 739,745 ----
|
|
Karsten Hopp |
a7e629 |
stuffnumReadbuff(n)
|
|
Karsten Hopp |
a7e629 |
long n;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_num_buff(&readbuf1, n);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 718,730 ****
|
|
Karsten Hopp |
a7e629 |
int init;
|
|
Karsten Hopp |
a7e629 |
int old_redo;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! static struct buffblock *bp;
|
|
Karsten Hopp |
a7e629 |
! static char_u *p;
|
|
Karsten Hopp |
a7e629 |
! int c;
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
a7e629 |
! int n;
|
|
Karsten Hopp |
a7e629 |
! char_u buf[MB_MAXBYTES + 1];
|
|
Karsten Hopp |
a7e629 |
! int i;
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
if (init)
|
|
Karsten Hopp |
a7e629 |
--- 755,767 ----
|
|
Karsten Hopp |
a7e629 |
int init;
|
|
Karsten Hopp |
a7e629 |
int old_redo;
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! static buffblock_T *bp;
|
|
Karsten Hopp |
a7e629 |
! static char_u *p;
|
|
Karsten Hopp |
a7e629 |
! int c;
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
a7e629 |
! int n;
|
|
Karsten Hopp |
a7e629 |
! char_u buf[MB_MAXBYTES + 1];
|
|
Karsten Hopp |
a7e629 |
! int i;
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
if (init)
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 795,805 ****
|
|
Karsten Hopp |
a7e629 |
int c;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
while ((c = read_redo(FALSE, old_redo)) != NUL)
|
|
Karsten Hopp |
a7e629 |
! stuffcharReadbuff(c);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
! * Stuff the redo buffer into the stuffbuff.
|
|
Karsten Hopp |
a7e629 |
* Insert the redo count into the command.
|
|
Karsten Hopp |
a7e629 |
* If "old_redo" is TRUE, the last but one command is repeated
|
|
Karsten Hopp |
a7e629 |
* instead of the last command (inserting text). This is used for
|
|
Karsten Hopp |
a7e629 |
--- 832,842 ----
|
|
Karsten Hopp |
a7e629 |
int c;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
while ((c = read_redo(FALSE, old_redo)) != NUL)
|
|
Karsten Hopp |
a7e629 |
! add_char_buff(&readbuf2, c);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
! * Stuff the redo buffer into readbuf2.
|
|
Karsten Hopp |
a7e629 |
* Insert the redo count into the command.
|
|
Karsten Hopp |
a7e629 |
* If "old_redo" is TRUE, the last but one command is repeated
|
|
Karsten Hopp |
a7e629 |
* instead of the last command (inserting text). This is used for
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 823,835 ****
|
|
Karsten Hopp |
a7e629 |
/* copy the buffer name, if present */
|
|
Karsten Hopp |
a7e629 |
if (c == '"')
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_buff(&stuffbuff, (char_u *)"\"", 1L);
|
|
Karsten Hopp |
a7e629 |
c = read_redo(FALSE, old_redo);
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/* if a numbered buffer is used, increment the number */
|
|
Karsten Hopp |
a7e629 |
if (c >= '1' && c < '9')
|
|
Karsten Hopp |
a7e629 |
++c;
|
|
Karsten Hopp |
a7e629 |
! add_char_buff(&stuffbuff, c);
|
|
Karsten Hopp |
a7e629 |
c = read_redo(FALSE, old_redo);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
--- 860,872 ----
|
|
Karsten Hopp |
a7e629 |
/* copy the buffer name, if present */
|
|
Karsten Hopp |
a7e629 |
if (c == '"')
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! add_buff(&readbuf2, (char_u *)"\"", 1L);
|
|
Karsten Hopp |
a7e629 |
c = read_redo(FALSE, old_redo);
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/* if a numbered buffer is used, increment the number */
|
|
Karsten Hopp |
a7e629 |
if (c >= '1' && c < '9')
|
|
Karsten Hopp |
a7e629 |
++c;
|
|
Karsten Hopp |
a7e629 |
! add_char_buff(&readbuf2, c);
|
|
Karsten Hopp |
a7e629 |
c = read_redo(FALSE, old_redo);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 850,867 ****
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
while (VIM_ISDIGIT(c)) /* skip "old" count */
|
|
Karsten Hopp |
a7e629 |
c = read_redo(FALSE, old_redo);
|
|
Karsten Hopp |
a7e629 |
! add_num_buff(&stuffbuff, count);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/* copy from the redo buffer into the stuff buffer */
|
|
Karsten Hopp |
a7e629 |
! add_char_buff(&stuffbuff, c);
|
|
Karsten Hopp |
a7e629 |
copy_redo(old_redo);
|
|
Karsten Hopp |
a7e629 |
return OK;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
* Repeat the last insert (R, o, O, a, A, i or I command) by stuffing
|
|
Karsten Hopp |
a7e629 |
! * the redo buffer into the stuffbuff.
|
|
Karsten Hopp |
a7e629 |
* return FAIL for failure, OK otherwise
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
int
|
|
Karsten Hopp |
a7e629 |
--- 887,904 ----
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
while (VIM_ISDIGIT(c)) /* skip "old" count */
|
|
Karsten Hopp |
a7e629 |
c = read_redo(FALSE, old_redo);
|
|
Karsten Hopp |
a7e629 |
! add_num_buff(&readbuf2, count);
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/* copy from the redo buffer into the stuff buffer */
|
|
Karsten Hopp |
a7e629 |
! add_char_buff(&readbuf2, c);
|
|
Karsten Hopp |
a7e629 |
copy_redo(old_redo);
|
|
Karsten Hopp |
a7e629 |
return OK;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
* Repeat the last insert (R, o, O, a, A, i or I command) by stuffing
|
|
Karsten Hopp |
a7e629 |
! * the redo buffer into readbuf2.
|
|
Karsten Hopp |
a7e629 |
* return FAIL for failure, OK otherwise
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
int
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 879,885 ****
|
|
Karsten Hopp |
a7e629 |
if (vim_strchr((char_u *)"AaIiRrOo", c) != NULL)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
if (c == 'O' || c == 'o')
|
|
Karsten Hopp |
a7e629 |
! stuffReadbuff(NL_STR);
|
|
Karsten Hopp |
a7e629 |
break;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
--- 916,922 ----
|
|
Karsten Hopp |
a7e629 |
if (vim_strchr((char_u *)"AaIiRrOo", c) != NULL)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
if (c == 'O' || c == 'o')
|
|
Karsten Hopp |
a7e629 |
! add_buff(&readbuf2, NL_STR, -1L);
|
|
Karsten Hopp |
a7e629 |
break;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 1360,1367 ****
|
|
Karsten Hopp |
a7e629 |
tp->old_mod_mask = old_mod_mask;
|
|
Karsten Hopp |
a7e629 |
old_char = -1;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! tp->save_stuffbuff = stuffbuff;
|
|
Karsten Hopp |
a7e629 |
! stuffbuff.bh_first.b_next = NULL;
|
|
Karsten Hopp |
a7e629 |
# ifdef USE_INPUT_BUF
|
|
Karsten Hopp |
a7e629 |
tp->save_inputbuf = get_input_buf();
|
|
Karsten Hopp |
a7e629 |
# endif
|
|
Karsten Hopp |
a7e629 |
--- 1397,1406 ----
|
|
Karsten Hopp |
a7e629 |
tp->old_mod_mask = old_mod_mask;
|
|
Karsten Hopp |
a7e629 |
old_char = -1;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! tp->save_readbuf1 = readbuf1;
|
|
Karsten Hopp |
a7e629 |
! readbuf1.bh_first.b_next = NULL;
|
|
Karsten Hopp |
a7e629 |
! tp->save_readbuf2 = readbuf2;
|
|
Karsten Hopp |
a7e629 |
! readbuf2.bh_first.b_next = NULL;
|
|
Karsten Hopp |
a7e629 |
# ifdef USE_INPUT_BUF
|
|
Karsten Hopp |
a7e629 |
tp->save_inputbuf = get_input_buf();
|
|
Karsten Hopp |
a7e629 |
# endif
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 1384,1391 ****
|
|
Karsten Hopp |
a7e629 |
old_char = tp->old_char;
|
|
Karsten Hopp |
a7e629 |
old_mod_mask = tp->old_mod_mask;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! free_buff(&stuffbuff);
|
|
Karsten Hopp |
a7e629 |
! stuffbuff = tp->save_stuffbuff;
|
|
Karsten Hopp |
a7e629 |
# ifdef USE_INPUT_BUF
|
|
Karsten Hopp |
a7e629 |
set_input_buf(tp->save_inputbuf);
|
|
Karsten Hopp |
a7e629 |
# endif
|
|
Karsten Hopp |
a7e629 |
--- 1423,1432 ----
|
|
Karsten Hopp |
a7e629 |
old_char = tp->old_char;
|
|
Karsten Hopp |
a7e629 |
old_mod_mask = tp->old_mod_mask;
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
! free_buff(&readbuf1);
|
|
Karsten Hopp |
a7e629 |
! readbuf1 = tp->save_readbuf1;
|
|
Karsten Hopp |
a7e629 |
! free_buff(&readbuf2);
|
|
Karsten Hopp |
a7e629 |
! readbuf2 = tp->save_readbuf2;
|
|
Karsten Hopp |
a7e629 |
# ifdef USE_INPUT_BUF
|
|
Karsten Hopp |
a7e629 |
set_input_buf(tp->save_inputbuf);
|
|
Karsten Hopp |
a7e629 |
# endif
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 1992,1998 ****
|
|
Karsten Hopp |
a7e629 |
typeahead_char = 0;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
else
|
|
Karsten Hopp |
a7e629 |
! c = read_stuff(advance);
|
|
Karsten Hopp |
a7e629 |
if (c != NUL && !got_int)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
if (advance)
|
|
Karsten Hopp |
a7e629 |
--- 2033,2039 ----
|
|
Karsten Hopp |
a7e629 |
typeahead_char = 0;
|
|
Karsten Hopp |
a7e629 |
}
|
|
Karsten Hopp |
a7e629 |
else
|
|
Karsten Hopp |
a7e629 |
! c = read_readbuffers(advance);
|
|
Karsten Hopp |
a7e629 |
if (c != NUL && !got_int)
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
if (advance)
|
|
Karsten Hopp |
a7e629 |
*** ../vim-7.4.170/src/globals.h 2013-11-09 03:31:45.000000000 +0100
|
|
Karsten Hopp |
a7e629 |
--- src/globals.h 2014-02-11 14:17:44.070063200 +0100
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 979,989 ****
|
|
Karsten Hopp |
a7e629 |
EXTERN int readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
|
|
Karsten Hopp |
a7e629 |
EXTERN int recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
- EXTERN struct buffheader stuffbuff /* stuff buffer */
|
|
Karsten Hopp |
a7e629 |
- #ifdef DO_INIT
|
|
Karsten Hopp |
a7e629 |
- = {{NULL, {NUL}}, NULL, 0, 0}
|
|
Karsten Hopp |
a7e629 |
- #endif
|
|
Karsten Hopp |
a7e629 |
- ;
|
|
Karsten Hopp |
a7e629 |
EXTERN typebuf_T typebuf /* typeahead buffer */
|
|
Karsten Hopp |
a7e629 |
#ifdef DO_INIT
|
|
Karsten Hopp |
a7e629 |
= {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}
|
|
Karsten Hopp |
a7e629 |
--- 979,984 ----
|
|
Karsten Hopp |
a7e629 |
*** ../vim-7.4.170/src/normal.c 2014-01-14 13:18:53.000000000 +0100
|
|
Karsten Hopp |
a7e629 |
--- src/normal.c 2014-02-11 14:53:54.246096453 +0100
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 655,662 ****
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
a7e629 |
/* Set v:count here, when called from main() and not a stuffed
|
|
Karsten Hopp |
a7e629 |
* command, so that v:count can be used in an expression mapping
|
|
Karsten Hopp |
a7e629 |
! * when there is no count. */
|
|
Karsten Hopp |
a7e629 |
! if (toplevel && stuff_empty())
|
|
Karsten Hopp |
a7e629 |
set_vcount_ca(&ca, &set_prevcount);
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
--- 655,662 ----
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
a7e629 |
/* Set v:count here, when called from main() and not a stuffed
|
|
Karsten Hopp |
a7e629 |
* command, so that v:count can be used in an expression mapping
|
|
Karsten Hopp |
a7e629 |
! * when there is no count. Do set it for redo. */
|
|
Karsten Hopp |
a7e629 |
! if (toplevel && readbuf1_empty())
|
|
Karsten Hopp |
a7e629 |
set_vcount_ca(&ca, &set_prevcount);
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 736,743 ****
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
a7e629 |
/* Set v:count here, when called from main() and not a stuffed
|
|
Karsten Hopp |
a7e629 |
* command, so that v:count can be used in an expression mapping
|
|
Karsten Hopp |
a7e629 |
! * right after the count. */
|
|
Karsten Hopp |
a7e629 |
! if (toplevel && stuff_empty())
|
|
Karsten Hopp |
a7e629 |
set_vcount_ca(&ca, &set_prevcount);
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
if (ctrl_w)
|
|
Karsten Hopp |
a7e629 |
--- 736,743 ----
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
a7e629 |
/* Set v:count here, when called from main() and not a stuffed
|
|
Karsten Hopp |
a7e629 |
* command, so that v:count can be used in an expression mapping
|
|
Karsten Hopp |
a7e629 |
! * right after the count. Do set it for redo. */
|
|
Karsten Hopp |
a7e629 |
! if (toplevel && readbuf1_empty())
|
|
Karsten Hopp |
a7e629 |
set_vcount_ca(&ca, &set_prevcount);
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
if (ctrl_w)
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 819,826 ****
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
* Only set v:count when called from main() and not a stuffed command.
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
! if (toplevel && stuff_empty())
|
|
Karsten Hopp |
a7e629 |
set_vcount(ca.count0, ca.count1, set_prevcount);
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
--- 819,827 ----
|
|
Karsten Hopp |
a7e629 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
* Only set v:count when called from main() and not a stuffed command.
|
|
Karsten Hopp |
a7e629 |
+ * Do set it for redo.
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
! if (toplevel && readbuf1_empty())
|
|
Karsten Hopp |
a7e629 |
set_vcount(ca.count0, ca.count1, set_prevcount);
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
*** ../vim-7.4.170/src/proto/getchar.pro 2013-08-10 13:37:12.000000000 +0200
|
|
Karsten Hopp |
a7e629 |
--- src/proto/getchar.pro 2014-02-11 14:55:14.806097687 +0100
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 1,8 ****
|
|
Karsten Hopp |
a7e629 |
/* getchar.c */
|
|
Karsten Hopp |
a7e629 |
! void free_buff __ARGS((struct buffheader *buf));
|
|
Karsten Hopp |
a7e629 |
char_u *get_recorded __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
char_u *get_inserted __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
int stuff_empty __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
void typeahead_noflush __ARGS((int c));
|
|
Karsten Hopp |
a7e629 |
void flush_buffers __ARGS((int flush_typeahead));
|
|
Karsten Hopp |
a7e629 |
void ResetRedobuff __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
--- 1,9 ----
|
|
Karsten Hopp |
a7e629 |
/* getchar.c */
|
|
Karsten Hopp |
a7e629 |
! void free_buff __ARGS((buffheader_T *buf));
|
|
Karsten Hopp |
a7e629 |
char_u *get_recorded __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
char_u *get_inserted __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
int stuff_empty __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
+ int readbuf1_empty __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
void typeahead_noflush __ARGS((int c));
|
|
Karsten Hopp |
a7e629 |
void flush_buffers __ARGS((int flush_typeahead));
|
|
Karsten Hopp |
a7e629 |
void ResetRedobuff __ARGS((void));
|
|
Karsten Hopp |
a7e629 |
*** ../vim-7.4.170/src/structs.h 2013-11-12 04:43:57.000000000 +0100
|
|
Karsten Hopp |
a7e629 |
--- src/structs.h 2014-02-11 14:35:43.606079741 +0100
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 471,483 ****
|
|
Karsten Hopp |
a7e629 |
blocknr_T nt_new_bnum; /* new, positive, number */
|
|
Karsten Hopp |
a7e629 |
};
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
* structure used to store one block of the stuff/redo/recording buffers
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
struct buffblock
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! struct buffblock *b_next; /* pointer to next buffblock */
|
|
Karsten Hopp |
a7e629 |
! char_u b_str[1]; /* contents (actually longer) */
|
|
Karsten Hopp |
a7e629 |
};
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
--- 471,487 ----
|
|
Karsten Hopp |
a7e629 |
blocknr_T nt_new_bnum; /* new, positive, number */
|
|
Karsten Hopp |
a7e629 |
};
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
+
|
|
Karsten Hopp |
a7e629 |
+ typedef struct buffblock buffblock_T;
|
|
Karsten Hopp |
a7e629 |
+ typedef struct buffheader buffheader_T;
|
|
Karsten Hopp |
a7e629 |
+
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
* structure used to store one block of the stuff/redo/recording buffers
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
struct buffblock
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! buffblock_T *b_next; /* pointer to next buffblock */
|
|
Karsten Hopp |
a7e629 |
! char_u b_str[1]; /* contents (actually longer) */
|
|
Karsten Hopp |
a7e629 |
};
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 485,494 ****
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
struct buffheader
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! struct buffblock bh_first; /* first (dummy) block of list */
|
|
Karsten Hopp |
a7e629 |
! struct buffblock *bh_curr; /* buffblock for appending */
|
|
Karsten Hopp |
a7e629 |
! int bh_index; /* index for reading */
|
|
Karsten Hopp |
a7e629 |
! int bh_space; /* space in bh_curr for appending */
|
|
Karsten Hopp |
a7e629 |
};
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
--- 489,498 ----
|
|
Karsten Hopp |
a7e629 |
*/
|
|
Karsten Hopp |
a7e629 |
struct buffheader
|
|
Karsten Hopp |
a7e629 |
{
|
|
Karsten Hopp |
a7e629 |
! buffblock_T bh_first; /* first (dummy) block of list */
|
|
Karsten Hopp |
a7e629 |
! buffblock_T *bh_curr; /* buffblock for appending */
|
|
Karsten Hopp |
a7e629 |
! int bh_index; /* index for reading */
|
|
Karsten Hopp |
a7e629 |
! int bh_space; /* space in bh_curr for appending */
|
|
Karsten Hopp |
a7e629 |
};
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/*
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 964,970 ****
|
|
Karsten Hopp |
a7e629 |
int typebuf_valid; /* TRUE when save_typebuf valid */
|
|
Karsten Hopp |
a7e629 |
int old_char;
|
|
Karsten Hopp |
a7e629 |
int old_mod_mask;
|
|
Karsten Hopp |
a7e629 |
! struct buffheader save_stuffbuff;
|
|
Karsten Hopp |
a7e629 |
#ifdef USE_INPUT_BUF
|
|
Karsten Hopp |
a7e629 |
char_u *save_inputbuf;
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
--- 968,975 ----
|
|
Karsten Hopp |
a7e629 |
int typebuf_valid; /* TRUE when save_typebuf valid */
|
|
Karsten Hopp |
a7e629 |
int old_char;
|
|
Karsten Hopp |
a7e629 |
int old_mod_mask;
|
|
Karsten Hopp |
a7e629 |
! buffheader_T save_readbuf1;
|
|
Karsten Hopp |
a7e629 |
! buffheader_T save_readbuf2;
|
|
Karsten Hopp |
a7e629 |
#ifdef USE_INPUT_BUF
|
|
Karsten Hopp |
a7e629 |
char_u *save_inputbuf;
|
|
Karsten Hopp |
a7e629 |
#endif
|
|
Karsten Hopp |
a7e629 |
*** ../vim-7.4.170/src/version.c 2014-02-11 12:15:39.781950970 +0100
|
|
Karsten Hopp |
a7e629 |
--- src/version.c 2014-02-11 15:05:17.306106920 +0100
|
|
Karsten Hopp |
a7e629 |
***************
|
|
Karsten Hopp |
a7e629 |
*** 740,741 ****
|
|
Karsten Hopp |
a7e629 |
--- 740,743 ----
|
|
Karsten Hopp |
a7e629 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
a7e629 |
+ /**/
|
|
Karsten Hopp |
a7e629 |
+ 171,
|
|
Karsten Hopp |
a7e629 |
/**/
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
--
|
|
Karsten Hopp |
a7e629 |
Linux is just like a wigwam: no Windows, no Gates and an Apache inside.
|
|
Karsten Hopp |
a7e629 |
|
|
Karsten Hopp |
a7e629 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
a7e629 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
a7e629 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
a7e629 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|