patch 9.1.0749: filetype: http files not recognized
Commit:
https://github.com/vim/vim/commit/de6c1d1182076b10212342fd2d441267fbe43a22
Author: Riley Bruins <[email protected]>
Date: Mon Sep 30 19:34:04 2024 +0200
patch 9.1.0749: filetype: http files not recognized
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS
index bfce67884..7adc59040 100644
--- a/.github/MAINTAINERS
+++ b/.github/MAINTAINERS
@@ -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
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 1667d2179..7f3962521 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -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
index 000000000..ca5055011
--- /dev/null
+++ b/runtime/ftplugin/http.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: HTTP
+" Maintainer: Riley Bruins <[email protected]>
+" 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<'
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 61272ec92..a780002ba 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -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'],
diff --git a/src/version.c b/src/version.c
index fd67af638..d1361508e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 749,
/**/
748,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1svKSR-002TdS-Pt%40256bit.org.