annotate runtime/autoload/freebasic.vim @ 32007:9fec560a63ef v9.0.1335

patch 9.0.1335: no test for bad use of spaces in help files Commit: https://github.com/vim/vim/commit/d950984489e50b12d87c85f0cce1d672c880aa23 Author: h-east <h.east.727@gmail.com> Date: Tue Feb 21 13:33:17 2023 +0000 patch 9.0.1335: no test for bad use of spaces in help files Problem: No test for bad use of spaces in help files. Solution: Add checks for use of spaces in help files. Ignore intentional spaces. (Hirohito Higashi, closes #11952)
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 Feb 2023 14:45:02 +0100
parents 912224cab37f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27459
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin file
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: FreeBASIC
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
29352
912224cab37f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27459
diff changeset
4 " Last Change: 2022 June 24
27459
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Dialects can be one of fb, qb, fblite, or deprecated
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " Precedence is forcelang > #lang > lang
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 function! freebasic#GetDialect() abort
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 if exists("g:freebasic_forcelang")
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 return g:freebasic_forcelang
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 endif
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 if exists("g:freebasic_lang")
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 let dialect = g:freebasic_lang
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 else
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 let dialect = "fb"
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 endif
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 " override with #lang directive or metacommand
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 let save_cursor = getcurpos()
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 call cursor(1, 1)
29352
912224cab37f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27459
diff changeset
25 let lnum = search(pat, 'cn')
27459
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 call setpos('.', save_cursor)
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 if lnum
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 let word = matchlist(getline(lnum), pat)[1]
29352
912224cab37f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27459
diff changeset
30 if word =~? '\<\%(fb\|deprecated\|fblite\|qb\)\>'
27459
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 let dialect = word
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 else
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 endif
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 endif
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 return dialect
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 endfunction
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39
5825405e4e2c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: