Patch 9.0.1120
Problem:    Tex filetype detection not sufficiently tested.
Solution:   Add more test cases for "tex" detection. (Jonas Strittmatter,
            closes #11765)
Files:      src/testdir/test_filetype.vim


*** ../vim-9.0.1119/src/testdir/test_filetype.vim       2022-12-27 
20:17:15.805022039 +0000
--- src/testdir/test_filetype.vim       2022-12-31 14:44:38.401503295 +0000
***************
*** 1653,1668 ****
  func Test_tex_file()
    filetype on
  
!   " only tests one case, should do more
    let lines =<< trim END
!       % This is a sentence.
  
!       This is a sentence.
    END
!   call writefile(lines, "Xfile.tex")
    split Xfile.tex
!   call assert_equal('plaintex', &filetype)
    bwipe
  
    call delete('Xfile.tex')
    filetype off
--- 1653,1696 ----
  func Test_tex_file()
    filetype on
  
!   call writefile(['%& pdflatex'], 'Xfile.tex')
!   split Xfile.tex
!   call assert_equal('tex', &filetype)
!   bwipe
! 
!   call writefile(['\newcommand{\test}{some text}'], 'Xfile.tex')
!   split Xfile.tex
!   call assert_equal('tex', &filetype)
!   bwipe
! 
!   " tex_flavor is unset
!   call writefile(['%& plain'], 'Xfile.tex')
!   split Xfile.tex
!   call assert_equal('plaintex', &filetype)
!   bwipe
! 
!   let g:tex_flavor = 'plain'
!   call writefile(['just some text'], 'Xfile.tex')
!   split Xfile.tex
!   call assert_equal('plaintex', &filetype)
!   bwipe
! 
    let lines =<< trim END
!       % This is a comment.
  
!       \usemodule[translate]
    END
!   call writefile(lines, 'Xfile.tex')
    split Xfile.tex
!   call assert_equal('context', &filetype)
!   bwipe
! 
!   let g:tex_flavor = 'context'
!   call writefile(['just some text'], 'Xfile.tex')
!   split Xfile.tex
!   call assert_equal('context', &filetype)
    bwipe
+   unlet g:tex_flavor
  
    call delete('Xfile.tex')
    filetype off
*** ../vim-9.0.1119/src/version.c       2022-12-31 14:01:20.830671637 +0000
--- src/version.c       2022-12-31 14:46:18.297469792 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1120,
  /**/

-- 
My Go, this amn keyboar oesn't have a .

 /// 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/20221231144723.7A7EE1C0AA4%40moolenaar.net.

Raspunde prin e-mail lui