]> git.pld-linux.org Git - packages/vim.git/blob - vim-autopaste.patch
- rel 2; typo fixed
[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/option.c~ 2009-05-18 22:23:40.000000000 +0300
43 +++ vim72/src/option.c  2009-05-18 22:30:25.277259155 +0300
44 @@ -535,6 +535,9 @@
45      {"autoindent",  "ai",   P_BOOL|P_VI_DEF,
46                             (char_u *)&p_ai, PV_AI,
47                             {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
48 +    {"autopaste",   "apa",  P_BOOL|P_VI_DEF,
49 +                            (char_u *)&p_apa, PV_NONE,
50 +                            {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
51      {"autoprint",   "ap",   P_BOOL|P_VI_DEF,
52                             (char_u *)NULL, PV_NONE,
53                             {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
54 diff -cr vim70.orig/src/option.h vim70/src/option.h
55 *** vim70.orig/src/option.h     2006-09-12 21:47:30.000000000 -0400
56 --- vim70/src/option.h  2006-09-12 21:54:23.000000000 -0400
57 ***************
58 *** 312,317 ****
59 --- 312,318 ----
60   #if defined(FEAT_GUI) && defined(MACOS_X)
61   EXTERN int    *p_antialias;   /* 'antialias' */
62   #endif
63 + EXTERN int      p_apa;          /* 'autopaste' */
64   EXTERN int    p_ar;           /* 'autoread' */
65   EXTERN int    p_aw;           /* 'autowrite' */
66   EXTERN int    p_awa;          /* 'autowriteall' */
This page took 0.032715 seconds and 3 git commands to generate.