patch 9.1.0396: filetype: jj files are not recognized Commit: https://github.com/vim/vim/commit/6a4ea471d28107c4078e106ace1bdc0c54bf946b Author: Gregory Anders <g...@gpanders.com> Date: Wed May 8 20:17:43 2024 +0200
patch 9.1.0396: filetype: jj files are not recognized Problem: jj files are not recognized Solution: recognize '*.jjdescription' files as jj filetype (Gregory Anders) See: https://github.com/martinvonz/jj closes: #14733 Signed-off-by: Gregory Anders <g...@gpanders.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index ac41ed567..36b352ffb 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -161,6 +161,7 @@ runtime/ftplugin/j.vim @glts runtime/ftplugin/java.vim @zzzyxwvut runtime/ftplugin/javascript.vim @dkearns runtime/ftplugin/javascriptreact.vim @dkearns +runtime/ftplugin/jj.vim @gpanders runtime/ftplugin/json.vim @dbarnett runtime/ftplugin/json5.vim @dkearns runtime/ftplugin/jsonc.vim @izhakjakov @@ -406,6 +407,7 @@ runtime/syntax/j.vim @glts runtime/syntax/jargon.vim @h3xx runtime/syntax/java.vim @zzzyxwvut runtime/syntax/javascript.vim @fleiner +runtime/syntax/jj.vim @gpanders runtime/syntax/json.vim @vito-c runtime/syntax/jsonc.vim @izhakjakov runtime/syntax/julia.vim @carlobaldassi diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 927230d4f..f45866cb8 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1148,6 +1148,9 @@ au BufNewFile,BufRead *.clp setf jess " Jgraph au BufNewFile,BufRead *.jgr setf jgraph +" Jujutsu +au BufNewFile,BufRead *.jjdescription setf jj + " Jovial au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial diff --git a/runtime/ftplugin/jj.vim b/runtime/ftplugin/jj.vim new file mode 100644 index 000000000..cc5d700a3 --- /dev/null +++ b/runtime/ftplugin/jj.vim @@ -0,0 +1,19 @@ +" Vim filetype plugin +" Language: jj description +" Maintainer: Gregory Anders <g...@gpanders.com> +" Last Change: 2024 May 8 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +" Use the same formatoptions and textwidth as the gitcommit ftplugin +setlocal nomodeline formatoptions+=tl textwidth=72 +setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n +setlocal formatlistpat=^\s*\d\+[\]:.)}]\s\+\\|^\s*[-*+]\s\+ + +setlocal comments=b:JJ: +setlocal commentstring=JJ:\ %s + +let b:undo_ftplugin = 'setl modeline< formatoptions< textwidth< formatlistpat< comments< commentstring<' diff --git a/runtime/syntax/jj.vim b/runtime/syntax/jj.vim new file mode 100644 index 000000000..a2911a026 --- /dev/null +++ b/runtime/syntax/jj.vim @@ -0,0 +1,20 @@ +" Vim syntax file +" Language: jj description +" Maintainer: Gregory Anders <g...@gpanders.com> +" Last Change: 2024 May 8 + +if exists('b:current_syntax') + finish +endif +let b:current_syntax = 'jj' + +syn match jjAdded "A .*" contained +syn match jjRemoved "D .*" contained +syn match jjChanged "M .*" contained + +syn region jjComment start="^JJ: " end="$" contains=jjAdded,jjRemoved,jjChanged + +hi def link jjComment Comment +hi def link jjAdded Added +hi def link jjRemoved Removed +hi def link jjChanged Changed diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 4a2a25e7c..c98bb56df 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -359,6 +359,7 @@ def s:GetFilenameChecks(): dict<list<string>> javascriptreact: ['file.jsx'], jess: ['file.clp'], jgraph: ['file.jgr'], + jj: ['file.jjdescription'], jq: ['file.jq'], jovial: ['file.jov', 'file.j73', 'file.jovial'], jproperties: ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'], diff --git a/src/version.c b/src/version.c index 0e6ac314e..8dd6d18c0 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 */ +/**/ + 396, /**/ 395, /**/ -- -- 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 vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1s4m3I-006Xkw-Af%40256bit.org.