Patch 8.2.3358
Problem:    Structurizr files are not recognized.
Solution:   Recognize the file by contents. (Bastian Venthur, closes #8764)
Files:      runtime/filetype.vim, src/testdir/test_filetype.vim


*** ../vim-8.2.3357/runtime/filetype.vim        2021-08-04 20:00:24.413671050 
+0200
--- runtime/filetype.vim        2021-08-17 23:44:13.371238905 +0200
***************
*** 537,544 ****
  " Datascript
  au BufNewFile,BufRead *.ds                    setf datascript
  
! " dsl
! au BufNewFile,BufRead *.dsl                   setf dsl
  
  " DTD (Document Type Definition for XML)
  au BufNewFile,BufRead *.dtd                   setf dtd
--- 537,549 ----
  " Datascript
  au BufNewFile,BufRead *.ds                    setf datascript
  
! " dsl: DSSSL or Structurizr
! au BufNewFile,BufRead *.dsl
!       \ if getline(1) =~ '^\s*<\!' |
!       \   setf dsl |
!       \ else |
!       \   setf structurizr |
!       \ endif
  
  " DTD (Document Type Definition for XML)
  au BufNewFile,BufRead *.dtd                   setf dtd
*** ../vim-8.2.3357/src/testdir/test_filetype.vim       2021-08-04 
20:00:24.413671050 +0200
--- src/testdir/test_filetype.vim       2021-08-17 23:42:10.051534256 +0200
***************
*** 151,157 ****
      \ 'dosini': ['.editorconfig', '/etc/pacman.conf', '/etc/yum.conf', 
'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', 
'/etc/yum.repos.d/file', 'any/etc/pacman.conf', 'any/etc/yum.conf', 
'any/etc/yum.repos.d/file', 'file.wrap'],
      \ 'dot': ['file.dot', 'file.gv'],
      \ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 
'lpe', 'lvs', 'some-lpe', 'some-lvs'],
-     \ 'dsl': ['file.dsl'],
      \ 'dtd': ['file.dtd'],
      \ 'dts': ['file.dts', 'file.dtsi'],
      \ 'dune': ['jbuild', 'dune', 'dune-project', 'dune-workspace'],
--- 151,156 ----
***************
*** 834,837 ****
--- 833,853 ----
    filetype off
  endfunc
  
+ func Test_dsl_file()
+   filetype on
+ 
+   call writefile(['  <!doctype dsssl-spec ['], 'dslfile.dsl')
+   split dslfile.dsl
+   call assert_equal('dsl', &filetype)
+   bwipe!
+ 
+   call writefile(['workspace {'], 'dslfile.dsl')
+   split dslfile.dsl
+   call assert_equal('structurizr', &filetype)
+   bwipe!
+ 
+   call delete('dslfile.dsl')
+   filetype off
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.3357/src/version.c       2021-08-17 22:14:25.621495451 +0200
--- src/version.c       2021-08-17 23:41:26.679638738 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3358,
  /**/

-- 
It is illegal for anyone to give lighted cigars to dogs, cats, and other
domesticated animal kept as pets.
                [real standing law in Illinois, United States of America]

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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/202108172146.17HLk6MV141840%40masaka.moolenaar.net.

Raspunde prin e-mail lui