aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-12-25 11:44:46 +0100
committerChristian Clason <ch.clason+github@icloud.com>2024-12-25 13:38:45 +0100
commit7567f7d3226ab247eb2b743460492c1101045b0e (patch)
treef4ad2fef942f0c3c21a0d162d22ba1a43ae8d700
parent01e1598072249011ac2cec7318559cea6179e509 (diff)
downloadrneovim-7567f7d3226ab247eb2b743460492c1101045b0e.tar.gz
rneovim-7567f7d3226ab247eb2b743460492c1101045b0e.tar.bz2
rneovim-7567f7d3226ab247eb2b743460492c1101045b0e.zip
vim-patch:9.1.0961: filetype: TI gel files are not recognized
Problem: filetype: TI gel files are not recognized Solution: detect '*.gel' files as gel filetype, include get filetype and syntax plugins (Wu, Zhenyu) References: https://downloads.ti.com/ccs/esd/documents/users_guide/ccs_debug-gel.html closes: vim/vim#16226 https://github.com/vim/vim/commit/9360de9027aa286e802363ede59c9e97025ae123 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
-rw-r--r--runtime/ftplugin/gel.vim13
-rw-r--r--runtime/lua/vim/filetype.lua1
-rw-r--r--runtime/syntax/gel.vim19
-rw-r--r--test/old/testdir/test_filetype.vim1
4 files changed, 34 insertions, 0 deletions
diff --git a/runtime/ftplugin/gel.vim b/runtime/ftplugin/gel.vim
new file mode 100644
index 0000000000..b1f4def2b8
--- /dev/null
+++ b/runtime/ftplugin/gel.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin file
+" Language: TI Code Composer Studio General Extension Language
+" Document: https://downloads.ti.com/ccs/esd/documents/users_guide/ccs_debug-gel.html
+" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
+" Last Change: 2024 Dec 25
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
+setlocal commentstring=/*\ %s\ */
+
+let b:undo_ftplugin = "setl commentstring< comments<"
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 2b5a201c0f..ad74a16e09 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -504,6 +504,7 @@ local extension = {
gdshader = 'gdshader',
shader = 'gdshader',
ged = 'gedcom',
+ gel = 'gel',
gmi = 'gemtext',
gemini = 'gemtext',
gift = 'gift',
diff --git a/runtime/syntax/gel.vim b/runtime/syntax/gel.vim
new file mode 100644
index 0000000000..5f3800273c
--- /dev/null
+++ b/runtime/syntax/gel.vim
@@ -0,0 +1,19 @@
+" Vim syntax file
+" Language: TI Code Composer Studio General Extension Language
+" Document: https://downloads.ti.com/ccs/esd/documents/users_guide/ccs_debug-gel.html
+" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
+" Last Change: 2024 Dec 25
+
+if exists("b:current_syntax")
+ finish
+endif
+
+runtime! syntax/cpp.vim
+
+syn keyword gelStatement StartUp GEL_AddInputFile GEL_AddOutputFile GEL_AdvancedReset GEL_AsmStepInto GEL_AsmStepOver GEL_BreakPtAdd GEL_BreakPtDel GEL_BreakPtDisable GEL_BreakPtReset GEL_CancelTimer GEL_Connect GEL_Dialog GEL_DisableFileOutput GEL_DisableRealtime GEL_Disconnect GEL_EnableClock GEL_EnableFileOutput GEL_EnableRealtime GEL_EnableZeroFill GEL_EvalOnTarget GEL_GetBoolDebugProperty GEL_GetBoolDriverProperty GEL_GetBoolTargetDbProperty GEL_GetNumericDebugProperty GEL_GetNumericDriverProperty GEL_GetNumericTargetDbProperty GEL_GetStringDebugProperty GEL_GetStringDriverProperty GEL_GetStringTargetDbProperty GEL_Go GEL_Halt GEL_HandleTargetError GEL_HWBreakPtAdd GEL_HWBreakPtDel GEL_HWBreakPtDisable GEL_HWBreakPtReset GEL_IsConnected GEL_IsHalted GEL_IsInRealtimeMode GEL_IsResetSupported GEL_IsTimerSet GEL_Load GEL_LoadBin GEL_LoadGel GEL_LoadProgramOnly GEL_MapAdd GEL_MapAddStr GEL_MapDelete GEL_MapOff GEL_MapOn GEL_MapReset GEL_MatchesConnection GEL_MemoryFill GEL_MemoryListSupportedTypes GEL_MemoryLoad GEL_MemoryLoadData GEL_MemorySave GEL_MemorySaveBin GEL_MemorySaveCoff GEL_MemorySaveData GEL_MemorySaveHex GEL_PatchAssembly GEL_ProbePtAdd GEL_ProbePtDel GEL_ProbePtDisable GEL_ProbePtReset GEL_ReConnect GEL_RefreshWindows GEL_Reload GEL_RemoveDebugState GEL_RemoveInputFile GEL_RemoveOutputFile GEL_Reset GEL_Restart GEL_RestoreDebugState GEL_Run GEL_RunF GEL_SetBlockResetMode GEL_SetBoolDebugProperty GEL_SetClockEvent GEL_SetNumericDebugProperty GEL_SetSemihostingMainArgs GEL_SetStringDebugProperty GEL_SetTimer GEL_SetWaitInResetMode GEL_SrcStepInto GEL_SrcStepOver GEL_StepInto GEL_StepOut GEL_StepOver GEL_StrCat GEL_StrLen GEL_SubStr GEL_SymbolAdd GEL_SymbolAddOffset GEL_SymbolAddRel GEL_SymbolDisable GEL_SymbolEnable GEL_SymbolHideSection GEL_SymbolLoad GEL_SymbolLoadOffset GEL_SymbolLoadRel GEL_SymbolRemove GEL_SymbolShowSection GEL_SyncHalt GEL_SyncRun GEL_SyncStepInto GEL_SyncStepOut GEL_SyncStepOver GEL_System GEL_TargetTextOut GEL_TextOut GEL_Trace GEL_UnloadAllGels GEL_UnloadAllSymbols GEL_UnloadGel GEL_VerifyBinProgram GEL_VerifyProgram OnChildRunning OnFileLoaded OnHalt OnPreFileLoaded OnPreReset OnPreTargetConnect OnReset OnResetDetected OnRestart OnTargetConnect
+syn keyword gelModifier hotmenu menuitem
+
+hi def link gelStatement Statement
+hi def link gelModifier Type
+
+let b:current_syntax = "gel"
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index e30e464fd7..f556d551dd 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -298,6 +298,7 @@ func s:GetFilenameChecks() abort
\ 'gdscript': ['file.gd'],
\ 'gdshader': ['file.gdshader', 'file.shader'],
\ 'gedcom': ['file.ged', 'lltxxxxx.txt', '/tmp/lltmp', '/tmp/lltmp-file', 'any/tmp/lltmp', 'any/tmp/lltmp-file'],
+ \ 'gel': ['file.gel'],
\ 'gemtext': ['file.gmi', 'file.gemini'],
\ 'gift': ['file.gift'],
\ 'gitattributes': ['file.git/info/attributes', '.gitattributes', '/.config/git/attributes', '/etc/gitattributes', '/usr/local/etc/gitattributes', 'some.git/info/attributes'] + s:WhenConfigHome('$XDG_CONFIG_HOME/git/attributes'),