From b24bf5235b902a703ab77c9d4b47e11e173482b4 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 17 Apr 2013 14:02:07 +0400 Subject: Debian's tiny patch --- vim/patches/vim-tiny.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 vim/patches/vim-tiny.patch diff --git a/vim/patches/vim-tiny.patch b/vim/patches/vim-tiny.patch new file mode 100644 index 0000000..2892598 --- /dev/null +++ b/vim/patches/vim-tiny.patch @@ -0,0 +1,59 @@ +Subject: Support sourcing a vimrc.tiny when Vim is invoked as vi + This is used only in the vim-tiny package to allow a specific + configuration for vim-tiny's vi. The vim-tiny package is substantially + different from the other Vim packages, so it did not make sense to + share the same config. +Forwarded: not-needed +Author: Stefano Zacchiroli +Author: James Vega +Bug-Debian: http://bugs.debian.org/222138 + +--- a/src/main.c ++++ b/src/main.c +@@ -83,6 +83,9 @@ + #ifdef FEAT_DIFF + int diff_mode; /* start with 'diff' set */ + #endif ++#ifdef SYS_TINYRC_FILE ++ int vi_mode; /* started as "vi" */ ++#endif + } mparm_T; + + /* Values for edit_type. */ +@@ -1606,6 +1609,10 @@ + } + else if (STRNICMP(initstr, "vim", 3) == 0) + initstr += 3; ++#ifdef SYS_TINYRC_FILE ++ else if (STRNICMP(initstr, "vi", 2) == 0) ++ parmp->vi_mode = TRUE; ++#endif + + /* Catch "[r][g]vimdiff" and "[r][g]viewdiff". */ + if (STRICMP(initstr, "diff") == 0) +@@ -2916,7 +2923,12 @@ + * Get system wide defaults, if the file name is defined. + */ + #ifdef SYS_VIMRC_FILE +- (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE); ++# if defined(SYS_TINYRC_FILE) && defined(TINY_VIMRC) ++ if (parmp->vi_mode) ++ (void)do_source((char_u *)SYS_TINYRC_FILE, FALSE, DOSO_NONE); ++ else ++# endif ++ (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE); + #endif + #ifdef MACOS_X + (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, DOSO_NONE); +--- a/src/os_unix.h ++++ b/src/os_unix.h +@@ -233,6 +233,9 @@ + /* + * Unix system-dependent file names + */ ++#ifndef SYS_TINYRC_FILE ++# define SYS_TINYRC_FILE "$VIM/vimrc.tiny" ++#endif + #ifndef SYS_VIMRC_FILE + # define SYS_VIMRC_FILE "$VIM/vimrc" + #endif -- cgit v1.2.3