🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@hanfy/plugin-indent

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hanfy/plugin-indent

缩进插件

latest
Source
npmnpm
Version
2.10.5
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

@hanfy/plugin-indent

缩进插件

安装

$ yarn add @hanfy/plugin-indent

添加到引擎

此插件建议放在第一个增加,以免其它插件拦截了事件,使其无法生效

import Engine, { EngineInterface } from '@hanfy/engine';
import Indent from '@hanfy/plugin-indent';

new Engine(...,{ plugins:[Indent] })

可选项

快捷键

默认缩进快捷键 mod+]

默认删除缩进快捷键 mod+[

//快捷键,
hotkey?: {
    in?:string //缩进快捷键,默认 mod+]
    out?:string //删除缩进快捷键,默认 mod+[
};

//使用配置
new Engine(...,{
    config:{
        "indent":{
            //修改快捷键
            hotkey:{
                "in":"快捷键",
                "out":"快捷键"
            }
        }
    }
 })

最大 padding

最大 padding,每次缩进为 2

maxPadding?:number

命令

有一个参数 默认为 in ,可选值为 in 增加缩进,out 减少缩进

engine.command.execute('indent');
//使用 command 执行查询当前状态,返回 numbber,当前缩进值
engine.command.queryState('indent');

FAQs

Package last updated on 05 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts