Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.haslocaldir

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.haslocaldir
import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { haslocaldir } = fn;

The result is a Number: 1 when the window has set a local directory via :lcd 2 when the tab-page has set a local directory via :tcd 0 otherwise.

Without arguments use the current window. With {winnr} use this window in the current tab page. With {winnr} and {tabnr} use the window in the specified tab page. {winnr} can be the window number or the window-ID. If {winnr} is -1 it is ignored and only the tabpage is used. Return 0 if the arguments are invalid. Examples:

if haslocaldir() == 1
  " window local directory case
elseif haslocaldir() == 2
  " tab-local directory case
else
  " global directory case
endif

" current window
:echo haslocaldir()
:echo haslocaldir(0)
:echo haslocaldir(0, 0)
" window n in current tab page
:echo haslocaldir(n)
:echo haslocaldir(n, 0)
" window n in tab page m
:echo haslocaldir(n, m)
" tab page m
:echo haslocaldir(-1, m)

Can also be used as a method:

GetWinnr()->haslocaldir()

Parameters

denops: Denops
optional
winnr: unknown
optional
tabnr: unknown

Returns

Promise<number>