{"thread":{"id":"42859","subject":"[StGit PATCH] contrib/vim: Fix filetype detection in VIM >=7.4","startedAt":"2016-07-15T18:58:39Z","lastAt":"2016-08-16T08:53:05Z","messageCount":2,"participants":["Zane Bitter","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"291560","messageId":"146860882262.30566.9308142555262174975.stgit@zbitter","threadId":"42859","inReplyTo":null,"subject":"[StGit PATCH] contrib/vim: Fix filetype detection in VIM >=7.4","fromName":"Zane Bitter","fromEmail":"zbitter@redhat.com","sentAt":"2016-07-15T18:58:31Z","receivedAt":"2016-07-15T18:58:39Z","isPatch":true,"sender":{"key":"zbitter@redhat.com","avatar":"https://gravatar.com/avatar/82937236ef892b1a9a2604edaf6c427f8329111bbeecea763a5bf8f5273e63d9?d=mp&s=160"},"body":"The command \"setfiletype\" will not override an existing filetype. This was\nnever a problem for me previously, but since upgrading from VIM 7.3 to 7.4\nthe filetype for StGit's files is explicitly set to \"text\", preventing the\nstgit ftdetect plugin overriding it. Use \"setlocal filetype=\" instead to\nensure that we override any previously detected filetype.\n\nSigned-off-by: Zane Bitter <zbitter@redhat.com>\n---\n contrib/vim/ftdetect/stg.vim |   11 +++++------\n 1 file changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/contrib/vim/ftdetect/stg.vim b/contrib/vim/ftdetect/stg.vim\nindex abd4d9f..adf46dd 100644\n--- a/contrib/vim/ftdetect/stg.vim\n+++ b/contrib/vim/ftdetect/stg.vim\n@@ -6,23 +6,22 @@\n if has(\"autocmd\")\n \n   \" Detect 'stg new' files\n-  autocmd BufNewFile,BufRead .stgit-new.txt       setf     stgnew\n-  autocmd BufNewFile,BufRead .stgitmsg.txt        setf     stgnew\n+  autocmd BufNewFile,BufRead .stgit-new.txt       setlocal filetype=stgnew\n+  autocmd BufNewFile,BufRead .stgitmsg.txt        setlocal filetype=stgnew\n   \" Ignore the modeline so we get type 'stgnew' instead of 'diff'\n   autocmd BufNewFile,BufRead .stgitmsg.txt        setlocal nomodeline\n \n   \" Detect 'stg edit' files\n-  autocmd BufNewFile,BufRead .stgit-edit.txt      setf     stgedit\n-  \" Use set filetype instead of setfiletype to override detection as patch\n+  autocmd BufNewFile,BufRead .stgit-edit.txt      setlocal filetype=stgedit\n   autocmd BufNewFile,BufRead .stgit-edit.patch    setlocal filetype=stgedit\n   autocmd BufNewFile,BufRead .stgit-edit.diff     setlocal filetype=stgedit\n   autocmd BufNewFile,BufRead .stgit-failed.patch  setlocal filetype=stgedit\n \n   \" Detect 'stg squash' files\n-  autocmd BufNewFile,BufRead .stgit-squash.txt    setf     stgsquash\n+  autocmd BufNewFile,BufRead .stgit-squash.txt    setlocal filetype=stgsquash\n \n   \" Detect 'stg mail' files\n-  autocmd BufNewFile,BufRead .stgitmail.txt       setf     stgmail\n+  autocmd BufNewFile,BufRead .stgitmail.txt       setlocal filetype=stgmail\n \n \n   \" A modeline in a diff belongs to the diffed file, so ignore it\n\n"},{"id":"299441","messageId":"CAHkRjk6U0a+UsBBKTiQTCqxY61aZaJB6jqR4fEpcaGoVFcn1VA@mail.gmail.com","threadId":"42859","inReplyTo":"146860882262.30566.9308142555262174975.stgit@zbitter","subject":"Re: [StGit PATCH] contrib/vim: Fix filetype detection in VIM >=7.4","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2016-08-16T08:52:31Z","receivedAt":"2016-08-16T08:53:05Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 15 July 2016 at 19:58, Zane Bitter <zbitter@redhat.com> wrote:\n> The command \"setfiletype\" will not override an existing filetype. This was\n> never a problem for me previously, but since upgrading from VIM 7.3 to 7.4\n> the filetype for StGit's files is explicitly set to \"text\", preventing the\n> stgit ftdetect plugin overriding it. Use \"setlocal filetype=\" instead to\n> ensure that we override any previously detected filetype.\n\nApplied. Thanks.\n\nCatalin\n"}]}