]> git.pld-linux.org Git - packages/vim.git/blob - vim-autopaste.patch
- up to 8.2.0110
[packages/vim.git] / vim-autopaste.patch
1 diff -cr vim70.orig/src/getchar.c vim70/src/getchar.c
2 *** vim70.orig/src/getchar.c    2006-09-12 21:47:30.000000000 -0400
3 --- vim70/src/getchar.c 2006-09-12 21:53:35.000000000 -0400
4 ***************
5 *** 1495,1500 ****
6 --- 1495,1507 ----
7       int
8   vgetc()
9   {
10 +     static time_t last_call = 0;
11 +     static int cps = 0;
12 +     char_u sPaste[] = "paste";
13 +     time_t now;
14 +     if (p_apa)
15 +       now = time(NULL);
16
17       int               c, c2;
18   #ifdef FEAT_MBYTE
19       int               n;
20 ***************
21 *** 1502,1507 ****
22 --- 1509,1527 ----
23       int               i;
24   #endif
25   
26 +     if (p_apa && !p_paste) {
27 +       if (last_call == now)
28 +         ++cps;
29 +       else
30 +         cps = 0;
31 +       if (cps >= 30) {
32 +         cps = 0;
33 +       do_set(&sPaste, 0);
34 +       showmode();
35 +       }
36 +       last_call = now;
37 +     }
38
39       /*
40        * If a character was put back with vungetc, it was already processed.
41        * Return it directly.
42 --- vim72/src/optiondefs.h~     2009-05-18 22:23:40.000000000 +0300
43 +++ vim72/src/optiondefs.h      2009-05-18 22:30:25.277259155 +0300
44 @@ -377,6 +377,9 @@
45      {"autoindent",  "ai",   P_BOOL|P_VI_DEF,
46                             (char_u *)&p_ai, PV_AI,
47                             {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
48 +    {"autopaste",   "apa",  P_BOOL|P_VI_DEF,
49 +                            (char_u *)&p_apa, PV_NONE,
50 +                            {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
51      {"autoprint",   "ap",   P_BOOL|P_VI_DEF,
52                             (char_u *)NULL, PV_NONE,
53                             {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
54 --- vim72/src/option.h~ 2009-05-18 22:23:40.000000000 +0300
55 +++ vim72/src/option.h  2009-05-18 22:30:25.277259155 +0300
56 @@ -312,6 +312,7 @@
57  #if defined(FEAT_GUI) && defined(MACOS_X)
58  EXTERN int     *p_antialias;   // 'antialias'
59  #endif
60 +EXTERN int      p_apa;          /* 'autopaste' */
61  EXTERN int     p_ar;           // 'autoread'
62  EXTERN int     p_aw;           // 'autowrite'
63  EXTERN int     p_awa;          // 'autowriteall'
This page took 0.40477 seconds and 3 git commands to generate.