Patch 8.2.3432
Problem:    Octave/Matlab filetype detection does not work properly.
Solution:   Update the patterns used for matching. (Doug Kearns)
Files:      runtime/autoload/dist/ft.vim, src/testdir/test_filetype.vim


*** ../vim-8.2.3431/runtime/autoload/dist/ft.vim        2021-09-03 
19:21:31.267026061 +0200
--- runtime/autoload/dist/ft.vim        2021-09-12 16:52:59.992792408 +0200
***************
*** 269,275 ****
      return
    endif
  
!   let octave_block_terminators = 
'\<end\%(_try_catch\|classdef\|enumeration\|events\|for\|function\|if\|methods\|parfor\|properties\|switch\|while\)\>'
  
    let n = 1
    let saw_comment = 0 " Whether we've seen a multiline comment leader.
--- 269,276 ----
      return
    endif
  
!   " excluding end(for|function|if|switch|while) common to Murphi
!   let octave_block_terminators = 
'\<end\%(_try_catch\|classdef\|enumeration\|events\|methods\|parfor\|properties\)\>'
  
    let n = 1
    let saw_comment = 0 " Whether we've seen a multiline comment leader.
***************
*** 285,292 ****
        setf objc
        return
      endif
!     if line =~ '^\s*\%(#\|%!\|[#%]{\=\s*$\)' ||
!         \ line =~ '^\s*unwind_protect\>' ||
          \ line =~ '\%(^\|;\)\s*' .. octave_block_terminators
        setf octave
        return
--- 286,292 ----
        setf objc
        return
      endif
!     if line =~ '^\s*\%(#\|%!\)' || line =~ '^\s*unwind_protect\>' ||
          \ line =~ '\%(^\|;\)\s*' .. octave_block_terminators
        setf octave
        return
*** ../vim-8.2.3431/src/testdir/test_filetype.vim       2021-09-03 
19:21:31.271026051 +0200
--- src/testdir/test_filetype.vim       2021-09-12 16:52:59.992792408 +0200
***************
*** 893,908 ****
    call assert_equal('octave', &filetype)
    bwipe!
  
-   call writefile(['#{', 'Octave block comment',  '#}'], 'Xfile.m')
-   split Xfile.m
-   call assert_equal('octave', &filetype)
-   bwipe!
- 
-   call writefile(['%{', 'Octave block comment', '%}'], 'Xfile.m')
-   split Xfile.m
-   call assert_equal('octave', &filetype)
-   bwipe!
- 
    call writefile(['%!test "Octave test"'], 'Xfile.m')
    split Xfile.m
    call assert_equal('octave', &filetype)
--- 893,898 ----
***************
*** 913,919 ****
    call assert_equal('octave', &filetype)
    bwipe!
  
!   call writefile(['function test(); 42; endfunction'], 'Xfile.m')
    split Xfile.m
    call assert_equal('octave', &filetype)
    bwipe!
--- 903,909 ----
    call assert_equal('octave', &filetype)
    bwipe!
  
!   call writefile(['try; 42; end_try_catch'], 'Xfile.m')
    split Xfile.m
    call assert_equal('octave', &filetype)
    bwipe!
***************
*** 925,930 ****
--- 915,927 ----
    call assert_equal('mma', &filetype)
    bwipe!
  
+   " MATLAB
+ 
+   call writefile(['% MATLAB line comment'], 'Xfile.m')
+   split Xfile.m
+   call assert_equal('matlab', &filetype)
+   bwipe!
+ 
    " Murphi
  
    call writefile(['-- Murphi comment'], 'Xfile.m')
*** ../vim-8.2.3431/src/version.c       2021-09-12 15:45:06.690219391 +0200
--- src/version.c       2021-09-12 16:54:18.532695454 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3432,
  /**/

-- 
I have a drinking problem -- I don't have a drink!

 /// 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/202109121503.18CF3XdY887161%40masaka.moolenaar.net.

Raspunde prin e-mail lui