summaryrefslogtreecommitdiffstats
path: root/runtime/autoload
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-07-01 18:45:04 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-01 18:45:04 +0100
commit0d878b95d8f9ece2fdba81050f5caba224540f9c (patch)
tree20cf23db136c9df0fed67fb1ff30df7a43ee38c4 /runtime/autoload
parent27efc62f5d86afcb2ecb7565587fe8dea4b036fe (diff)
Update runtime files
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/freebasic.vim7
1 files changed, 3 insertions, 4 deletions
diff --git a/runtime/autoload/freebasic.vim b/runtime/autoload/freebasic.vim
index 428cf1382b..6c94cd34ea 100644
--- a/runtime/autoload/freebasic.vim
+++ b/runtime/autoload/freebasic.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: FreeBASIC
" Maintainer: Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2021 Mar 16
+" Last Change: 2022 June 24
" Dialects can be one of fb, qb, fblite, or deprecated
" Precedence is forcelang > #lang > lang
@@ -18,17 +18,16 @@ function! freebasic#GetDialect() abort
" override with #lang directive or metacommand
- let skip = "has('syntax_items') && synIDattr(synID(line('.'), col('.'), 1), 'name') =~ 'Comment$'"
let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
let save_cursor = getcurpos()
call cursor(1, 1)
- let lnum = search(pat, 'n', '', '', skip)
+ let lnum = search(pat, 'cn')
call setpos('.', save_cursor)
if lnum
let word = matchlist(getline(lnum), pat)[1]
- if word =~? '\%(fb\|deprecated\|fblite\|qb\)'
+ if word =~? '\<\%(fb\|deprecated\|fblite\|qb\)\>'
let dialect = word
else
echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)