annotate runtime/ftplugin/odin.vim @ 34511:5397ce113043 v9.1.0161

patch 9.1.0161: expand() removes slash after env variable that ends with colon Commit: https://github.com/vim/vim/commit/13a014452a7a020a119ac555a690c65b41f3126d Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Mar 9 17:44:46 2024 +0100 patch 9.1.0161: expand() removes slash after env variable that ends with colon Problem: expand() removes a slash after an environment variable that ends with a colon on Windows. Solution: Check the correct char for a colon (zeertzjq) closes: #14161 Note: Vim still removes the path-separator at the end, if another path separator follows directly after it, e.g. on: ``` echo $FOO='/usr/' echo expand('$FOO/bar') == '/usr/bar' ``` see: ,----[ misc1.c:1630 ] | // if var[] ends in a path separator and tail[] starts | // with it, skip a character | if (after_pathsep(dst, dst + c) | #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) | && (dst == save_dst || dst[-1] != ':') | #endif | && vim_ispathsep(*tail)) | ++tail; `---- Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 09 Mar 2024 18:15:02 +0100
parents c2a3b642d4cb
children 7c7432a53a6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34150
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 vim9script
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 # Vim filetype plugin file
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 # Language: Odin
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 # Maintainer: Maxim Kim <habamax@gmail.com>
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 # Website: https://github.com/habamax/vim-odin
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 # Last Change: 2024-01-15
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 if exists("b:did_ftplugin")
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 finish
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 endif
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 b:did_ftplugin = 1
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 b:undo_ftplugin = 'setlocal commentstring<'
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ .. '| setlocal comments<'
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 \ .. '| setlocal suffixesadd<'
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 setlocal suffixesadd=.odin
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 setlocal commentstring=//%s
c2a3b642d4cb runtime(odin): include ftplugin, syntax and indent script (#13867)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 setlocal comments=s1:/*,mb:*,ex:*/,://