summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch
blob: f535de8d9d15c7ec0f5061dc027851fedbf2fce9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: James Vega <jamessan@debian.org>
Date: Fri, 18 Aug 2006 09:06:20 -0400
Subject: Detect the rst filetype using the contents of the file

Closes: #382541
---
 runtime/autoload/dist/script.vim | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim
index f86c428..a1162b1 100644
--- a/runtime/autoload/dist/script.vim
+++ b/runtime/autoload/dist/script.vim
@@ -380,6 +380,14 @@ def DetectFromText(line1: string)
   elseif line1 =~ 'exec\s\+\S*scheme' || line2 =~ 'exec\s\+\S*scheme'
     set ft=scheme
 
+    # rst files
+  elseif line1 =~ '^\.\.\s\|^\s*restindex\s*$'
+	|| line2 =~ '^\.\.\s\|^\s*restindex\s*$'
+	|| line3 =~ '^\.\.\s\|^\s*restindex\s*$'
+	|| line4 =~ '^\.\.\s\|^\s*restindex\s*$'
+	|| line5 =~ '^\.\.\s\|^\s*restindex\s*$'
+    set ft=rst
+
     # Git output
   elseif line1 =~ '^\(commit\|tree\|object\) \x\{40,\}\>\|^tag \S\+$'
     set ft=git