summaryrefslogtreecommitdiffstats
path: root/runtime/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/dist/ft.vim18
1 files changed, 10 insertions, 8 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index bfc325d240..5d2053d70a 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -307,14 +307,16 @@ export def FTfs()
if exists("g:filetype_fs")
exe "setf " .. g:filetype_fs
else
- var line = getline(nextnonblank(1))
- # comments and colon definitions
- if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$'
- \ || line =~ '^\s*: \S'
- setf forth
- else
- setf fsharp
- endif
+ var n = 1
+ while n < 100 && n <= line("$")
+ # Forth comments and colon definitions
+ if getline(n) =~ "^[:(\\\\] "
+ setf forth
+ return
+ endif
+ n += 1
+ endwhile
+ setf fsharp
endif
enddef