Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit450705b

Browse files
committed
Fix some test failures
1 parente27c79f commit450705b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

‎runtime/lua/vim/filetype/detect.lua‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ local function is_rapid(bufnr, extension)
145145
end
146146
localline=nextnonblank(bufnr,1):lower()
147147
-- Called from mod, prg or sys functions
148-
returnfindany(line,{'^%s*%%%%%%','^%s*module%s+.+%s*%(','^%s*module%s+.+%s*$'})
148+
returnmatchre(line,[[\v^\s*%(\%{3}|module\s+\k+\s*%(\(|$))]])
149149
end
150150

151151
functionM.cfg(bufnr)
@@ -322,7 +322,7 @@ function M.frm(bufnr)
322322
vim.bo[bufnr].filetype=vim.g.filetype_frm
323323
return
324324
end
325-
locallines=table.concat(getlines(bufnr,1,5))
325+
locallines=table.concat(getlines(bufnr,1,5)):lower()
326326
iffindany(lines,visual_basic_content)then
327327
vim.bo[bufnr].filetype='vb'
328328
else
@@ -380,9 +380,7 @@ end
380380

381381
functionM.idl(bufnr)
382382
for_,lineinipairs(getlines(bufnr,1,50))do
383-
-- Always ignore case
384-
line=line:lower()
385-
iffindany(line, {'^%s*import%s+"unknwn"%.idl','^%s*import%s+"objidl"%.idl'})then
383+
iffindany(line:lower(), {'^%s*import%s+"unknwn"%.idl','^%s*import%s+"objidl"%.idl'})then
386384
vim.bo[bufnr].filetype='msidl'
387385
return
388386
end
@@ -437,7 +435,7 @@ function M.m(bufnr)
437435

438436
-- Excluding end(for|function|if|switch|while) common to Murphi
439437
localoctave_block_terminators=
440-
[[\%(^\|;\)\s*\<end\%(_try_catch\|classdef\|enumeration\|events\|methods\|parfor\|properties\)\>]]
438+
[[\<end\%(_try_catch\|classdef\|enumeration\|events\|methods\|parfor\|properties\)\>]]
441439
localobjc_preprocessor=[[^\s*#\s*\%(import\|include\|define\|if\|ifn\=def\|undef\|line\|error\|pragma\)\>]]
442440

443441
-- Whether we've seen a multiline comment leader
@@ -456,7 +454,7 @@ function M.m(bufnr)
456454
if
457455
findany(line, {'^%s*#','^%s*%%!'})
458456
ormatchre(line,[[^\s*unwind_protect\>]])
459-
ormatchre(line,octave_block_terminators)
457+
ormatchre(line,[[\%(^\|;\)\s*]]..octave_block_terminators)
460458
then
461459
vim.bo[bufnr].filetype='octave'
462460
return

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp