Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/mod.ts>interrupt

๐Ÿ“š Standard module for denops.vim
Go to Latest
function interrupt
import { interrupt } from "https://deno.land/x/denops_std@v5.0.2/function/mod.ts";

Interrupt script execution. It works more or less like the user typing CTRL-C, most commands won't execute and control returns to the user. This is useful to abort execution from lower down, e.g. in an autocommand. Example:

:function s:check_typoname(file)
:   if fnamemodify(a:file, ':t') == '['
:       echomsg 'Maybe typo'
:       call interrupt()
:   endif
:endfunction
:au BufWritePre * call s:check_typoname(expand('<amatch>'))

Returns

Promise<void>