]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0749: filetype: http files not recognized v9.1.0749
authorRiley Bruins <ribru17@hotmail.com>
Mon, 30 Sep 2024 17:34:04 +0000 (19:34 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 30 Sep 2024 17:34:04 +0000 (19:34 +0200)
Problem:  filetype: http files not recognized
Solution: detect '*.http' as http filetype, include
          http filetype plugin (Riley Bruins)

Based on the specification found
[here](https://github.com/JetBrains/http-request-in-editor-spec/blob/master/spec.md)

closes: #15762

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/MAINTAINERS
runtime/filetype.vim
runtime/ftplugin/http.vim [new file with mode: 0644]
src/testdir/test_filetype.vim
src/version.c

index bfce67884206eb56cce04322a7d5c32ce89e1a34..7adc59040419c91486ba39fa6b24870ff1126dd1 100644 (file)
@@ -178,6 +178,7 @@ runtime/ftplugin/hgcommit.vim               @k-takata
 runtime/ftplugin/hlsplaylist.vim               @avidseeker
 runtime/ftplugin/hog.vim               @wtfbbqhax
 runtime/ftplugin/html.vim              @dkearns
+runtime/ftplugin/http.vim              @ribru17
 runtime/ftplugin/hyprlang.vim          @ribru17
 runtime/ftplugin/i3config.vim          @hiqua
 runtime/ftplugin/icon.vim              @dkearns
index 1667d21799cdc8bf004f78fe494aa4fcbf89af04..7f396252167d478524136310a66b2f88b1599aec 100644 (file)
@@ -1065,6 +1065,9 @@ au BufNewFile,BufRead init.trans,*/etc/translate-shell,.trans     setf clojure
 au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm  call dist#ft#FThtml()
 au BufNewFile,BufRead *.cshtml                 setf html
 
+" HTTP request files
+au BufNewFile,BufRead *.http                   setf http
+
 " HTML with Ruby - eRuby
 au BufNewFile,BufRead *.erb,*.rhtml            setf eruby
 
diff --git a/runtime/ftplugin/http.vim b/runtime/ftplugin/http.vim
new file mode 100644 (file)
index 0000000..ca50550
--- /dev/null
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language:    HTTP
+" Maintainer:  Riley Bruins <ribru17@gmail.com>
+" Last Change: 2024 Sep 28
+
+if exists('b:did_ftplugin')
+  finish
+endif
+let b:did_ftplugin = 1
+
+setl comments=:# commentstring=#\ %s
+
+let b:undo_ftplugin = 'setl com< cms<'
index 61272ec92456cbed998785746673dd3efe239514..a780002ba41f92de688e0138a2569b06422daf22 100644 (file)
@@ -340,6 +340,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     hostsaccess: ['/etc/hosts.allow', '/etc/hosts.deny', 'any/etc/hosts.allow', 'any/etc/hosts.deny'],
     # file.component.html should be HTML, not Angular, see #13594
     html: ['file.html', 'file.htm', 'file.cshtml', 'file.component.html'],
+    http: ['file.http'],
     htmlm4: ['file.html.m4'],
     httest: ['file.htt', 'file.htb'],
     hurl: ['file.hurl'],
index fd67af63802ca4234046b0b215de71b8d0e84f5e..d1361508ea48a2180b83ffcc5bc4e41d8bef7add 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    749,
 /**/
     748,
 /**/