Patch 8.1.1930
Problem:    Cannot recognize .jsx and .tsx files.
Solution:   Recognize them as javascriptreact and typescriptreact.
            (closes #4830)
Files:      runtime/filetype.vim, src/testdir/test_filetype.vim,
            runtime/syntax/javascriptreact.vim,
            runtime/indent/javascriptreact.vim,
            runtime/ftplugin/javascriptreact.vim


*** ../vim-8.1.1929/runtime/filetype.vim        2019-07-27 21:56:44.836171922 
+0200
--- runtime/filetype.vim        2019-08-26 21:20:28.187248377 +0200
***************
*** 795,801 ****
  au BufNewFile,BufRead *.jj,*.jjt              setf javacc
  
  " JavaScript, ECMAScript
! au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx,*.mjs   setf javascript
  
  " Java Server Pages
  au BufNewFile,BufRead *.jsp                   setf jsp
--- 798,807 ----
  au BufNewFile,BufRead *.jj,*.jjt              setf javacc
  
  " JavaScript, ECMAScript
! au BufNewFile,BufRead *.js,*.javascript,*.es,*.mjs   setf javascript
! 
! " JavaScript with React
! au BufNewFile,BufRead *.jsx                   setf javascriptreact
  
  " Java Server Pages
  au BufNewFile,BufRead *.jsp                   setf jsp
***************
*** 1706,1711 ****
--- 1712,1720 ----
  " Typescript
  au BufNewFile,BufReadPost *.ts                        setf typescript
  
+ " TypeScript with React
+ au BufNewFile,BufRead *.tsx                   setf typescriptreact
+ 
  " Motif UIT/UIL files
  au BufNewFile,BufRead *.uit,*.uil             setf uil
  
*** ../vim-8.1.1929/src/testdir/test_filetype.vim       2019-07-29 
21:14:39.342411785 +0200
--- src/testdir/test_filetype.vim       2019-08-26 21:27:27.369623672 +0200
***************
*** 221,227 ****
      \ 'jam': ['file.jpl', 'file.jpr'],
      \ 'java': ['file.java', 'file.jav'],
      \ 'javacc': ['file.jj', 'file.jjt'],
!     \ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.jsx', 
'file.mjs'],
      \ 'jess': ['file.clp'],
      \ 'jgraph': ['file.jgr'],
      \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
--- 221,228 ----
      \ 'jam': ['file.jpl', 'file.jpr'],
      \ 'java': ['file.java', 'file.jav'],
      \ 'javacc': ['file.jj', 'file.jjt'],
!     \ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.mjs'],
!     \ 'javascriptreact': ['file.jsx'],
      \ 'jess': ['file.clp'],
      \ 'jgraph': ['file.jgr'],
      \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
***************
*** 455,460 ****
--- 456,462 ----
      \ 'tssop': ['file.tssop'],
      \ 'twig': ['file.twig'],
      \ 'typescript': ['file.ts'],
+     \ 'typescriptreact': ['file.tsx'],
      \ 'uc': ['file.uc'],
      \ 'udevconf': ['/etc/udev/udev.conf'],
      \ 'udevperm': ['/etc/udev/permissions.d/file.permissions'],
***************
*** 609,613 ****
  
  func Test_setfiletype_completion()
    call feedkeys(":setfiletype java\<C-A>\<C-B>\"\<CR>", 'tx')
!   call assert_equal('"setfiletype java javacc javascript', @:)
  endfunc
--- 611,615 ----
  
  func Test_setfiletype_completion()
    call feedkeys(":setfiletype java\<C-A>\<C-B>\"\<CR>", 'tx')
!   call assert_equal('"setfiletype java javacc javascript javascriptreact', @:)
  endfunc
*** ../vim-8.1.1929/runtime/syntax/javascriptreact.vim  2019-08-26 
21:25:59.069988070 +0200
--- runtime/syntax/javascriptreact.vim  2019-08-26 21:23:51.054498170 +0200
***************
*** 0 ****
--- 1,2 ----
+ " Placeholder for backwards compatilibity: .jsx used to stand for JavaScript.
+ source %:h/javascript.vim
*** ../vim-8.1.1929/runtime/indent/javascriptreact.vim  2019-08-26 
21:25:59.073988054 +0200
--- runtime/indent/javascriptreact.vim  2019-08-26 21:23:53.122490130 +0200
***************
*** 0 ****
--- 1,2 ----
+ " Placeholder for backwards compatilibity: .jsx used to stand for JavaScript.
+ source %:h/javascript.vim
*** ../vim-8.1.1929/runtime/ftplugin/javascriptreact.vim        2019-08-26 
21:25:59.077988036 +0200
--- runtime/ftplugin/javascriptreact.vim        2019-08-26 21:24:22.454375308 
+0200
***************
*** 0 ****
--- 1,2 ----
+ " Placeholder for backwards compatilibity: .jsx used to stand for JavaScript.
+ source %:h/javascript.vim
*** ../vim-8.1.1929/src/version.c       2019-08-25 23:07:34.883383627 +0200
--- src/version.c       2019-08-26 21:19:32.539438100 +0200
***************
*** 763,764 ****
--- 763,766 ----
  {   /* Add new patch number below this line */
+ /**/
+     1930,
  /**/


-- 
Would you care for a drink?   I mean, if it were, like,
disabled and you had to look after it?

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/201908261928.x7QJSjuE024460%40masaka.moolenaar.net.

Raspunde prin e-mail lui