[
  {
    "path": ".eslintignore",
    "content": ".eslintrc.js\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  parser: \"@typescript-eslint/parser\",\n  extends: [\n    \"airbnb-base\",\n    \"plugin:@typescript-eslint/eslint-recommended\",\n    \"plugin:@typescript-eslint/recommended\",\n    \"plugin:@typescript-eslint/recommended-requiring-type-checking\",\n    \"plugin:eslint-comments/recommended\",\n    \"plugin:n/recommended\",\n    \"plugin:import/errors\",\n    \"plugin:import/warnings\",\n    \"plugin:import/typescript\",\n    \"prettier\",\n  ],\n  plugins: [\"@typescript-eslint\", \"import\", \"simple-import-sort\"],\n  parserOptions: {\n    sourceType: \"module\",\n    project: \"./tsconfig.json\",\n    ecmaVersion: 2020,\n  },\n  settings: {\n    \"import/resolver\": {\n      typescript: {},\n    },\n    \"import/parsers\": {\n      \"@typescript-eslint/parser\": [\".ts\"],\n    },\n  },\n  rules: {\n    complexity: [\"error\", 7],\n    \"no-console\": \"off\",\n    \"no-else-return\": \"off\",\n    \"object-shorthand\": \"error\",\n    \"arrow-body-style\": \"off\",\n    \"no-restricted-syntax\": \"off\",\n    \"no-param-reassign\": [\n      \"error\",\n      {\n        props: true,\n        ignorePropertyModificationsFor: [\"draft\", \"state\"],\n      },\n    ],\n    \"padding-line-between-statements\": [\n      \"error\",\n      {\n        blankLine: \"always\",\n        prev: \"*\",\n        next: \"return\",\n      },\n    ],\n    \"no-return-await\": \"off\",\n\n    \"simple-import-sort/imports\": \"warn\",\n    \"simple-import-sort/exports\": \"warn\",\n    \"no-restricted-imports\": [\"error\", { patterns: [\"./\", \"../\"] }],\n    \"import/prefer-default-export\": \"off\",\n    \"import/extensions\": [\"error\", \"ignorePackages\", { ts: \"never\" }],\n    \"@typescript-eslint/consistent-type-imports\": \"error\",\n\n    \"@typescript-eslint/no-unused-vars\": [\"error\", { argsIgnorePattern: \"^_\" }],\n    \"@typescript-eslint/strict-boolean-expressions\": \"error\",\n    \"@typescript-eslint/array-type\": [\"error\", { default: \"generic\" }],\n    \"@typescript-eslint/prefer-optional-chain\": \"error\",\n    \"@typescript-eslint/prefer-nullish-coalescing\": \"error\",\n    \"@typescript-eslint/no-namespace\": \"error\",\n    \"@typescript-eslint/no-unnecessary-type-assertion\": \"error\",\n    \"@typescript-eslint/restrict-plus-operands\": \"error\",\n    \"@typescript-eslint/explicit-function-return-type\": \"off\",\n    \"@typescript-eslint/ban-ts-comment\": \"off\",\n    \"@typescript-eslint/no-misused-promises\": [\"error\", { checksVoidReturn: false }],\n\n    \"eslint-comments/no-unused-disable\": \"error\",\n\n    \"n/no-unsupported-features/es-syntax\": \"off\",\n    \"n/no-missing-import\": \"off\",\n  },\n  overrides: [\n    {\n      files: [\"**/*.test.ts\"],\n      extends: [\"plugin:jest/recommended\", \"plugin:jest/style\"],\n      plugins: [\"jest\"],\n      env: {\n        jest: true,\n      },\n      rules: {\n        \"@typescript-eslint/no-empty-function\": \"off\",\n      },\n    },\n    {\n      parserOptions: {\n        sourceType: \"module\",\n        project: \"./tsconfig.webpack-jest.json\",\n      },\n      files: [\"./webpack.*.ts\", \"./jest.config.ts\"],\n      rules: {\n        \"import/no-extraneous-dependencies\": [\"error\", { devDependencies: true }],\n        \"no-restricted-imports\": \"off\",\n      },\n    },\n  ],\n}\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "## Problems summary\n\n\n### Expected\n\n\n### Environment Information\n\n- fzf-preview version (package.json):\n\n- OS:\n\n- Vim/Neovim version:\n\n### Provide a minimal init.vim\n\n```vim\n\" call plug#begin('~/.vim/plugged')\n\" Plug 'junegunn/fzf'\n\" Plug 'neoclide/coc.nvim', {'branch': 'release'}\n\" Plug 'ryanoasis/vim-devicons'\n\" call plug#end()\n\" \n\" let g:coc_global_extensions = ['coc-fzf-preview']\n```\n\n### Screenshot\n\n\n### Dockerfile that reproduces the problem (if possible)\n\nRefer to https://github.com/yuki-yano/fzf-preview.vim/blob/main/.github/issue_example/Dockerfile\n\n```Dockerfile\n```\n"
  },
  {
    "path": ".github/issue_example/Dockerfile",
    "content": "FROM ubuntu:focal\n\nENV DEBIAN_FRONTEND=noninteractive\n\n# Neovim\nRUN apt update && apt install -y ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip git\n\nWORKDIR /usr/local/src\nRUN git clone https://github.com/neovim/neovim.git\n\nWORKDIR /usr/local/src/neovim\nRUN make && make install\n\n# zsh\nRUN apt install -y zsh\n\n# Node\nRUN curl -sL https://deb.nodesource.com/setup_14.x | bash -\nRUN apt install -y nodejs\n\n# Python\nRUN apt install -y python python3 python3-pip\n# RUN pip3 install neovim\n\n# bat & ripgrep\n# RUN apt install -y bat\n# RUN apt install -y ripgrep\n\n# Workaround for https://github.com/sharkdp/bat/issues/938\nRUN apt install -y -o Dpkg::Options::=\"--force-overwrite\" bat ripgrep\n\n# fd\nRUN apt install -y fd-find\n\n# vim plugin\nRUN sh -c 'curl -fLo \"${XDG_DATA_HOME:-$HOME/.local/share}\"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'\nRUN mkdir -p /root/.config/nvim\nRUN echo \"call plug#begin('~/.vim/plugged') \\n\\\nPlug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} \\n\\\nPlug 'neoclide/coc.nvim', {'branch': 'release'} \\n\\\ncall plug#end() \\n\\\n\\n\\\nlet g:coc_global_extensions = ['coc-fzf-preview'] \\n\" >> /root/.config/nvim/init.vim\n\nRUN nvim -c \"PlugInstall\" -c \"qa!\"\nRUN nvim -c \"CocInstall -sync coc-fzf-preview\" -c \"qa!\"\n\nENTRYPOINT [\"nvim\"]\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "content": "name: Build\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v1\n        with:\n          node-version: 16\n      - run: yarn install --ignore-script --frozen-lockfile\n      - run: yarn run typecheck\n      - run: yarn run lint\n      - run: yarn run prettier\n      - run: yarn run test\n      - run: yarn run release-build:remote\n      - run: yarn run release-build:coc\n      - run: yarn run release-build:rpc\n      - id: check-release\n        run: |\n          if [[ $(git show --no-patch --format=%s) =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n            echo ::set-output name=IS_RELEASE::true\n          fi\n      - if: steps.check-release.outputs.IS_RELEASE == 'true'\n        uses: peter-evans/repository-dispatch@v1\n        with:\n          token: ${{ secrets.REPO_ACCESS_TOKEN }}\n          event-type: can-release\n"
  },
  {
    "path": ".github/workflows/can-release.yml",
    "content": "name: Can release\n\non:\n  repository_dispatch:\n    types: \n      - can-release\n\njobs:\n  can_release:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v1\n        with:\n          node-version: 16\n      - run: yarn install --ignore-script --frozen-lockfile\n      - run: yarn run can-npm-publish\n"
  },
  {
    "path": ".github/workflows/release-coc.yml",
    "content": "name: Release coc extensions\n\non:\n  workflow_run:\n    workflows:\n      - Can release\n    branches:\n      - main\n    types:\n      - completed\n\njobs:\n  release:\n    name: Release coc extensions\n    if: github.event.workflow_run.conclusion == 'success'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n          ref: main\n      - uses: actions/setup-node@v1\n        with:\n          node-version: 16\n          registry-url: https://registry.npmjs.org/\n      - run: yarn install --ignore-script --frozen-lockfile\n      - run: |\n          git config --global user.email \"github-actions[bot]@users.noreply.github.com\"\n          git config --global user.name \"github-actions[bot]\"\n      - run: yarn run release-build:coc\n      - run: yarn run build:preview-script\n      - run: |\n          TAG=\"v$(yarn run --silent print-version)\"\n          git tag $TAG\n          git push origin $TAG\n      - run: yarn publish\n        env:\n          NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/release-remote.yml",
    "content": "name: Release remote plugin\n\non:\n  workflow_run:\n    workflows:\n      - Can release\n    branches:\n      - main\n    types:\n      - completed\n\njobs:\n  release:\n    name: Release remote plugin\n    if: github.event.workflow_run.conclusion == 'success'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n      - uses: actions/setup-node@v1\n        with:\n          node-version: 16\n      - run: |\n          git config --global user.email \"github-actions[bot]@users.noreply.github.com\"\n          git config --global user.name \"github-actions[bot]\"\n      - run: git checkout release/remote\n      - run: git merge main\n      - run: yarn install --ignore-script --frozen-lockfile\n      - run: yarn run release-build:remote\n      - run: yarn run build:preview-script\n      - run: git add --all\n      - run: git commit -m \"Release $(yarn run --silent print-version)\" --allow-empty\n      - run: git push origin release/remote\n"
  },
  {
    "path": ".github/workflows/release-rpc.yml",
    "content": "name: Release Vim script RPC\n\non:\n  workflow_run:\n    workflows:\n      - Can release\n    branches:\n      - main\n    types:\n      - completed\n\njobs:\n  release:\n    name: Release Vim script RPC\n    if: github.event.workflow_run.conclusion == 'success'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n      - uses: actions/setup-node@v1\n        with:\n          node-version: 16\n      - run: |\n          git config --global user.email \"github-actions[bot]@users.noreply.github.com\"\n          git config --global user.name \"github-actions[bot]\"\n      - run: git checkout release/rpc\n      - run: git merge main\n      - run: yarn install --ignore-script --frozen-lockfile\n      - run: yarn run release-build:rpc\n      - run: yarn run build:preview-script\n      - run: git add --all\n      - run: git commit -m \"Release $(yarn run --silent print-version)\" --allow-empty\n      - run: git push origin release/rpc\n"
  },
  {
    "path": ".gitignore",
    "content": "/node_modules\n\n/lib\n/rplugin/node/fzf-preview.vim/index.js\n/bin/preview_fzf_grep\n\n/doc/tags\n"
  },
  {
    "path": ".luarc.json",
    "content": "{\n    \"$schema\": \"https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json\",\n    \"Lua.diagnostics.disable\": [\n        \"undefined-global\"\n    ],\n    \"Lua.diagnostics.globals\": [\n        \"vim\"\n    ]\n}"
  },
  {
    "path": ".markdownlint.json",
    "content": "{\n  \"line-length\": false,\n  \"no-inline-html\": false,\n  \"no-duplicate-header\": false,\n  \"commands-show-output\": false\n}\n"
  },
  {
    "path": ".prettierrc.json",
    "content": "{\n  \"semi\": false,\n  \"printWidth\": 120\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Yuki Yano\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# ![logo](https://user-images.githubusercontent.com/5423775/104124691-7f8b4c00-5395-11eb-85d6-93b1c55cf0c8.png)\n\n[![Build](https://github.com/yuki-yano/fzf-preview.vim/workflows/Build/badge.svg)](https://github.com/yuki-yano/fzf-preview.vim/actions?query=workflow:Build)\n[![Release RPC](https://github.com/yuki-yano/fzf-preview.vim/workflows/Release%20Vim%20script%20RPC/badge.svg)](https://github.com/yuki-yano/fzf-preview.vim/actions?query=workflow:\"Release+Vim+script+RPC\")\n[![Release remote plugin](https://github.com/yuki-yano/fzf-preview.vim/workflows/Release%20remote%20plugin/badge.svg)](https://github.com/yuki-yano/fzf-preview.vim/actions?query=workflow:%22Release+remote+plugin%22)\n[![Release coc extensions](https://github.com/yuki-yano/fzf-preview.vim/workflows/Release%20coc%20extensions/badge.svg)](https://github.com/yuki-yano/fzf-preview.vim/actions?query=workflow:%22Release+coc+extensions%22)\n\n[![Support](https://img.shields.io/badge/Support-Vim%208.1%20or%20above-yellowgreen)](https://www.vim.org)\n[![Support](https://img.shields.io/badge/Support-Neovim%200.4%20or%20above-yellowgreen)](https://neovim.io)\n[![Language](https://img.shields.io/badge/Language-TypeScript-blue)](https://www.typescriptlang.org)\n[![Language](https://img.shields.io/badge/Language-Vim%20script-green)](https://www.vim.org)\n[![Lint with](https://img.shields.io/badge/Lint%20with-ESLint-blueviolet)](https://eslint.org)\n[![Styled with](https://img.shields.io/badge/Styled%20with-Prettier-ff69b4)](https://prettier.io)\n[![Tested with](https://img.shields.io/badge/Tested%20with-Jest-green)](https://jestjs.io/)\n[![Powered by](https://img.shields.io/badge/Powered%20by-fzf-7b3948)](https://github.com/junegunn/fzf)\n[![Powered by](https://img.shields.io/badge/Powered%20by-coc.nvim-7b3948)](https://github.com/neoclide/coc.nvim)\n[![Powered by](https://img.shields.io/badge/Powered%20by-vital--vs-7b3948)](https://github.com/hrsh7th/vim-vital-vs)\n[![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/yuki-yano/fzf-preview.vim/blob/main/LICENSE)\n[![Doc](https://img.shields.io/badge/Doc-:h%20fzf--preview-orange)](https://github.com/yuki-yano/fzf-preview.vim/blob/main/doc/fzf_preview_vim.txt)\n[![All contributors](https://img.shields.io/badge/All%20contributors-17-orange)](https://github.com/yuki-yano/fzf-preview.vim/graphs/contributors)\n\nfzf-preview is a (Neo)vim plugin and coc extension written in TypeScript that provide powerful integration with fzf. It provides multiple presets for fzf and correspondingly powerful preview functionality. It also provides advanced interactive git integration.\n\nSince fzf-preview.vim implements RPC in the Vim script, it will work in both Vim and Neovim if you use the RPC release.\nIt can also be installed as Remote Plugin and coc extensions. If you want to use the integration with coc, install coc extensions.\n\n[Introductory Article](https://zenn.dev/yano/articles/vim_with_fzf_preview_is_best_experience) (Japanese)\n\nThis plugin can be easily extended in comparison to [fzf.vim](https://github.com/junegunn/fzf.vim).\n\ne.g. [Fugitive](https://github.com/tpope/vim-fugitive)(launch git commands), bdelete(delete a selected buffer from the buffer list)\n\n## TOC\n\n- [1. Features](#features)\n- [2. Demo](#demo)\n- [3. Requirements](#requirements)\n- [4. Installation](#installation)\n- [5. Usage](#usage)\n- [6. Customization](#customization)\n- [7. Release note](#release-note)\n- [8. Others](#others)\n- [9. License](#license)\n\n## Features\n\n1. Provides an excellent UI with floating windows by default\n2. Supports devicons and output highlighting by default\n3. Preview the selected item (with an arbitrary command)\n4. Fast file and buffer search by fuzzy matching\n5. Search all project files and history\n6. Search from file history files using oldfiles and mru\n7. Interactive git integration (with [Fugitive](https://github.com/tpope/vim-fugitive) or [Gina](https://github.com/lambdalisue/gina.vim))\n8. Jump lines from jumplist or changelist\n9. Interactive grep and preview from the current project\n10. Export the selected items to QuickFix.\n\n## Demo\n\n### Open file and :bdelete\n\n![fzf-preview](https://user-images.githubusercontent.com/5423775/88540152-6e4fbc80-d04d-11ea-8d19-314ee5e4d294.gif \"fzf-preview\")\n\n### Interactive git integration (Integrate with [Fugitive](https://github.com/tpope/vim-fugitive) or [Gina](https://github.com/lambdalisue/gina.vim))\n\n![fzf-preview](https://user-images.githubusercontent.com/5423775/88540232-86bfd700-d04d-11ea-8604-8ad8aed09cbb.gif \"fzf-preview\")\n\n### Grep\n\n![fzf-preview](https://user-images.githubusercontent.com/5423775/88540281-9ccd9780-d04d-11ea-9672-b9af8a6d6307.gif \"fzf-preview\")\n\n### Export quickfix and refactor (with [vim-qfreplace](https://github.com/thinca/vim-qfreplace))\n\n![fzf-preview](https://user-images.githubusercontent.com/5423775/88540327-af47d100-d04d-11ea-99b5-f453862ae892.gif \"fzf-preview\")\n\n## Requirements\n\n- **Node** <https://nodejs.org/>\n- git <https://git-scm.com/>\n- fzf <https://github.com/junegunn/fzf>\n\n### Remote Plugin\n\n- Neovim <https://neovim.io/>\n\n### coc extensions\n\n- coc.nvim <https://github.com/neoclide/coc.nvim>\n\n### Optional\n\n#### Functional\n\n- **ripgrep (Require FzfPreviewProjectGrep and FzfPreviewDirectoryFiles)** (Recommended) <https://github.com/BurntSushi/ripgrep>\n- **Fugitive (Require git integration)**  (Recommended) <https://github.com/tpope/vim-fugitive>\n- Gina (Require git integration) <https://github.com/lambdalisue/gina.vim>\n- universal-ctags (Require FzfPreviewCtags and FzfPreviewBufferTags) <https://github.com/universal-ctags/ctags>\n- vista.vim (Require FzfPreviewVistaCtags and FzfPreviewVistaBufferCtags) <https://github.com/liuchengxu/vista.vim>\n- vim-bookmarks (Require FzfPreviewBookmarks) <https://github.com/MattesGroeger/vim-bookmarks>\n- yankround.vim (Require FzfPreviewYankround) <https://github.com/LeafCage/yankround.vim>\n- memolist.vim (Require FzfPreviewMemoList and FzfPreviewMemoListGrep) <https://github.com/glidenote/memolist.vim>\n- todo-comments.nvim (Require FzfPreviewTodoComments) <https://github.com/folke/todo-comments.nvim>\n- GitHub cli (Require FzfPreviewBlamePR) <https://github.com/cli/cli>\n- Yarn (Require build latest version) <https://classic.yarnpkg.com/>\n\n#### Appearance\n\nWhen bat is installed you can highlight the preview and see it. Otherwise, head will be used\n\n- **bat (Add color to the preview)** (Recommended) <https://github.com/sharkdp/bat>\n- vim-devicons (Use devicons) <https://github.com/ryanoasis/vim-devicons>\n\n## Installation\n\n### Vim script RPC\n\nUse [Dein](https://github.com/Shougo/dein.vim), [vim-plug](https://github.com/junegunn/vim-plug) or any Vim plugin manager of your choice.\n\nInstall `release/rpc` branch.\n\n```vim\nPlug 'junegunn/fzf', { 'do': { -> fzf#install() } }\nPlug 'yuki-yano/fzf-preview.vim', { 'branch': 'release/rpc' }\n```\n\nor\n\n```vim\ncall dein#add('junegunn/fzf', { 'build': './install --all', 'merged': 0 })\ncall dein#add('yuki-yano/fzf-preview.vim', { 'rev': 'release/rpc' })\n```\n\n### Remote Plugin\n\nInstall the npm package [neovim](https://www.npmjs.com/package/neovim) to get the remote plugin working.\n\n```shell\n$ npm install -g neovim\n```\n\nUse [Dein](https://github.com/Shougo/dein.vim), [vim-plug](https://github.com/junegunn/vim-plug) or any Vim plugin manager of your choice.\n\nInstall `release/remote` branch and execute `:UpdateRemotePlugins` when after installed plugin.\n\n```vim\nPlug 'junegunn/fzf', { 'do': { -> fzf#install() } }\nPlug 'yuki-yano/fzf-preview.vim', { 'branch': 'release/remote', 'do': ':UpdateRemotePlugins' }\n```\n\nor\n\n```vim\ncall dein#add('junegunn/fzf', { 'build': './install --all', 'merged': 0 })\ncall dein#add('yuki-yano/fzf-preview.vim', { 'rev': 'release/remote' })\n```\n\n### coc extensions\n\nInstall the [fzf](https://github.com/junegunn/fzf), [coc.nvim](https://github.com/neoclide/coc.nvim) and install coc-fzf-preview\n\n```vim\nPlug 'junegunn/fzf', { 'do': { -> fzf#install() } }\nPlug 'neoclide/coc.nvim', { 'branch': 'release' }\n```\n\n```vim\ncall dein#add('junegunn/fzf', { 'build': './install --all', 'merged': 0 })\ncall dein#add('neoclide/coc.nvim', { 'rev': 'release', 'merged': 0 })\n```\n\nand\n\n```vim\n:CocInstall coc-fzf-preview\n```\n\n## Usage\n\n### Command\n\nVim script RPC, Remote Plugin, and coc extensions, in that order.\n\n```vim\n\" Select project files\n:FzfPreviewProjectFilesRpc\n:FzfPreviewProjectFiles\n:CocCommand fzf-preview.ProjectFiles\n\n\" Select file from git ls-files\n:FzfPreviewGitFilesRpc\n:FzfPreviewGitFiles\n:CocCommand fzf-preview.GitFiles\n\n\" Select file from directory files (default to current working directory) (Required [ripgrep](https://github.com/BurntSushi/ripgrep))\n:FzfPreviewDirectoryFilesRpc {path or none}\n:FzfPreviewDirectoryFiles {path or none}\n:CocCommand fzf-preview.DirectoryFiles\n\n\" Select file buffers. Used open-buffer processes.\n:FzfPreviewBuffersRpc\n:FzfPreviewBuffers\n:CocCommand fzf-preview.Buffers\n\n\" Select all buffers. Used open-bufnr processes\n:FzfPreviewAllBuffersRpc\n:FzfPreviewAllBuffers\n:CocCommand fzf-preview.AllBuffers\n\n\" Select project files from oldfiles\n:FzfPreviewProjectOldFilesRpc\n:CocCommand fzf-preview.ProjectOldFiles\n\n\" Select project mru (Most Recently Used) files\n:FzfPreviewProjectMruFilesRpc\n:FzfPreviewProjectMruFiles\n:CocCommand fzf-preview.ProjectMruFiles\n\n\" Select project mrw (Most Recently Written) files\n:FzfPreviewProjectMrwFilesRpc\n:FzfPreviewProjectMrwFiles\n:CocCommand fzf-preview.ProjectMrwFiles\n\n\" Grep project files from args word\n:FzfPreviewProjectGrepRpc {args}\n:FzfPreviewProjectGrep {args}\n:CocCommand fzf-preview.ProjectGrep {args}\n\n\" Run FzfPreviewProjectGrep with the same arguments as before.\n:FzfPreviewProjectGrepRecallRpc\n:FzfPreviewProjectGrepRecall\n:CocCommand fzf-preview.ProjectGrepRecall\n\n\" Select tags from tags file (Required [universal-ctags](https://github.com/universal-ctags/ctags))\n:FzfPreviewCtagsRpc\n:FzfPreviewCtags\n:CocCommand fzf-preview.Ctags\n\n\" Select tags from current files (Required [universal-ctags](https://github.com/universal-ctags/ctags))\n:FzfPreviewBufferTagsRpc\n:FzfPreviewBufferTags\n:CocCommand fzf-preview.BufferTags\n\n\" Select files from oldfiles\n:FzfPreviewOldFilesRpc\n:FzfPreviewOldFiles\n:CocCommand fzf-preview.OldFiles\n\n\" Select mru (Most Recently Used) files\n:FzfPreviewMruFilesRpc\n:FzfPreviewMruFiles\n:CocCommand fzf-preview.MruFiles\n\n\" Select mrw (Most Recently Written) files\n:FzfPreviewMrwFilesRpc\n:FzfPreviewMrwFiles\n:CocCommand fzf-preview.MrwFiles\n\n\" Select line from QuickFix\n:FzfPreviewQuickFixRpc\n:FzfPreviewQuickFix\n:CocCommand fzf-preview.QuickFix\n\n\" Select line from LocationList\n:FzfPreviewLocationListRpc\n:FzfPreviewLocationList\n:CocCommand fzf-preview.LocationList\n\n\" Select line from current buffer (Required [bat](https://github.com/sharkdp/bat))\n:FzfPreviewLinesRpc\n:FzfPreviewLines\n:CocCommand fzf-preview.Lines\n\n\" Select line from loaded buffer\n:FzfPreviewBufferLinesRpc\n:FzfPreviewBufferLines\n:CocCommand fzf-preview.BufferLines\n\n\" Select jumplist item\n:FzfPreviewJumpsRpc\n:FzfPreviewJumps\n:CocCommand fzf-preview.Jumps\n\n\" Select changelist item\n:FzfPreviewChangesRpc\n:FzfPreviewChanges\n:CocCommand fzf-preview.Changes\n\n\" Select mark\n:FzfPreviewMarksRpc\n:CocCommand fzf-preview.Marks\n\n\" Select files from selected resources (project, git, directory, buffer, project_old, project_mru, project_mrw, old, mru, mrw)\n:FzfPreviewFromResourcesRpc\n:FzfPreviewFromResources\n:CocCommand fzf-preview.FromResources\n\n\" Execute and edit command history\n:FzfPreviewCommandPaletteRpc\n:FzfPreviewCommandPalette\n:CocCommand fzf-preview.CommandPalette\n\n# Grep vim help\n:FzfPreviewGrepHelpRpc\n:FzfPreviewGrepHelp\n:CocCommand fzf-preview.GrepHelp\n\n\" Interactive git integration. (Required [Fugitive](https://github.com/tpope/vim-fugitive) or [Gina](https://github.com/lambdalisue/gina.vim))\n:FzfPreviewGitActionsRpc\n:FzfPreviewGitActions\n:CocCommand fzf-preview.GitActions\n\n\" Select git status listed file. (Required [Fugitive](https://github.com/tpope/vim-fugitive) or [Gina](https://github.com/lambdalisue/gina.vim))\n:FzfPreviewGitStatusRpc\n:FzfPreviewGitStatus\n:CocCommand fzf-preview.GitStatus\n\n\" Select references from nvim-lsp\n:FzfPreviewNvimLspReferencesRpc\n:FzfPreviewNvimLspReferences\n\n\" Select diagnostics from nvim-lsp\n:FzfPreviewNvimLspDiagnosticsRpc\n:FzfPreviewNvimLspDiagnostics\n\n\" Select current file diagnostics from nvim-lsp\n:FzfPreviewNvimLspCurrentDiagnosticsRpc\n:FzfPreviewNvimLspCurrentDiagnostics\n\n\" Select definitions from nvim-lsp\n:FzfPreviewNvimLspDefinitionRpc\n:FzfPreviewNvimLspDefinition\n\n\" Select type definitions from nvim-lsp\n:FzfPreviewNvimLspTypeDefinitionRpc\n:FzfPreviewNvimLspTypeDefinition\n\n\" Select implementations from nvim-lsp\n:FzfPreviewNvimLspImplementationsRpc\n:FzfPreviewNvimLspImplementations\n\n\" Select references from vim-lsp\n:FzfPreviewVimLspReferencesRpc\n:FzfPreviewVimLspReferences\n\n\" Select diagnostics from vim-lsp\n:FzfPreviewVimLspDiagnosticsRpc\n:FzfPreviewVimLspDiagnostics\n\n\" Select current file diagnostics from vim-lsp\n:FzfPreviewVimLspCurrentDiagnosticsRpc\n:FzfPreviewVimLspCurrentDiagnostics\n\n\" Select definitions from vim-lsp\n:FzfPreviewVimLspDefinitionRpc\n:FzfPreviewVimLspDefinition\n\n\" Select type definitions from vim-lsp\n:FzfPreviewVimLspTypeDefinitionRpc\n:FzfPreviewVimLspTypeDefinition\n\n\" Select implementations from vim-lsp\n:FzfPreviewVimLspImplementationsRpc\n:FzfPreviewVimLspImplementations\n\n\" Select tags from vista.vim (Required [vista.vim](https://github.com/liuchengxu/vista.vim))\n:FzfPreviewVistaCtagsRpc\n:FzfPreviewVistaCtags\n:CocCommand fzf-preview.VistaCtags\n\n\" Select current buffer tags from vista.vim (Required [vista.vim](https://github.com/liuchengxu/vista.vim))\n:FzfPreviewVistaBufferCtagsRpc\n:FzfPreviewVistaBufferCtags\n:CocCommand fzf-preview.VistaBufferCtags\n\n\" Select bookmarks (Required [vim-bookmarks](https://github.com/MattesGroeger/vim-bookmarks))\n:FzfPreviewBookmarksRpc\n:FzfPreviewBookmarks\n:CocCommand fzf-preview.Bookmarks\n\n\" Select register history (Required [yankround.vim](https://github.com/LeafCage/yankround.vim))\n:FzfPreviewYankroundRpc\n:FzfPreviewYankround\n:CocCommand fzf-preview.Yankround\n\n\" Select memolist (Required [glidenote/memolist.vim](https://github.com/glidenote/memolist.vim))\n:FzfPreviewMemoListRpc\n:FzfPreviewMemoList\n:CocCommand fzf-preview.MemoList\n\n\" Grep memolist (Required [glidenote/memolist.vim](https://github.com/glidenote/memolist.vim))\n:FzfPreviewMemoListGrepRpc\n:FzfPreviewMemoListGrep\n:CocCommand fzf-preview.MemoListGrep\n\n\" Search TodoComments (Required  [folke/todo-comments.nvim](https://github.com/folke/todo-comments.nvim))\n:FzfPreviewTodoCommentsRpc\n:FzfPreviewTodoComments\n:CocCommand fzf-preview.TodoComments\n\n\" Open the PR corresponding to the selected line (Required [GitHub cli](https://github.com/cli/cli))\n:FzfPreviewBlamePRRpc\n:FzfPreviewBlamePR\n:CocCommand fzf-preview.BlamePR\n\n\" Select references from coc.nvim (only coc extensions)\n:CocCommand fzf-preview.CocReferences\n\n\" Select diagnostics from coc.nvim (only coc extensions)\n:CocCommand fzf-preview.CocDiagnostics\n\n\" Select current file diagnostics from coc.nvim (only coc extensions)\n:CocCommand fzf-preview.CocCurrentDiagnostics\n\n\" Select definitions from coc.nvim (only coc extensions)\n:CocCommand fzf-preview.CocDefinition\n\n\" Select type definitions from coc.nvim (only coc extensions)\n:CocCommand fzf-preview.CocTypeDefinition\n\n\" Select implementations from coc.nvim (only coc extensions)\n:CocCommand fzf-preview.CocImplementations\n\n\" Select outline from coc.nvim (only coc extensions)\n:CocCommand fzf-preview.CocOutline\n```\n\n### Recommended mappings\n\n#### Vim script RPC\n\n```vim\nnmap <Leader>f [fzf-p]\nxmap <Leader>f [fzf-p]\n\nnnoremap <silent> [fzf-p]p     :<C-u>FzfPreviewFromResourcesRpc project_mru git<CR>\nnnoremap <silent> [fzf-p]gs    :<C-u>FzfPreviewGitStatusRpc<CR>\nnnoremap <silent> [fzf-p]ga    :<C-u>FzfPreviewGitActionsRpc<CR>\nnnoremap <silent> [fzf-p]b     :<C-u>FzfPreviewBuffersRpc<CR>\nnnoremap <silent> [fzf-p]B     :<C-u>FzfPreviewAllBuffersRpc<CR>\nnnoremap <silent> [fzf-p]o     :<C-u>FzfPreviewFromResourcesRpc buffer project_mru<CR>\nnnoremap <silent> [fzf-p]<C-o> :<C-u>FzfPreviewJumpsRpc<CR>\nnnoremap <silent> [fzf-p]g;    :<C-u>FzfPreviewChangesRpc<CR>\nnnoremap <silent> [fzf-p]/     :<C-u>FzfPreviewLinesRpc --add-fzf-arg=--no-sort --add-fzf-arg=--query=\"'\"<CR>\nnnoremap <silent> [fzf-p]*     :<C-u>FzfPreviewLinesRpc --add-fzf-arg=--no-sort --add-fzf-arg=--query=\"'<C-r>=expand('<cword>')<CR>\"<CR>\nnnoremap          [fzf-p]gr    :<C-u>FzfPreviewProjectGrepRpc<Space>\nxnoremap          [fzf-p]gr    \"sy:FzfPreviewProjectGrepRpc<Space>-F<Space>\"<C-r>=substitute(substitute(@s, '\\n', '', 'g'), '/', '\\\\/', 'g')<CR>\"\nnnoremap <silent> [fzf-p]t     :<C-u>FzfPreviewBufferTagsRpc<CR>\nnnoremap <silent> [fzf-p]q     :<C-u>FzfPreviewQuickFixRpc<CR>\nnnoremap <silent> [fzf-p]l     :<C-u>FzfPreviewLocationListRpc<CR>\n```\n\n#### Remote Plugin\n\n```vim\nnmap <Leader>f [fzf-p]\nxmap <Leader>f [fzf-p]\n\nnnoremap <silent> [fzf-p]p     :<C-u>FzfPreviewFromResources project_mru git<CR>\nnnoremap <silent> [fzf-p]gs    :<C-u>FzfPreviewGitStatus<CR>\nnnoremap <silent> [fzf-p]ga    :<C-u>FzfPreviewGitActions<CR>\nnnoremap <silent> [fzf-p]b     :<C-u>FzfPreviewBuffers<CR>\nnnoremap <silent> [fzf-p]B     :<C-u>FzfPreviewAllBuffers<CR>\nnnoremap <silent> [fzf-p]o     :<C-u>FzfPreviewFromResources buffer project_mru<CR>\nnnoremap <silent> [fzf-p]<C-o> :<C-u>FzfPreviewJumps<CR>\nnnoremap <silent> [fzf-p]g;    :<C-u>FzfPreviewChanges<CR>\nnnoremap <silent> [fzf-p]/     :<C-u>FzfPreviewLines --add-fzf-arg=--no-sort --add-fzf-arg=--query=\"'\"<CR>\nnnoremap <silent> [fzf-p]*     :<C-u>FzfPreviewLines --add-fzf-arg=--no-sort --add-fzf-arg=--query=\"'<C-r>=expand('<cword>')<CR>\"<CR>\nnnoremap          [fzf-p]gr    :<C-u>FzfPreviewProjectGrep<Space>\nxnoremap          [fzf-p]gr    \"sy:FzfPreviewProjectGrep<Space>-F<Space>\"<C-r>=substitute(substitute(@s, '\\n', '', 'g'), '/', '\\\\/', 'g')<CR>\"\nnnoremap <silent> [fzf-p]t     :<C-u>FzfPreviewBufferTags<CR>\nnnoremap <silent> [fzf-p]q     :<C-u>FzfPreviewQuickFix<CR>\nnnoremap <silent> [fzf-p]l     :<C-u>FzfPreviewLocationList<CR>\n```\n\n#### coc extensions\n\n```vim\nnmap <Leader>f [fzf-p]\nxmap <Leader>f [fzf-p]\n\nnnoremap <silent> [fzf-p]p     :<C-u>CocCommand fzf-preview.FromResources project_mru git<CR>\nnnoremap <silent> [fzf-p]gs    :<C-u>CocCommand fzf-preview.GitStatus<CR>\nnnoremap <silent> [fzf-p]ga    :<C-u>CocCommand fzf-preview.GitActions<CR>\nnnoremap <silent> [fzf-p]b     :<C-u>CocCommand fzf-preview.Buffers<CR>\nnnoremap <silent> [fzf-p]B     :<C-u>CocCommand fzf-preview.AllBuffers<CR>\nnnoremap <silent> [fzf-p]o     :<C-u>CocCommand fzf-preview.FromResources buffer project_mru<CR>\nnnoremap <silent> [fzf-p]<C-o> :<C-u>CocCommand fzf-preview.Jumps<CR>\nnnoremap <silent> [fzf-p]g;    :<C-u>CocCommand fzf-preview.Changes<CR>\nnnoremap <silent> [fzf-p]/     :<C-u>CocCommand fzf-preview.Lines --add-fzf-arg=--no-sort --add-fzf-arg=--query=\"'\"<CR>\nnnoremap <silent> [fzf-p]*     :<C-u>CocCommand fzf-preview.Lines --add-fzf-arg=--no-sort --add-fzf-arg=--query=\"'<C-r>=expand('<cword>')<CR>\"<CR>\nnnoremap          [fzf-p]gr    :<C-u>CocCommand fzf-preview.ProjectGrep<Space>\nxnoremap          [fzf-p]gr    \"sy:CocCommand   fzf-preview.ProjectGrep<Space>-F<Space>\"<C-r>=substitute(substitute(@s, '\\n', '', 'g'), '/', '\\\\/', 'g')<CR>\"\nnnoremap <silent> [fzf-p]t     :<C-u>CocCommand fzf-preview.BufferTags<CR>\nnnoremap <silent> [fzf-p]q     :<C-u>CocCommand fzf-preview.QuickFix<CR>\nnnoremap <silent> [fzf-p]l     :<C-u>CocCommand fzf-preview.LocationList<CR>\n```\n\n### Base Fzf window Keymaps\n\n```text\n<C-g>, <Esc>\n  Cancel fzf\n\n<C-x>\n  Open split\n\n<C-v>\n  Open vsplit\n\n<C-t>\n  Open tabedit\n\n<C-o>\n  Jump to buffer if already open. See :drop.\n  If g:fzf_preview_buffers_jump is set to 1 then it will open the buffer in\n  current window instead.\n\n<C-q>\n  Build QuickFix in open-file processes.\n  Execute :bdelete! command from open-buffer and open-bufnr processes.\n\n<C-d>\n  Preview page down\n\n<C-u>\n  Preview page up\n\n?\n  Toggle display of preview screen\n```\n\n## Customization\n\n### Optional Configuration Tips\n\n- Increase the size of file history:\n\n```vim\n\" oldfiles uses viminfo, but the default setting is 100\n\" Change the number by setting it in viminfo with a single quote.\n\" Ref: viminfo-'\nset viminfo='1000\n```\n\n- Set values for each variable. The default settings are as follows.\n\n```vim\n\" floating window size ratio\nlet g:fzf_preview_floating_window_rate = 0.9\n\n\" fzf window position settings\nlet g:fzf_preview_direct_window_option = ''\n\n\" fzf command default options\nlet g:fzf_preview_default_fzf_options = { '--reverse': v:true, '--preview-window': 'wrap' }\n\n\" Add fzf quit mapping\nlet g:fzf_preview_quit_map = 1\n\n\" jump to the buffers by default, when possible\nlet g:fzf_preview_buffers_jump = 0\n\n\" Commands used for fzf preview.\n\" The file name selected by fzf becomes {}\nlet g:fzf_preview_command = 'cat'                               \" Not installed bat\n\" let g:fzf_preview_command = 'bat --color=always --plain {-1}' \" Installed bat\n\n\" g:fzf_binary_preview_command is executed if this command succeeds, and g:fzf_preview_command is executed if it fails\nlet g:fzf_preview_if_binary_command = '[[ \"$(file --mime {})\" =~ binary ]]'\n\n\" Commands used for binary file\nlet g:fzf_binary_preview_command = 'echo \"{} is a binary file\"'\n\n\" Commands used to get the file list from project\nlet g:fzf_preview_filelist_command = 'git ls-files --exclude-standard'               \" Not Installed ripgrep\n\" let g:fzf_preview_filelist_command = 'rg --files --hidden --follow --no-messages -g \\!\"* *\"' \" Installed ripgrep\n\n\" Commands used to get the file list from git repository\nlet g:fzf_preview_git_files_command = 'git ls-files --exclude-standard'\n\n\" Commands used to get the file list from current directory\nlet g:fzf_preview_directory_files_command = 'rg --files --hidden --follow --no-messages -g \\!\"* *\"'\n\n\" Commands used to get the git status file list\nlet g:fzf_preview_git_status_command = 'git -c color.status=always status --short --untracked-files=all'\n\n\" Commands used for git status preview.\nlet g:fzf_preview_git_status_preview_command =  \"[[ $(git diff --cached -- {-1}) != \\\"\\\" ]] && git diff --cached --color=always -- {-1} || \" .\n\\ \"[[ $(git diff -- {-1}) != \\\"\\\" ]] && git diff --color=always -- {-1} || \" .\n\\ g:fzf_preview_command\n\n\" Commands used for project grep\nlet g:fzf_preview_grep_cmd = 'rg --line-number --no-heading --color=never --hidden'\n\n\" MRU and MRW cache directory\nlet g:fzf_preview_cache_directory = expand('~/.cache/vim/fzf_preview')\n\n\" If this value is not 0, disable mru and mrw\nlet g:fzf_preview_disable_mru = 0\n\n\" Limit of the number of files to be saved by mru\nlet g:fzf_preview_mru_limit = 1000\n\n\" Commands used for current file lines\nlet g:fzf_preview_lines_command = 'cat -n'                                \" Not Installed bat\n\" let g:fzf_preview_lines_command = 'bat --color=always --plain --number' \" Installed bat\n\n\" Commands used for preview of the grep result\nlet g:fzf_preview_grep_preview_cmd = expand('<sfile>:h:h') . '/bin/preview_fzf_grep'\n\n\" Cache directory for mru and mrw\nlet g:fzf_preview_cache_directory = expand('~/.cache/vim/fzf_preview')\n\n\" Keyboard shortcuts while fzf preview is active\nlet g:fzf_preview_preview_key_bindings = ''\n\" let g:fzf_preview_preview_key_bindings = 'ctrl-d:preview-page-down,ctrl-u:preview-page-up,?:toggle-preview'\n\n\" Specify the color of fzf\nlet g:fzf_preview_fzf_color_option = ''\n\n\" Set the processes when selecting an element with fzf\nlet g:fzf_preview_custom_processes = {}\n\" For example, set split to ctrl-s\n\" let g:fzf_preview_custom_processes['open-file'] = fzf_preview#remote#process#get_default_processes('open-file')\n\" on coc extensions\n\" let g:fzf_preview_custom_processes['open-file'] = fzf_preview#remote#process#get_default_processes('open-file', 'coc')\n\" let g:fzf_preview_custom_processes['open-file']['ctrl-s'] = g:fzf_preview_custom_processes['open-file']['ctrl-x']\n\" call remove(g:fzf_preview_custom_processes['open-file'], 'ctrl-x')\n\n\" Use as fzf preview-window option\nlet g:fzf_preview_fzf_preview_window_option = ''\n\" let g:fzf_preview_fzf_preview_window_option = 'up:30%'\n\n\" Use vim-devicons\nlet g:fzf_preview_use_dev_icons = 0\n\n\" Use fzf history option\nlet g:fzf_preview_history_dir = false\n\" let g:fzf_preview_history_dir = '~/.fzf'\n\n\" devicons character width\nlet g:fzf_preview_dev_icon_prefix_string_length = 3\n\n\" Devicons can make fzf-preview slow when the number of results is high\n\" By default icons are disable when number of results is higher that 5000\nlet g:fzf_preview_dev_icons_limit = 5000\n\n\" The theme used in the bat preview\n$FZF_PREVIEW_PREVIEW_BAT_THEME = 'OneHalfDark'\n```\n\n### Command Options\n\nCommented-out lines are settings for the coc extension.\n\n```vim\n--processes\n\" Set process when selecting element with fzf started by this command.\n\" Value must be a global variable name.\n\" Variable is dictionary and format is same as g:fzf_preview_custom_processes['open-file'].\n\"\n\" Most commands are passed a file path to the process function.\n\" FzfPreviewAllBuffers will be passed “buffer {bufnr}”\n\"\n\" Value example: let g:foo_processes = {\n\"                \\ '':       'FzfPreviewOpenFileEnter',\n\"                \\ 'ctrl-x': get(function('s:foo_function'), 'name'),\n\"                \\ }\n\"\n\n--add-fzf-arg\n\" Set the arguments to be passed when executing fzf.\n\" This value is added to the default options.\n\" Value must be a string without spaces.\n\n\" Example: Exclude filename with FzfPreviewProjectGrep\nnnoremap <Leader>g :<C-u>FzfPreviewProjectGrep --add-fzf-arg=--nth=3<Space>\n\" nnoremap <Leader>g :<C-u>CocCommand fzf-preview.ProjectGrep --add-fzf-arg=--nth=3<Space>\n\n\n--resume\n\" Reuse the input that was last used to select the element with fzf.\n\" Do not need to pass a value for this option.\n\n\" Example: Reuse last query for project grep.\nnnoremap <Leader>G :<C-u>FzfPreviewProjectGrep . --resume<Space>\n\" nnoremap <Leader>G :<C-u>CocCommand fzf-preview.ProjectGrep . --resume<Space>\n```\n\n### Function\n\n```vim\n\" Get the initial value of the open file processes\n\" processes_name is 'open-file', 'open-buffer' and 'open-bufnr'.\n\" plugin_type is 'remote', 'coc' or 'rpc'. Default value is 'remote'\ncall fzf_preview#remote#process#get_default_processes({processes_name}, {plugin_type})\n```\n\n## Release note\n\n<details>\n<summary>Changes history</summary>\n\n- 2023/01/02 version 2.16.0\n  - Implement nvim-lsp resources.\n\n- 2021/12/05 version 2.12.0\n  - Implement vim-lsp resources.\n\n- 2022/08/23 version 2.13.0\n  - Implement coc TypeScript go to source definition resource.\n\n- 2021/12/05 version 2.12.0\n  - Implement vim-lsp resources.\n\n- 2021/10/15 version 2.9.0\n  - Implement coc outline resource.\n\n- 2021/09/10 version 2.7.0\n  - Implement vim help resource.\n\n- 2021/09/08 version 2.6.0\n  - Improve project files performance\n\n- 2021/06/06 version 2.5.0\n  - Implement --experimental-fast option.\n\n- 2021/06/04 version 2.4.0\n  - Implement [todo-comments.nvim](https://github.com/folke/todo-comments.nvim) resource.\n\n- 2021/05/19 version 2.3.0\n  - Implement fzf history option.\n\n- 2021/05/18 version 2.2.0\n  - Implement grep recall.\n\n- 2021/01/16 version 2.0.7\n  - Implement coc implementations resource.\n\n- 2021/01/16 version 2.0.6\n  - Implement [memolist.vim](https://github.com/glidenote/memolist.vim) resource.\n\n- 2021/01/10 version 2.0.0\n  - Release of stable version.\n  - Change release from github actions.\n  - Update latest npm packages.\n\n- 2021/01/06 version 0.6.0\n  - Update coc.nvim package version to 0.0.80.\n\n- 2020/12/31 version 0.5.0\n  - Implement Vim script RPC\n    - Only need Vim and Node\n  - **Breaking change**: The release branch of the Remote Plugin has been changed to release/remote.\n\n- 2020/11/08 version 0.4.27\n  - Add g:fzf_preview_direct_window_option option.\n\n- 2020/11/07 version 0.4.26\n  - Change buffer sort with mru order.\n  - Add mru and mrw limit settings.\n  - Improve grep preview highlight.\n\n- 2020/10/30 version 0.4.24\n  - Improved grep etc previews to scroll to the top of the file.\n\n- 2020/10/4 version 0.4.20\n  - Implement CommandPalette resource.\n\n- 2020/10/4 version 0.4.17\n  - Implement CocTypeDefinitions resource.\n\n- 2020/07/30 version 0.4.7\n  - Implement git reflog integration.\n\n- 2020/07/30 version 0.4.6\n  - Implement git stash integration.\n  - Implement rename git branch.\n\n- 2020/07/27 version 0.4.1\n  - Implement create git branch.\n\n- 2020/07/27 version 0.4.0\n  - Implement interactive git integration. (`:FzfPreviewGitActions` and `:CocCommand fzf-preview.GitActions`)\n\n- 2020/07/24 version 0.3.2\n  - Remove g:fzf_preview_filelist_postprocess_command and to colorize the fzf window by default\n\n- 2020/07/24 version 0.2.1\n  - Change g:fzf_preview_default_fzf_options and g:fzf_preview_fzf_preview_window_option default value.\n  - Fix export quickfix bug in grep.\n\n- 2020/07/23 version 0.2.0\n  - Improving the internal data structure.\n  - Remove `FzfPreviewProjectCommandGrep` command. (Changes to the data structure have made implementation difficult)\n  - Some bug fixes.\n\n</details>\n\n## Others\n\n- How to use fish user?\n  - Set the `set shell` and `$SHELL`.\n\n```vim\nset shell=/bin/zsh\nlet $SHELL = \"/bin/zsh\"\n```\n\n- Use true color preview in Neovim\n  - Set the preview command to `COLORTERM=truecolor`\n\n```vim\naugroup fzf_preview\n  autocmd!\n  autocmd User fzf_preview#rpc#initialized call s:fzf_preview_settings() \" fzf_preview#remote#initialized or fzf_preview#coc#initialized\naugroup END\n\nfunction! s:fzf_preview_settings() abort\n  let g:fzf_preview_command = 'COLORTERM=truecolor ' . g:fzf_preview_command\n  let g:fzf_preview_grep_preview_cmd = 'COLORTERM=truecolor ' . g:fzf_preview_grep_preview_cmd\nendfunction\n```\n\n- `FzfPreviewVistaBufferCtags` does not work\n  - Vista must be initialized. Run the Vista command once or write the following settings.\n\n```vim\nautocmd VimEnter * call vista#RunForNearestMethodOrFunction()\n```\n\n## License\n\nThe MIT License (MIT)\n"
  },
  {
    "path": "autoload/fzf_preview/remote/consumer/git.vim",
    "content": "\" using pseudo synchronous call in Vim8 because Vim8 asynchronous call is unstable\nfunction! s:execute(command) abort\n  if !has('nvim')\n    call feedkeys(':' . a:command . \"\\n\", 'n')\n  else\n    execute a:command\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#add(file) abort\n  call system('git add ' . shellescape(a:file))\n  if v:shell_error\n    echomsg 'Failed: git add ' . a:file\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#add_intent_to_add(file) abort\n  call system('git add --intent-to-add ' . shellescape(a:file))\n  if v:shell_error\n    echomsg 'Failed: git add --intent-to-add ' . a:file\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#reset(file, option) abort\n  if a:option !=# ''\n    let command = 'git reset ' . a:option . ' ' . shellescape(a:file)\n  else\n    let command = 'git reset ' . shellescape(a:file)\n  endif\n\n  call system(command)\n\n  if v:shell_error\n    echomsg 'Failed: ' . command\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#reset_intent_to_add(file) abort\n  call system('git reset --intent-to-add ' . shellescape(a:file))\n  if v:shell_error\n    echomsg 'Failed: git reset --intent-to-add ' . a:file\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#patch(file) abort\n  if exists(':Gin') == 2\n    tabedit\n    call s:execute('GinPatch ' . fnamemodify(a:file, ':p'))\n    return\n  elseif exists(':Gina') == 2\n    call s:execute('Gina patch ' . fnamemodify(a:file, ':p'))\n    return\n  elseif exists(':Git') != 0\n    execute 'tabedit ' . a:file . ' | Git diff'\n    return\n  endif\n\n  echoerr 'Gin, Gina and Fugitive not installed'\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#chaperon(file) abort\n  if exists(':Gin') == 2\n    tabedit\n    call s:execute('GinChaperon ' . fnamemodify(a:file, ':p'))\n    return\n  elseif exists(':Gina') == 2\n    call s:execute('Gina chaperon ' . fnamemodify(a:file, ':p'))\n    return\n  endif\n\n  echoerr 'Gin and Gina not installed'\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#commit(option) abort\n  if match(a:option, '--fixup') != -1\n    echomsg system('git commit ' . a:option)\n    return\n  elseif exists(':Gin') == 2\n    call s:execute('Gin commit --verbose ' . a:option)\n    return\n  elseif exists(':Gina') == 2\n    call s:execute('Gina commit --verbose ' . a:option)\n    return\n  elseif exists(':Git') == 2\n    execute 'Git commit --verbose ' . a:option\n    return\n  endif\n\n  echoerr 'Gin, Gina and Fugitive not installed'\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#restore(file) abort\n  if exists(':Gin') == 2\n    call s:execute('Gin checkout -- ' . fnamemodify(a:file, ':p'))\n    return\n  elseif exists(':Gina') == 2\n    call s:execute('Gina checkout -- ' . fnamemodify(a:file, ':p'))\n    return\n  elseif exists(':Git') == 2\n    execute 'Git checkout -- ' . a:file\n    return\n  else\n    call system('git checkout -- ' . shellescape(a:file))\n    if v:shell_error\n      echomsg 'Failed: git checkout -- ' . a:file\n    endif\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#switch(branch) abort\n  if exists(':Gin') == 2\n    call s:execute('Gin checkout ' . a:branch)\n    return\n  elseif exists(':Gina') == 2\n    call s:execute('Gina checkout ' . a:branch)\n    return\n  elseif exists(':Git') == 2\n    execute 'Git checkout ' . a:branch\n    return\n  else\n    call system('git checkout ' . shellescape(a:branch))\n    if v:shell_error\n      echomsg 'Failed: git checkout ' . a:branch\n    endif\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#create_branch() abort\n  let branch_name = input('Branch name: ')\n  if branch_name !=# ''\n    echomsg system('git checkout -b ' . shellescape(branch_name))\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#diff(branch, ...) abort\n  let branch2 = get(a:, 1, '')\n\n  if exists(':Gin') == 2\n    execute 'silent GinDiff ' . a:branch . '..' . branch2\n    echomsg 'git diff ' . a:branch . '..' . branch2\n    return\n  elseif exists(':Gina') == 2\n    execute 'silent Gina diff ' . a:branch . '..' . branch2\n    echomsg 'git diff ' . a:branch . '..' . branch2\n    return\n  elseif exists(':Git') == 2\n    execute 'silent Git diff ' . a:branch . '..' . branch2\n    echomsg 'git diff ' . a:branch . '..' . branch2\n    return\n  endif\n\n  echoerr 'Gin, Gina and Fugitive not installed'\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#show(name_or_hash) abort\n  \" TODO: Until GinShow is implemented in gin, gina is the priority\n  if exists(':Gina') == 2\n    call s:execute('Gina show ' . a:name_or_hash)\n    return\n  elseif exists(':Gin') == 2\n    call s:execute('GinBuffer show ' . a:name_or_hash)\n    return\n  elseif exists(':Git') == 2\n    execute 'Git show ' . a:name_or_hash\n    return\n  endif\n\n  echoerr 'Gin, Gina and Fugitive not installed'\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#merge(branch, option) abort\n  if exists(':Gin') == 2\n    call s:execute('Gin merge ' . a:option . ' ' . a:branch)\n    return\n  elseif exists(':Gina') == 2\n    call s:execute('Gina merge ' . a:option . ' ' . a:branch)\n    return\n  elseif exists(':Git') == 2\n    execute 'Git merge ' . a:option . ' ' . a:branch\n    return\n  endif\n\n  echoerr 'Gin, Gina and Fugitive not installed'\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#rebase(branch) abort\n  if exists(':Gin') == 2\n    call s:execute('Gin rebase ' . a:branch)\n    return\n  elseif exists(':Gina') == 2\n    call s:execute('Gina rebase ' . a:branch)\n    return\n  elseif exists(':Git') == 2\n    execute 'Git rebase ' . a:branch\n    return\n  endif\n\n  echoerr 'Fugitive and Gina not installed'\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#rebase_interactive(branch_or_hash) abort\n  if exists(':Gin') == 2\n    execute 'Gin rebase --interactive ' . a:branch_or_hash\n    return\n  elseif exists(':Git') == 2\n    execute 'Git rebase --interactive ' . a:branch_or_hash\n    return\n  endif\n\n  echoerr 'Gin and Fugitive not installed'\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#push(option) abort\n  echomsg system('git push ' . a:option)\n  if v:shell_error\n    echomsg 'Failed: git push ' . a:option\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#fetch() abort\n  echomsg system('git fetch')\n  if v:shell_error\n    echomsg 'Failed: git fetch'\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#delete_branch(branch, option) abort\n  echomsg system('git branch --delete ' . a:option . ' ' . shellescape(a:branch))\n  if v:shell_error\n    echomsg 'Failed: git branch --delete ' . a:option . ' ' . a:branch\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#rename_branch(src) abort\n  let dest = input('Branch name: ')\n  if dest !=# ''\n    let command = 'git branch -m ' . shellescape(a:src) . ' ' . dest\n    echo system(command)\n\n    if v:shell_error\n      echomsg 'Failed: ' . command\n    endif\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#stash_apply(stash) abort\n  let command = 'git stash apply ' . shellescape(a:stash)\n  echo system(command)\n\n  if v:shell_error\n    echomsg 'Failed: ' . command\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#stash_pop(stash) abort\n  let command = 'git stash pop ' . shellescape(a:stash)\n  echo system(command)\n\n  if v:shell_error\n    echomsg 'Failed: ' . command\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#stash_drop(stash) abort\n  let command = 'git stash drop ' . shellescape(a:stash)\n  echo system(command)\n\n  if v:shell_error\n    echomsg 'Failed: ' . command\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#stash_create() abort\n  let message = input('Message: ')\n  if  message !=# ''\n    let command = 'git stash save \"' . message . '\"'\n  else\n    let command = 'git stash save'\n  endif\n\n  echo system(command)\n\n  if v:shell_error\n    echomsg 'Failed: ' . command\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#pull() abort\n  echomsg system('git pull')\n  if v:shell_error\n    echomsg 'Failed: git pull'\n  endif\nendfunction\n\nfunction! fzf_preview#remote#consumer#git#yank(branch) abort\n  let hash = system('git rev-parse ' . shellescape(a:branch))\n  call fzf_preview#remote#consumer#register#set(hash, 'v')\n  echomsg 'yanked ' a:branch . ' branch hash: ' . hash\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/consumer/register.vim",
    "content": "function! fzf_preview#remote#consumer#register#set(str, options) abort\n  call setreg('\"', a:str, a:options)\nendfunction\n\nfunction! fzf_preview#remote#consumer#register#paste(str, options) abort\n  call setreg('\"', a:str, a:options)\n  normal! \"\"p\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/exec_fzf.vim",
    "content": "function! fzf_preview#remote#exec_fzf#exec(command, env, ...) abort\n  let session_token = get(a:, 1, '')\n\n  if a:env ==# 'remote'\n    if session_token !=# ''\n      execute a:command . ' --session=' . session_token\n    else\n      execute a:command\n    endif\n  elseif a:env ==# 'coc'\n    let command_name = substitute(a:command, '^FzfPreview', 'fzf-preview.', '')\n    if session_token !=# ''\n      execute 'CocCommand ' . command_name . ' --session=' . session_token\n    else\n      execute 'CocCommand ' . command_name\n    endif\n  elseif a:env ==# 'rpc'\n    if session_token !=# ''\n      execute a:command . 'Rpc --session=' . session_token\n    else\n      execute a:command . 'Rpc'\n    endif\n  endif\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/handler_to_process.vim",
    "content": "function! fzf_preview#remote#handler_to_process#call_funcref_or_fallback_default_process(env, default_process_function_name, expect_key, lines, process_name) abort\n  if a:env ==# 'remote'\n    call s:call_remote_plugin(a:default_process_function_name, a:expect_key, a:lines, a:process_name)\n  elseif a:env ==# 'coc'\n    call s:call_coc(a:default_process_function_name, a:expect_key, a:lines, a:process_name)\n  elseif a:env ==# 'rpc'\n    call s:call_rpc(a:default_process_function_name, a:expect_key, a:lines, a:process_name)\n  endif\nendfunction\n\nfunction! s:call_remote_plugin(default_process_function_name, expect_key, lines, process_name) abort\n  if (a:process_name == v:null)\n    call call(a:default_process_function_name, [a:lines])\n  else\n    let processes = eval('g:' . a:process_name)\n    let Process = processes[a:expect_key]\n\n    if type(Process) == v:t_string\n      if exists('*' . Process)\n        call call(Process, [a:lines])\n      else\n        call fzf_preview#rpc#exec_process_callback(Process, a:lines)\n      endif\n    elseif type(Process) == v:t_func\n      call Process(a:lines)\n    endif\n  endif\nendfunction\n\nfunction! s:call_coc(default_process_function_name, expect_key, lines, process_name) abort\n  if (a:process_name == v:null)\n    let process_name = substitute(a:default_process_function_name, '^FzfPreview', '', '')\n    call CocAction('runCommand', 'fzf-preview-callback.' . process_name, [a:lines])\n  else\n    let processes = eval('g:' . a:process_name)\n    let Process = processes[a:expect_key]\n\n    if type(Process) == v:t_string\n      let Process = substitute(Process, '^FzfPreview', '', '')\n      if exists('*' . Process)\n        call call(Process, [a:lines])\n      else\n        call CocAction('runCommand', 'fzf-preview-callback.' . Process, [a:lines])\n      endif\n    elseif type(Process) == v:t_func\n      call Process(a:lines)\n    endif\n  endif\nendfunction\n\nfunction! s:call_rpc(default_process_function_name, expect_key, lines, process_name) abort\n  if (a:process_name == v:null)\n    call fzf_preview#rpc#exec_process_callback(a:default_process_function_name, a:lines)\n  else\n    let processes = eval('g:' . a:process_name)\n    let Process = processes[a:expect_key]\n\n    if type(Process) == v:t_string\n      if exists('*' . Process)\n        call call(Process, [a:lines])\n      else\n        call fzf_preview#rpc#exec_process_callback(Process, a:lines)\n      endif\n    elseif type(Process) == v:t_func\n      call Process(a:lines)\n    endif\n  endif\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/mr.vim",
    "content": "function! fzf_preview#remote#mr#append(path, cache_path) abort\n  let files = s:get_files_with_create_directory(a:cache_path)\n\n  call insert(files, a:path)\n  call writefile(fzf_preview#remote#util#uniq(files)[:g:fzf_preview_mru_limit - 1], a:cache_path)\nendfunction\n\nfunction! fzf_preview#remote#mr#mru_file_path() abort\n  return g:fzf_preview_cache_directory . '/mru'\nendfunction\n\nfunction! fzf_preview#remote#mr#mrw_file_path() abort\n  return g:fzf_preview_cache_directory . '/mrw'\nendfunction\n\nfunction! s:get_files_with_create_directory(cache_path) abort\n  if !isdirectory(g:fzf_preview_cache_directory)\n    call mkdir(g:fzf_preview_cache_directory, 'p')\n  endif\n\n  try\n    let files = readfile(a:cache_path)\n  catch\n    let files = []\n  endtry\n\n  return files\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/process.vim",
    "content": "function! fzf_preview#remote#process#get_default_processes(name, ...) abort\n  let env = get(a:, 1, 'remote')\n\n  if env ==# 'remote'\n    return FzfPreviewGetDefaultProcesses(a:name)\n  elseif env ==# 'coc'\n    return CocAction('runCommand', 'fzf-preview.GetDefaultProcesses', [a:name])\n  elseif env ==# 'rpc'\n    return fzf_preview#rpc#get_default_processes(a:name)\n  endif\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/all_buffers.vim",
    "content": "function! fzf_preview#remote#resource#all_buffers#get() abort\n  let buffers = []\n  for bufinfo in copy(getbufinfo())\n    let buffer = {\n    \\ 'name': fnamemodify(bufinfo['name'], ':.'),\n    \\ 'bufnr': bufinfo['bufnr'],\n    \\ }\n    call add(buffers, buffer)\n  endfor\n\n  let buffers = map(copy(getbufinfo({ 'buflisted': 1 })),\n  \\ { _, buffer -> {\n  \\     'fileName': fnamemodify(buffer['name'], ':.'),\n  \\     'bufnr': buffer['bufnr'],\n  \\     'isCurrent': v:false,\n  \\     'isAlternate': v:false,\n  \\     'isModified': v:false,\n  \\   }\n  \\ }\n  \\ )\n\n  return buffers\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/bookmarks.vim",
    "content": "function! fzf_preview#remote#resource#bookmarks#get() abort\n  return filter(map(bm#location_list(), {\n \\ _, b -> s:bookmarks_format_line(b)\n \\ }), {\n \\ _, b -> b.file !=# ''\n \\ })\nendfunction\n\nfunction! s:bookmarks_format_line(line) abort\n  let line = split(a:line, ':')\n  let filename = fnamemodify(line[0], ':.')\n  if !filereadable(filename)\n    return { 'file': '' }\n  endif\n\n  let line_number = line[1]\n  let text = line[2]\n\n  if text ==# 'Annotation'\n    let comment = line[3]\n  else\n    let text = join(line[2:], ':')\n  endif\n\n  if text !=# 'Annotation'\n    return { 'file': filename, 'line': line_number, 'text': text, 'comment': '' }\n  else\n    return { 'file': filename, 'line': line_number, 'text': text, 'comment': comment }\n  endif\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/buffers.vim",
    "content": "function! fzf_preview#remote#resource#buffers#get_other_buffers() abort\n  let list = filter(range(1, bufnr('$')),\n  \\ { _, bufnr -> bufexists(bufnr) && buflisted(bufnr) && filereadable(expand('#' . bufnr . ':p')) && bufnr != bufnr('%') && bufnr != bufnr('#')}\n  \\ )\n\n  return map(list, { _, bufnr -> s:bufnr_to_bufinfo(bufnr) })\nendfunction\n\nfunction! fzf_preview#remote#resource#buffers#get_current_buffer() abort\n  return s:bufnr_to_bufinfo(bufnr('%'))\nendfunction\n\nfunction! fzf_preview#remote#resource#buffers#get_alternate_buffer() abort\n  return s:bufnr_to_bufinfo(bufnr('#'))\nendfunction\n\nfunction! fzf_preview#remote#resource#buffers#get() abort\n  let list = filter(range(1, bufnr('$')),\n  \\ { _, bufnr -> bufexists(bufnr) && buflisted(bufnr) && filereadable(expand('#' . bufnr . ':p'))}\n  \\ )\n\n  return map(list, { _, bufnr -> s:bufnr_to_bufinfo(bufnr) })\nendfunction\n\nfunction! s:bufnr_to_bufinfo(bufnr) abort\n  let name = bufname(a:bufnr)\n  let is_current = a:bufnr == bufnr('%')\n  let is_alternate = a:bufnr == bufnr('#')\n  let is_modified = getbufvar(a:bufnr, '&modified')\n\n  return {\n  \\ 'fileName': name,\n  \\ 'bufnr': a:bufnr,\n  \\ 'isCurrent': is_current == 1 ? v:true : v:false,\n  \\ 'isAlternate': is_alternate == 1 ? v:true : v:false,\n  \\ 'isModified': is_modified == 1 ? v:true : v:false,\n  \\ }\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/changes.vim",
    "content": "function! fzf_preview#remote#resource#changes#get() abort\n  if !filereadable(expand('%'))\n    return []\n  endif\n\n  let list = []\n  let lnums = map(copy(getchangelist('%')[0]), { _, change -> change['lnum'] })\n  for lnum in lnums\n    let lines = getbufline(bufnr('%'), lnum)\n    if len(lines) > 0\n      call add(list, lnum . ' ' . lines[0])\n    endif\n  endfor\n\n  call reverse(list)\n  let list = fzf_preview#remote#util#uniq(list)\n\n  return list\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/directory_files.vim",
    "content": "function! fzf_preview#remote#resource#directory_files#get(command) abort\n  return systemlist(a:command)\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/git_files.vim",
    "content": "function! fzf_preview#remote#resource#git_files#get(command) abort\n  return systemlist(a:command)\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/git_status.vim",
    "content": "function! fzf_preview#remote#resource#git_status#get(command) abort\n  return systemlist(a:command)\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/grep.vim",
    "content": "function! fzf_preview#remote#resource#grep#get(command) abort\n  return systemlist(a:command)\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/jumps.vim",
    "content": "function! fzf_preview#remote#resource#jumps#get() abort\n  let splitted_project_path = split(fzf_preview#remote#util#project_root(), '/')\n  let bufnr_and_lnum_list = map(copy(getjumplist()[0]), {\n  \\ _, jump -> { 'bufnr': jump['bufnr'], 'lnum': jump['lnum'] }\n  \\ })\n\n  let result = fzf_preview#remote#util#bufnr_and_lnum_to_resource(bufnr_and_lnum_list, splitted_project_path)\n\n  call reverse(result)\n  return result\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/lines.vim",
    "content": "function! fzf_preview#remote#resource#lines#get(command) abort\n  return systemlist(a:command)\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/marks.vim",
    "content": "function! fzf_preview#remote#resource#marks#get() abort\n  let splitted_project_path = split(fzf_preview#remote#util#project_root(), '/')\n\n  let chars = [\n  \\ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',\n  \\ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',\n  \\ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n  \\ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n  \\ ]\n\n  let bufnr_and_lnum_list = map(map(copy(chars), {\n  \\ _, char -> getpos(\"'\" . char)\n  \\ }), {\n  \\ _, pos -> { 'bufnr': pos[0] == 0 ? bufnr('%') : pos[0], 'lnum': pos[1] }\n  \\ })\n  call filter(bufnr_and_lnum_list, { _, bufnr_and_lnum -> bufnr_and_lnum['lnum'] != 0 })\n\n  let result = fzf_preview#remote#util#bufnr_and_lnum_to_resource(bufnr_and_lnum_list, splitted_project_path)\n  return result\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/memolist.vim",
    "content": "function! fzf_preview#remote#resource#memolist#files() abort\n  return memolist#files()\nendfunction\n\nfunction! fzf_preview#remote#resource#memolist#grep(command) abort\n  return systemlist(a:command. ' ' . g:memolist_path)\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/project_files.vim",
    "content": "function! fzf_preview#remote#resource#project_files#get(command) abort\n  return systemlist(a:command)\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/quickfix_and_locationlist.vim",
    "content": "function! fzf_preview#remote#resource#quickfix_and_locationlist#get(type) abort\n  let lines = s:get_quickfix_or_locationlist_lines(a:type)\n\n  if !empty(filter(lines, { _, line -> line !=# '' }))\n    return lines\n  else\n    return []\n  endif\nendfunction\n\nfunction! s:get_quickfix_or_locationlist_lines(type) abort\n  let qf_or_loc_lists = s:get_quickfix_or_loclist(a:type)\n\n  if len(qf_or_loc_lists) != 0\n    return len(qf_or_loc_lists) > 0 ? getbufline(qf_or_loc_lists[0]['bufnr'], 1, '$') : []\n  endif\n\n  return s:open_process_with_qf_and_close(a:type, { type -> s:get_quickfix_or_locationlist_lines(type) })\nendfunction\n\nfunction! s:get_quickfix_or_loclist(type) abort\n  return filter(getwininfo(), { _, w -> w['tabnr'] == tabpagenr() && getwinvar(w['winnr'], '&filetype') ==# 'qf' && w[a:type]})\nendfunction\n\nfunction! s:open_process_with_qf_and_close(type, F) abort\n  let winid = win_getid()\n\n  if a:type ==# 'quickfix'\n    copen\n  elseif a:type ==# 'loclist'\n    try\n      lopen\n    catch\n      return []\n    endtry\n  else\n    return []\n  endif\n\n  call win_gotoid(winid)\n\n  let result = a:F(a:type)\n\n  if a:type ==# 'quickfix'\n    cclose\n  elseif a:type ==# 'loclist'\n    lclose\n  endif\n\n  return result\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/tags.vim",
    "content": "function! fzf_preview#remote#resource#tags#ctags() abort\n  return s:read_tag_file()\nendfunction\n\nfunction! s:read_tag_file() abort\n  let lines = []\n  let files = filter(s:get_tag_files(), { _, file -> filereadable(file) })\n  for file in files\n    let lines = lines + filter(readfile(file), { _, line -> match(line, '^!') == -1 })\n  endfor\n\n  call map(lines, { _, line -> s:parse_tagline(line) })\n  return lines\nendfunction\n\nfunction! s:get_tag_files() abort\n  return split(&tags, ',')\nendfunction\n\nfunction! s:parse_tagline(line) abort\n  let elem = split(a:line, '\\t')\n  let file_path = fnamemodify(elem[1], ':.')\n\n  let match = matchlist(elem[2], '^\\(\\d\\+\\);\"')\n\n  try\n    let info = {\n    \\ 'name': elem[0],\n    \\ 'file': file_path,\n    \\ 'line': match[1],\n    \\ 'type': elem[3],\n    \\ }\n  catch\n    throw 'Set excmd=number or excmd=combine in universal-ctags options'\n  endtry\n\n  return info\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/todo_comments.vim",
    "content": "function! fzf_preview#remote#resource#todo_comments#get() abort\n  lua vim.g.fzf_preview_todo_keywords = vim.fn.keys((require('todo-comments.config').keywords))\n  return g:fzf_preview_todo_keywords\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/util.vim",
    "content": "function! fzf_preview#remote#resource#util#exec_command(command) abort\n  return systemlist(a:command)\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/vim_command.vim",
    "content": "function! fzf_preview#remote#resource#vim_command#commands() abort\n  return map(getcompletion('', 'command'), {_, command -> {\n  \\   'name': command,\n  \\   'number': v:null,\n  \\ }})\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_command#history() abort\n  let commands = filter(map(range(1, max([0, histnr(':')])), {_, index -> histget(':', index)}), {_, command -> command !=# ''})\n  return map(reverse(commands), {index, command -> {\n  \\   'name': command,\n  \\   'number': index + 1,\n  \\ }})\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_command#exec(command) abort\n  echo a:command\n  execute a:command\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_command#edit(command) abort\n  call histadd(':', a:command)\n  redraw\n  call feedkeys(\":\\<Up>\", 'n')\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/vim_lsp.vim",
    "content": "let s:references = {}\nlet s:definition = {}\nlet s:type_definition = {}\nlet s:implementation = {}\n\nfunction! fzf_preview#remote#resource#vim_lsp#servers(method) abort\n  return filter(lsp#get_allowed_servers(), 'lsp#capabilities#has_' . a:method . '_provider(v:val)')\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_lsp#request_references(servers) abort\n  let s:references = {}\n\n  let command_id = lsp#_new_command()\n  let ctx = {\n  \\ 'counter': len(a:servers),\n  \\ 'list':[],\n  \\ 'last_command_id': command_id,\n  \\ 'mods': '',\n  \\ 'in_preview': 0,\n  \\ 'jump_if_one': 0,\n  \\ }\n\n  let params = {\n  \\ 'textDocument': lsp#get_text_document_identifier(),\n  \\ 'position': lsp#get_position(),\n  \\ 'context': {'includeDeclaration': v:false},\n  \\ }\n\n  for server in a:servers\n    call lsp#send_request(server, {\n    \\ 'method': 'textDocument/references',\n    \\ 'params': params,\n    \\ 'on_notification': function('s:handle_references', [ctx, server, 'references']),\n    \\ })\n  endfor\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_lsp#request_definition(servers) abort\n  let s:definition = {}\n\n  let command_id = lsp#_new_command()\n  let ctx = {\n  \\ 'counter': len(a:servers),\n  \\ 'list':[],\n  \\ 'last_command_id': command_id,\n  \\ 'mods': '',\n  \\ 'in_preview': 0,\n  \\ 'jump_if_one': 0,\n  \\ }\n\n  let params = {\n  \\ 'textDocument': lsp#get_text_document_identifier(),\n  \\ 'position': lsp#get_position(),\n  \\ }\n\n  for server in a:servers\n    call lsp#send_request(server, {\n    \\ 'method': 'textDocument/definition',\n    \\ 'params': params,\n    \\ 'on_notification': function('s:handle_definition', [ctx, server, 'definition']),\n    \\ })\n  endfor\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_lsp#request_type_definition(servers) abort\n  let s:type_definition = {}\n\n  let command_id = lsp#_new_command()\n  let ctx = {\n  \\ 'counter': len(a:servers),\n  \\ 'list':[],\n  \\ 'last_command_id': command_id,\n  \\ 'mods': '',\n  \\ 'in_preview': 0,\n  \\ 'jump_if_one': 0,\n  \\ }\n\n  let params = {\n  \\ 'textDocument': lsp#get_text_document_identifier(),\n  \\ 'position': lsp#get_position(),\n  \\ }\n\n  for server in a:servers\n    call lsp#send_request(server, {\n    \\ 'method': 'textDocument/typeDefinition',\n    \\ 'params': params,\n    \\ 'on_notification': function('s:handle_type_definition', [ctx, server, 'typeDefinition']),\n    \\ })\n  endfor\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_lsp#request_implementation(servers) abort\n  let s:implementation = {}\n\n  let command_id = lsp#_new_command()\n  let ctx = {\n  \\ 'counter': len(a:servers),\n  \\ 'list':[],\n  \\ 'last_command_id': command_id,\n  \\ 'mods': '',\n  \\ 'in_preview': 0,\n  \\ 'jump_if_one': 0,\n  \\ }\n\n  let params = {\n  \\ 'textDocument': lsp#get_text_document_identifier(),\n  \\ 'position': lsp#get_position(),\n  \\ }\n\n  for server in a:servers\n    call lsp#send_request(server, {\n    \\ 'method': 'textDocument/implementation',\n    \\ 'params': params,\n    \\ 'on_notification': function('s:handle_implementation', [ctx, server, 'implementation']),\n    \\ })\n  endfor\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_lsp#fetch_references() abort\n  return s:references\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_lsp#fetch_definition() abort\n  return s:definition\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_lsp#fetch_type_definition() abort\n  return s:type_definition\nendfunction\n\nfunction! fzf_preview#remote#resource#vim_lsp#fetch_implementation() abort\n  return s:implementation\nendfunction\n\nfunction! s:handle_references(ctx, server, type, data) abort\n  let s:references[a:data['server_name']] = a:data['response']['result']\nendfunction\n\nfunction! s:handle_definition(ctx, server, type, data) abort\n  let s:definition[a:data['server_name']] = a:data['response']['result']\nendfunction\n\nfunction! s:handle_type_definition(ctx, server, type, data) abort\n  let s:type_definition[a:data['server_name']] = a:data['response']['result']\nendfunction\n\nfunction! s:handle_implementation(ctx, server, type, data) abort\n  let s:implementation[a:data['server_name']] = a:data['response']['result']\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/vista.vim",
    "content": "function! fzf_preview#remote#resource#vista#ctags() abort\n  let result = vista#executive#ctags#ProjectRun()\n  let keys = keys(result)\n  let source = []\n\n  let index = 0\n  while index < len(keys)\n    let kind = keys[index]\n    let values = result[kind]\n\n    for value in values\n      call add(source, { 'lineNumber': value['lnum'], 'kind': kind, 'text': value['text'], 'tagFile': value['tagfile'] })\n    endfor\n\n    let index = index + 1\n  endwhile\n\n  return source\nendfunction\n\nfunction! fzf_preview#remote#resource#vista#buffer_ctags() abort\n  let result = vista#executive#ctags#Run(expand('%:p'))\n  let keys = keys(result)\n  let source = []\n\n  let index = 0\n  while index < len(keys)\n    let kind = keys[index]\n    let values = result[kind]\n\n    for value in values\n      call add(source, { 'lineNumber': value['lnum'], 'kind': kind, 'text': value['text'], 'line': getline(value['lnum']) })\n    endfor\n\n    let index = index + 1\n  endwhile\n\n  return source\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/resource/yankround.vim",
    "content": "function! fzf_preview#remote#resource#yankround#get() abort\n  let histories = map(copy(g:_yankround_cache), 'split(v:val, \"\\t\", 1)')\n  return map(histories, { key, val -> { 'line': key + 1, 'option': val[0], 'text': get(val, 1) } })\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/runner.vim",
    "content": "function! fzf_preview#remote#runner#fzf_run(params) abort\n  let source = a:params['source']\n  let options = a:params['options']\n  let handler = a:params['handler']\n  let env = a:params['environment']\n\n  if env ==# 'remote'\n    let Sink = function('s:handler_wrapper', [handler])\n  elseif env ==# 'coc'\n    let Sink = function('s:coc_handler')\n  elseif env ==# 'rpc'\n    let Sink = function('fzf_preview#rpc#rpc_handler')\n  endif\n\n  let window = !empty(g:fzf_preview_direct_window_option) ?\n        \\  g:fzf_preview_direct_window_option :\n        \\  { 'width': g:fzf_preview_floating_window_rate, 'height': g:fzf_preview_floating_window_rate }\n\n  call feedkeys(\"\\<Cmd>nohlsearch\\<CR>\", 'nit')\n\n  call fzf#run({\n  \\ 'source':  source,\n  \\ 'sink*':   Sink,\n  \\ 'options': options,\n  \\ 'window':  window,\n  \\ })\nendfunction\n\nfunction! s:handler_wrapper(handler, lines) abort\n  call feedkeys('', 'x')\n  call call(a:handler, [a:lines])\nendfunction\n\nfunction! s:coc_handler(lines) abort\n  call feedkeys('', 'x')\n  call CocAction('runCommand', 'fzf-preview.HandleResource', [a:lines])\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/tagstack.vim",
    "content": "function! fzf_preview#remote#tagstack#push_tag_stack() abort\n  let from = [bufnr('%'), line('.'), col('.'), 0]\n  let tagname = expand('<cword>')\n  let winid = win_getid()\n  call settagstack(winid, {'items': [{'from': from, 'tagname': tagname}]}, 'a')\n  call settagstack(winid, {'curidx': len(gettagstack(winid)['items']) + 1})\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/util.vim",
    "content": "function! fzf_preview#remote#util#is_git_directory() abort\n  let git_root = system('git rev-parse --show-toplevel 2>/dev/null')\n  if git_root ==# ''\n    return v:false\n  else\n    return v:true\n  endif\nendfunction\n\nfunction! fzf_preview#remote#util#project_root() abort\n  let git_root = system('git rev-parse --show-toplevel 2>/dev/null')\n  if git_root ==# ''\n    echomsg 'The current directory is not a git project'\n    return ''\n  endif\n\n  return strpart(git_root, 0, strlen(git_root) - 1)\nendfunction\n\nfunction! fzf_preview#remote#util#is_project_file(file, splitted_project_path) abort\n  let splitted_file_path = split(a:file, '/')\n  if len(splitted_file_path) == 0\n    return 0\n  endif\n\n  let is_project_file = 1\n  let index = 0\n  for dir_name in a:splitted_project_path[:len(splitted_file_path) - 1]\n    if dir_name !=# splitted_file_path[index]\n      let is_project_file = 0\n    endif\n    let index = index + 1\n  endfor\n\n  return is_project_file\nendfunction\n\nfunction! fzf_preview#remote#util#bufnr_and_lnum_to_resource(bufnr_and_lnum_list, splitted_project_path) abort\n  let result = []\n  for bufnr_and_lnum in a:bufnr_and_lnum_list\n    let bufnr = bufnr_and_lnum['bufnr']\n    let lnum = bufnr_and_lnum['lnum']\n    let bufinfos = getbufinfo(bufnr)\n\n    if len(bufinfos) > 0\n      let bufinfo = bufinfos[0]\n      let file = bufinfo['name']\n\n      if fzf_preview#remote#util#is_project_file(file, a:splitted_project_path) && filereadable(file)\n        let file = fnamemodify(file, ':.')\n        let line_number = lnum\n        let lines = getbufline(bufname(bufnr), lnum)\n\n        if len(lines) > 0\n          let text = lines[0]\n        else\n          let text = ''\n        endif\n\n        call add(result, { 'file': file, 'line': line_number, 'text': text })\n      endif\n    endif\n  endfor\n\n  return result\nendfunction\n\nfunction! fzf_preview#remote#util#get_columns() abort\n  return &columns\nendfunction\n\nfunction! fzf_preview#remote#util#uniq(list) abort\n  let result = []\n  for item in a:list\n    if index(result, item) == -1\n      call add(result, item)\n    endif\n  endfor\n  return result\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/variable.vim",
    "content": "function! fzf_preview#remote#variable#get_global_variables() abort\n  return {\n  \\   'fzfPreviewDefaultFzfOptions': g:fzf_preview_default_fzf_options,\n  \\   'fzfPreviewUseDevIcons': g:fzf_preview_use_dev_icons,\n  \\   'fzfPreviewDevIconPrefixStringLength': g:fzf_preview_dev_icon_prefix_string_length,\n  \\   'fzfPreviewDevIconsLimit': g:fzf_preview_dev_icons_limit,\n  \\   'webDevIconsUnicodeDecorateFileNodesDefaultSymbol': get(g:, 'WebDevIconsUnicodeDecorateFileNodesDefaultSymbol', ''),\n  \\   'webDevIconsUnicodeDecorateFileNodesExtensionSymbols': get(g:, 'WebDevIconsUnicodeDecorateFileNodesExtensionSymbols', {}),\n  \\   'webDevIconsUnicodeDecorateFileNodesExactSymbols': get(g:, 'WebDevIconsUnicodeDecorateFileNodesExactSymbols', {}),\n  \\   'webDevIconsUnicodeDecorateFileNodesPatternSymbols': get(g:, 'WebDevIconsUnicodeDecorateFileNodesPatternSymbols', {}),\n  \\   'fzfPreviewCommand': g:fzf_preview_command,\n  \\   'fzfBinaryPreviewCommand': g:fzf_binary_preview_command,\n  \\   'fzfPreviewIfBinaryCommand': g:fzf_preview_if_binary_command,\n  \\   'fzfPreviewFilelistCommand': g:fzf_preview_filelist_command,\n  \\   'fzfPreviewGitFilesCommand': g:fzf_preview_git_files_command,\n  \\   'fzfPreviewDirectoryFilesCommand': g:fzf_preview_directory_files_command,\n  \\   'fzfPreviewGitStatusCommand': g:fzf_preview_git_status_command,\n  \\   'fzfPreviewGitStatusPreviewCommand': g:fzf_preview_git_status_preview_command,\n  \\   'fzfPreviewGrepCmd': g:fzf_preview_grep_cmd,\n  \\   'fzfPreviewScriptDir': g:fzf_preview_script_dir,\n  \\   'fzfPreviewCacheDirectory': g:fzf_preview_cache_directory,\n  \\   'fzfPreviewLinesCommand': g:fzf_preview_lines_command,\n  \\   'fzfPreviewGrepPreviewCmd': g:fzf_preview_grep_preview_cmd,\n  \\   'fzfPreviewCustomProcesses': g:fzf_preview_custom_processes,\n  \\   'fzfPreviewFzfPreviewWindowOption': g:fzf_preview_fzf_preview_window_option,\n  \\   'fzfPreviewPreviewKeyBindings': g:fzf_preview_preview_key_bindings,\n  \\   'fzfPreviewHistoryDir': g:fzf_preview_history_dir,\n  \\   'fzfPreviewFzfColorOption': g:fzf_preview_fzf_color_option,\n  \\   'fzfPreviewBuffersJump': g:fzf_preview_buffers_jump,\n  \\   'yankroundDir': get(g:, 'yankround_dir', ''),\n  \\   'fzfPreviewYankroundPreviewCommand': g:fzf_preview_yankround_preview_command,\n  \\   'fzfPreviewBlamePrCommand': g:fzf_preview_blame_pr_command,\n  \\ }\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/remote/window.vim",
    "content": "\" TODO: Command other than fzf-preview saves wrong resumes\nlet s:resource_command_name = ''\n\nfunction! fzf_preview#remote#window#set_resource_command_name(command_name) abort\n  if s:resource_command_name !=# a:command_name\n    let s:resource_command_name = a:command_name\n  endif\n  call timer_start(10, { -> fzf_preview#remote#window#set_status_line(v:true) })\nendfunction\n\nfunction! fzf_preview#remote#window#get_resource_command_name() abort\n  return substitute(s:resource_command_name, '^FzfPreview', '', '')\nendfunction\n\nfunction! fzf_preview#remote#window#set_status_line(updated_command_name) abort\n  if !g:fzf_preview_update_statusline\n    return\n  endif\n\n  if &laststatus != 3\n    return\n  endif\n\n  if a:updated_command_name\n    setlocal statusline=%#Identifier#\\ >\\ fzf-preview\\ %{fzf_preview#remote#window#get_resource_command_name()}\n  else\n    setlocal statusline=\\ \n  endif\nendfunction\n\nfunction! fzf_preview#remote#window#set_fzf_last_query(...) abort\n  if &filetype ==# 'fzf' && s:resource_command_name !=# ''\n    let matches = matchlist(getline('.'), '\\w\\+\\>.\\(\\(\\w\\|\\s\\|''\\)\\+\\)')\n    if len(matches) > 0\n      let query = substitute(substitute(matches[1], '\\s\\+$', '', ''), '^\\s\\+', '', '')\n\n      if get(g:, 'fzf_preview_has_remote', v:false)\n        call FzfPreviewDispatchResumeQuery(s:resource_command_name, query)\n      endif\n\n      if get(g:, 'fzf_preview_has_coc', v:false)\n        call CocAction('runCommand', 'fzf-preview-function.DispatchResumeQuery', [s:resource_command_name, query])\n      endif\n\n      if get(g:, 'fzf_preview_has_rpc', v:false)\n        call fzf_preview#rpc#dispatch_resume_query(s:resource_command_name, query)\n      endif\n    endif\n\n    call timer_start(50, function('fzf_preview#remote#window#set_fzf_last_query'))\n  endif\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/rpc/server.vim",
    "content": "let s:JSON = vital#fzf_preview#import('VS.RPC.JSON')\nlet s:Server = {}\n\nfunction! fzf_preview#rpc#server#import() abort\n  return s:Server\nendfunction\n\nfunction! s:Server.new(args) abort\n  let l:server = extend(deepcopy(s:Server), { 'cmd': a:args.command, 'rpc': s:JSON.new(), 'request_id': 0 })\n  let l:server.events = l:server.rpc.events\n  return l:server\nendfunction\n\nfunction! s:Server.start() abort\n  return self.rpc.start({ 'cmd': self.cmd })\nendfunction\n\nfunction! s:Server.request(method, params) abort\n  return self.rpc.request(self.id(), a:method, a:params)\nendfunction\n\nfunction! s:Server.response(id, params) abort\n  return self.rpc.response(a:id, a:params)\nendfunction\n\nfunction! s:Server.id() abort\n  let self.request_id += 1\n  return self.request_id\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview/rpc.vim",
    "content": "let s:Promise = vital#fzf_preview#import('Async.Promise')\nlet s:Server = fzf_preview#rpc#server#import()\n\nlet s:root_dir = expand('<sfile>:h:h:h')\n\nlet s:state = {\n\\   'id': -1,\n\\   'sources': {},\n\\   'server': v:null\n\\ }\n\nlet default_processes = {}\n\ncall s:Promise.on_unhandled_rejection({ err -> fzf_preview#rpc#log('[ERROR]', err) })\n\nfunction! fzf_preview#rpc#initialize() abort\n  if !filereadable(printf('%s/lib/rpc.js', s:root_dir))\n    return\n  endif\n\n  call s:start()\n\n  function! s:initialize_default_processes(response) abort\n    let s:default_processes = a:response\n\n    let g:fzf_preview_has_rpc = v:true\n    silent doautocmd User fzf_preview#initialized\n    silent doautocmd User fzf_preview#rpc#initialized\n  endfunction\n\n  call s:state.server.request('getDefaultProcesses', {}).then({ response -> s:initialize_default_processes(response) })\nendfunction\n\nfunction! fzf_preview#rpc#restart() abort\n  if !empty(s:state.server)\n    call s:state.server.stop()\n  endif\n\n  let s:state.server = v:null\n  call s:start()\nendfunction\n\nfunction! fzf_preview#rpc#get_default_processes(name) abort\n  return s:default_processes[a:name]\nendfunction\n\nfunction! fzf_preview#rpc#command(command, ...) abort\n  call s:start()\n  if a:0 == 0\n    call s:state.server.request('execCommand', { 'commandName': a:command })\n  else\n    call s:state.server.request('execCommand', { 'commandName': a:command, 'args': a:1 })\n  endif\nendfunction\n\nfunction! fzf_preview#rpc#rpc_handler(lines) abort\n  call feedkeys('', 'x')\n  call s:state.server.request('callProcess', { 'lines': a:lines })\nendfunction\n\nfunction! fzf_preview#rpc#exec_process_callback(process_name, lines) abort\n  call s:state.server.request('execProcessCallback', { 'processName': a:process_name, 'lines': a:lines })\nendfunction\n\nfunction! fzf_preview#rpc#dispatch_resume_query(command_name, query) abort\n  call s:state.server.request('dispatchResumeQuery', { 'commandName': a:command_name, 'query': a:query })\nendfunction\n\nfunction! fzf_preview#rpc#log(...) abort\n  if exists('g:fzf_preview_debug')\n    call writefile([join([strftime('%H:%M:%S')] + a:000, \"\\t\")], '/tmp/fzf_preview_rpc.log', 'a')\n  endif\nendfunction\n\nfunction! s:start() abort\n  try\n    if !empty(s:state.server)\n      return s:state.server\n    endif\n    let s:state.server = s:Server.new({ 'command': s:command() })\n    \" call s:state.server.rpc.job.events.on('stdout', { out -> fzf_preview#rpc#log('[STDOUT]', out) })\n    call s:state.server.events.on('stderr', { err -> fzf_preview#rpc#log('[ERROR]', err) })\n    call s:state.server.events.on('request', { request -> s:on_request(request) })\n    call s:state.server.start()\n    return s:state.server\n  catch /.*/\n    echomsg string({ 'exception': v:exception, 'throwpoint': v:throwpoint })\n  endtry\nendfunction\n\nfunction! s:on_request(request) abort\n  if a:request['method'] ==# 'execCommand'\n    execute a:request['params']['command']\n    call s:state.server.response(a:request['id'], { 'result': v:null })\n  elseif a:request['method'] ==# 'execCall'\n    let result = call(a:request['params']['fname'], a:request['params']['args'])\n    call s:state.server.response(a:request['id'], { 'result': result })\n  elseif a:request['method'] ==# 'getVar'\n    let result = get(g:, a:request['params']['name'])\n    call s:state.server.response(a:request['id'], { 'result': result })\n  elseif a:request['method'] ==# 'getVvar'\n    let result = get(v:, a:request['params']['name'])\n    call s:state.server.response(a:request['id'], { 'result': result })\n  endif\nendfunction\n\nfunction! s:command() abort\n  return ['node', printf('%s/lib/rpc.js', s:root_dir)]\nendfunction\n"
  },
  {
    "path": "autoload/fzf_preview.vim",
    "content": "function! fzf_preview#install() abort\n  !yarn install\n  UpdateRemotePlugins\nendfunction\n"
  },
  {
    "path": "autoload/vital/_fzf_preview/Async/Later.vim",
    "content": "\" ___vital___\n\" NOTE: lines between '\" ___vital___' is generated by :Vitalize.\n\" Do not modify the code nor insert new lines before '\" ___vital___'\nfunction! s:_SID() abort\n  return matchstr(expand('<sfile>'), '<SNR>\\zs\\d\\+\\ze__SID$')\nendfunction\nexecute join(['function! vital#_fzf_preview#Async#Later#import() abort', printf(\"return map({'set_max_workers': '', 'call': '', 'get_max_workers': '', 'set_error_handler': '', 'get_error_handler': ''}, \\\"vital#_fzf_preview#function('<SNR>%s_' . v:key)\\\")\", s:_SID()), 'endfunction'], \"\\n\")\ndelfunction s:_SID\n\" ___vital___\nlet s:tasks = []\nlet s:workers = []\nlet s:max_workers = 50\nlet s:error_handler = v:null\n\nfunction! s:call(fn, ...) abort\n  call add(s:tasks, [a:fn, a:000])\n  if empty(s:workers)\n    call add(s:workers, timer_start(0, s:Worker, { 'repeat': -1 }))\n  endif\nendfunction\n\nfunction! s:get_max_workers() abort\n  return s:max_workers\nendfunction\n\nfunction! s:set_max_workers(n) abort\n  if a:n <= 0\n    throw 'vital: Async.Later: the n must be a positive integer'\n  endif\n  let s:max_workers = a:n\nendfunction\n\nfunction! s:get_error_handler() abort\n  return s:error_handler\nendfunction\n\nfunction! s:set_error_handler(handler) abort\n  let s:error_handler = a:handler\nendfunction\n\nfunction! s:_default_error_handler() abort\n  let ms = split(v:exception . \"\\n\" . v:throwpoint, '\\n')\n  echohl ErrorMsg\n  for m in ms\n    echomsg m\n  endfor\n  echohl None\nendfunction\n\nfunction! s:_worker(...) abort\n  if v:dying\n    return\n  endif\n  let n_workers = len(s:workers)\n  if empty(s:tasks)\n    if n_workers\n      call timer_stop(remove(s:workers, 0))\n    endif\n    return\n  endif\n  try\n    call call('call', remove(s:tasks, 0))\n  catch\n    if s:error_handler is# v:null\n      call s:_default_error_handler()\n    else\n      call s:error_handler()\n    endif\n  endtry\n  if n_workers < s:max_workers\n    call add(s:workers, timer_start(0, s:Worker, { 'repeat': -1 }))\n  endif\nendfunction\n\nlet s:Worker = funcref('s:_worker')\n"
  },
  {
    "path": "autoload/vital/_fzf_preview/Async/Promise.vim",
    "content": "\" ___vital___\n\" NOTE: lines between '\" ___vital___' is generated by :Vitalize.\n\" Do not modify the code nor insert new lines before '\" ___vital___'\nfunction! s:_SID() abort\n  return matchstr(expand('<sfile>'), '<SNR>\\zs\\d\\+\\ze__SID$')\nendfunction\nexecute join(['function! vital#_fzf_preview#Async#Promise#import() abort', printf(\"return map({'resolve': '', '_vital_depends': '', 'race': '', 'wait': '', '_vital_created': '', 'all': '', 'noop': '', 'on_unhandled_rejection': '', 'is_promise': '', 'chain': '', 'is_available': '', 'reject': '', 'new': '', '_vital_loaded': ''}, \\\"vital#_fzf_preview#function('<SNR>%s_' . v:key)\\\")\", s:_SID()), 'endfunction'], \"\\n\")\ndelfunction s:_SID\n\" ___vital___\n\" ECMAScript like Promise library for asynchronous operations.\n\"   Spec: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n\" This implementation is based upon es6-promise npm package.\n\"   Repo: https://github.com/stefanpenner/es6-promise\n\n\" States of promise\nlet s:PENDING = 0\nlet s:FULFILLED = 1\nlet s:REJECTED = 2\n\nlet s:DICT_T = type({})\n\nlet s:TIMEOUT_ERROR = 'vital: Async.Promise: Timeout'\nlet s:DEFAULT_WAIT_INTERVAL = 30\n\nfunction! s:_vital_created(module) abort\n  let a:module.TimeoutError = s:TIMEOUT_ERROR\n  lockvar a:module.TimeoutError\nendfunction\n\nfunction! s:_vital_loaded(V) abort\n  let s:Later = a:V.import('Async.Later')\nendfunction\n\nfunction! s:_vital_depends() abort\n  return ['Async.Later']\nendfunction\n\nfunction! s:noop(...) abort\nendfunction\nlet s:NOOP = funcref('s:noop')\n\n\" Internal APIs\n\nlet s:PROMISE = {\n    \\   '_state': s:PENDING,\n    \\   '_has_floating_child': v:false,\n    \\   '_children': [],\n    \\   '_fulfillments': [],\n    \\   '_rejections': [],\n    \\   '_result': v:null,\n    \\ }\n\nlet s:id = -1\nfunction! s:_next_id() abort\n  let s:id += 1\n  return s:id\nendfunction\n\n\" ... is added to use this function as a callback of s:Later.call()\nfunction! s:_invoke_callback(settled, promise, callback, result, ...) abort\n  let has_callback = a:callback isnot v:null\n  let success = 1\n  let err = v:null\n  if has_callback\n    try\n      let l:Result = a:callback(a:result)\n    catch\n      let err = {\n      \\   'exception' : v:exception,\n      \\   'throwpoint' : v:throwpoint,\n      \\ }\n      let success = 0\n    endtry\n  else\n    let l:Result = a:result\n  endif\n\n  if a:promise._state != s:PENDING\n    \" Do nothing\n  elseif has_callback && success\n    call s:_resolve(a:promise, Result)\n  elseif !success\n    call s:_reject(a:promise, err)\n  elseif a:settled == s:FULFILLED\n    call s:_fulfill(a:promise, Result)\n  elseif a:settled == s:REJECTED\n    call s:_reject(a:promise, Result)\n  endif\nendfunction\n\n\" ... is added to use this function as a callback of s:Later.call()\nfunction! s:_publish(promise, ...) abort\n  let settled = a:promise._state\n  if settled == s:PENDING\n    throw 'vital: Async.Promise: Cannot publish a pending promise'\n  endif\n\n  if empty(a:promise._children)\n    if settled == s:REJECTED && !a:promise._has_floating_child\n      call s:_on_unhandled_rejection(a:promise._result)\n    endif\n    return\n  endif\n\n  for i in range(len(a:promise._children))\n    if settled == s:FULFILLED\n      let l:CB = a:promise._fulfillments[i]\n    else\n      \" When rejected\n      let l:CB = a:promise._rejections[i]\n    endif\n    let child = a:promise._children[i]\n    if child isnot v:null\n      call s:_invoke_callback(settled, child, l:CB, a:promise._result)\n    else\n      call l:CB(a:promise._result)\n    endif\n  endfor\n\n  let a:promise._children = []\n  let a:promise._fulfillments = []\n  let a:promise._rejections = []\nendfunction\n\nfunction! s:_subscribe(parent, child, on_fulfilled, on_rejected) abort\n  let a:parent._children += [ a:child ]\n  let a:parent._fulfillments += [ a:on_fulfilled ]\n  let a:parent._rejections += [ a:on_rejected ]\nendfunction\n\nfunction! s:_handle_thenable(promise, thenable) abort\n  if a:thenable._state == s:FULFILLED\n    call s:_fulfill(a:promise, a:thenable._result)\n  elseif a:thenable._state == s:REJECTED\n    call s:_reject(a:promise, a:thenable._result)\n  else\n    call s:_subscribe(\n         \\   a:thenable,\n         \\   v:null,\n         \\   funcref('s:_resolve', [a:promise]),\n         \\   funcref('s:_reject', [a:promise]),\n         \\ )\n  endif\nendfunction\n\nfunction! s:_resolve(promise, ...) abort\n  let l:Result = a:0 > 0 ? a:1 : v:null\n  if s:is_promise(Result)\n    call s:_handle_thenable(a:promise, Result)\n  else\n    call s:_fulfill(a:promise, Result)\n  endif\nendfunction\n\nfunction! s:_fulfill(promise, value) abort\n  if a:promise._state != s:PENDING\n    return\n  endif\n  let a:promise._result = a:value\n  let a:promise._state = s:FULFILLED\n  if !empty(a:promise._children)\n    call s:Later.call(funcref('s:_publish', [a:promise]))\n  endif\nendfunction\n\nfunction! s:_reject(promise, ...) abort\n  if a:promise._state != s:PENDING\n    return\n  endif\n  let a:promise._result = a:0 > 0 ? a:1 : v:null\n  let a:promise._state = s:REJECTED\n  call s:Later.call(funcref('s:_publish', [a:promise]))\nendfunction\n\nfunction! s:_notify_done(wg, index, value) abort\n  let a:wg.results[a:index] = a:value\n  let a:wg.remaining -= 1\n  if a:wg.remaining == 0\n    call a:wg.resolve(a:wg.results)\n  endif\nendfunction\n\nfunction! s:_all(promises, resolve, reject) abort\n  let total = len(a:promises)\n  if total == 0\n    call a:resolve([])\n    return\n  endif\n\n  let wait_group = {\n      \\   'results': repeat([v:null], total),\n      \\   'resolve': a:resolve,\n      \\   'remaining': total,\n      \\ }\n\n  \" 'for' statement is not available here because iteration variable is captured into lambda\n  \" expression by **reference**.\n  call map(\n       \\   copy(a:promises),\n       \\   {i, p -> p.then({v -> s:_notify_done(wait_group, i, v)}, a:reject)},\n       \\ )\nendfunction\n\nfunction! s:_race(promises, resolve, reject) abort\n  for p in a:promises\n    call p.then(a:resolve, a:reject)\n  endfor\nendfunction\n\n\" Public APIs\n\nfunction! s:new(resolver) abort\n  let promise = deepcopy(s:PROMISE)\n  let promise._vital_promise = s:_next_id()\n  try\n    if a:resolver != s:NOOP\n      call a:resolver(\n      \\   funcref('s:_resolve', [promise]),\n      \\   funcref('s:_reject', [promise]),\n      \\ )\n    endif\n  catch\n    call s:_reject(promise, {\n    \\   'exception' : v:exception,\n    \\   'throwpoint' : v:throwpoint,\n    \\ })\n  endtry\n  return promise\nendfunction\n\nfunction! s:all(promises) abort\n  return s:new(funcref('s:_all', [a:promises]))\nendfunction\n\nfunction! s:race(promises) abort\n  return s:new(funcref('s:_race', [a:promises]))\nendfunction\n\nfunction! s:resolve(...) abort\n  let promise = s:new(s:NOOP)\n  call s:_resolve(promise, a:0 > 0 ? a:1 : v:null)\n  return promise\nendfunction\n\nfunction! s:reject(...) abort\n  let promise = s:new(s:NOOP)\n  call s:_reject(promise, a:0 > 0 ? a:1 : v:null)\n  return promise\nendfunction\n\nfunction! s:is_available() abort\n  return has('lambda') && has('timers')\nendfunction\n\nfunction! s:is_promise(maybe_promise) abort\n  return type(a:maybe_promise) == s:DICT_T && has_key(a:maybe_promise, '_vital_promise')\nendfunction\n\nfunction! s:wait(promise, ...) abort\n  if a:0 && type(a:1) is# v:t_number\n    let t = a:1\n    let i = s:DEFAULT_WAIT_INTERVAL . 'm'\n  else\n    let o = a:0 ? a:1 : {}\n    let t = get(o, 'timeout', v:null)\n    let i = get(o, 'interval', s:DEFAULT_WAIT_INTERVAL) . 'm'\n  endif\n  let s = reltime()\n  while a:promise._state is# s:PENDING\n    if (t isnot# v:null && reltimefloat(reltime(s)) * 1000 > t)\n      return [v:null, s:TIMEOUT_ERROR]\n    endif\n    execute 'sleep' i\n  endwhile\n  if a:promise._state is# s:FULFILLED\n    return [a:promise._result, v:null]\n  else\n    return [v:null, a:promise._result]\n  endif\nendfunction\n\nfunction! s:chain(promise_factories) abort\n  return s:_chain(copy(a:promise_factories), [])\nendfunction\n\nfunction! s:_chain(promise_factories, results) abort\n  if len(a:promise_factories) is# 0\n    return s:resolve(a:results)\n  endif\n  let l:Factory = remove(a:promise_factories, 0)\n  try\n    return Factory()\n          \\.then({ v -> add(a:results, v) })\n          \\.then({ -> s:_chain(a:promise_factories, a:results) })\n  catch\n    return s:reject({\n          \\ 'exception': v:exception,\n          \\ 'throwpoint': v:throwpoint,\n          \\})\n  endtry\nendfunction\n\nlet s:_on_unhandled_rejection = s:NOOP\nfunction! s:on_unhandled_rejection(on_unhandled_rejection) abort\n  let s:_on_unhandled_rejection = a:on_unhandled_rejection\nendfunction\n\nfunction! s:_promise_then(...) dict abort\n  let parent = self\n  let state = parent._state\n  let child = s:new(s:NOOP)\n  let l:Res = a:0 > 0 ? a:1 : v:null\n  let l:Rej = a:0 > 1 ? a:2 : v:null\n  if state == s:FULFILLED\n    let parent._has_floating_child = v:true\n    call s:Later.call(funcref('s:_invoke_callback', [state, child, Res, parent._result]))\n  elseif state == s:REJECTED\n    let parent._has_floating_child = v:true\n    call s:Later.call(funcref('s:_invoke_callback', [state, child, Rej, parent._result]))\n  else\n    call s:_subscribe(parent, child, Res, Rej)\n  endif\n  return child\nendfunction\nlet s:PROMISE.then = funcref('s:_promise_then')\n\n\" .catch() is just a syntax sugar of .then()\nfunction! s:_promise_catch(...) dict abort\n  return self.then(v:null, a:0 > 0 ? a:1 : v:null)\nendfunction\nlet s:PROMISE.catch = funcref('s:_promise_catch')\n\nfunction! s:_on_finally(CB, parent, Result) abort\n  call a:CB()\n  if a:parent._state == s:FULFILLED\n    return a:Result\n  else \" REJECTED\n    return s:reject(a:Result)\n  endif\nendfunction\nfunction! s:_promise_finally(...) dict abort\n  let parent = self\n  let state = parent._state\n  let child = s:new(s:NOOP)\n  if a:0 == 0\n    let l:CB = v:null\n  else\n    let l:CB = funcref('s:_on_finally', [a:1, parent])\n  endif\n  if state != s:PENDING\n    call s:Later.call(funcref('s:_invoke_callback', [state, child, CB, parent._result]))\n  else\n    call s:_subscribe(parent, child, CB, CB)\n  endif\n  return child\nendfunction\nlet s:PROMISE.finally = funcref('s:_promise_finally')\n\n\" vim:set et ts=2 sts=2 sw=2 tw=0:\n"
  },
  {
    "path": "autoload/vital/_fzf_preview/VS/Event/Emitter.vim",
    "content": "\" ___vital___\n\" NOTE: lines between '\" ___vital___' is generated by :Vitalize.\n\" Do not modify the code nor insert new lines before '\" ___vital___'\nfunction! s:_SID() abort\n  return matchstr(expand('<sfile>'), '<SNR>\\zs\\d\\+\\ze__SID$')\nendfunction\nexecute join(['function! vital#_fzf_preview#VS#Event#Emitter#import() abort', printf(\"return map({'new': ''}, \\\"vital#_fzf_preview#function('<SNR>%s_' . v:key)\\\")\", s:_SID()), 'endfunction'], \"\\n\")\ndelfunction s:_SID\n\" ___vital___\n\"\n\" new\n\"\nfunction! s:new() abort\n  return s:Emitter.new()\nendfunction\n\n\"\n\" Emitter\n\"\nlet s:Emitter = {}\n\n\"\n\" new\n\"\nfunction! s:Emitter.new() abort\n  return extend(deepcopy(s:Emitter), {\n  \\   'events': {}\n  \\ })\nendfunction\n\n\"\n\" emit\n\"\nfunction! s:Emitter.emit(event_name, ...) abort\n  for l:Listener in get(self.events, a:event_name, [])\n    call call(l:Listener, a:000)\n  endfor\nendfunction\n\n\"\n\" on\n\"\nfunction! s:Emitter.on(event_name, Listener) abort\n  let self.events[a:event_name] = get(self.events, a:event_name, [])\n  call add(self.events[a:event_name], a:Listener)\nendfunction\n\n\"\n\" listener_count\n\"\nfunction! s:Emitter.listener_count(event_name) abort\n  return len(get(self.events, a:event_name, []))\nendfunction\n\n\"\n\" off\n\"\nfunction! s:Emitter.off(event_name, ...) abort\n  let self.events[a:event_name] = get(self.events, a:event_name, [])\n\n  let l:Listener = get(a:000, 0, v:null)\n\n  let l:i = len(self.events[a:event_name]) - 1\n  while l:i >= 0\n    if self.events[a:event_name][l:i] ==# l:Listener || l:Listener is# v:null\n      call remove(self.events[a:event_name], l:i)\n    endif\n    let l:i -= 1\n  endwhile\nendfunction\n\n"
  },
  {
    "path": "autoload/vital/_fzf_preview/VS/RPC/JSON.vim",
    "content": "\" ___vital___\n\" NOTE: lines between '\" ___vital___' is generated by :Vitalize.\n\" Do not modify the code nor insert new lines before '\" ___vital___'\nfunction! s:_SID() abort\n  return matchstr(expand('<sfile>'), '<SNR>\\zs\\d\\+\\ze__SID$')\nendfunction\nexecute join(['function! vital#_fzf_preview#VS#RPC#JSON#import() abort', printf(\"return map({'_vital_depends': '', 'new': '', '_vital_loaded': ''}, \\\"vital#_fzf_preview#function('<SNR>%s_' . v:key)\\\")\", s:_SID()), 'endfunction'], \"\\n\")\ndelfunction s:_SID\n\" ___vital___\n\"\n\" _vital_loaded\n\"\nfunction! s:_vital_loaded(V) abort\n  let s:Promise = a:V.import('Async.Promise')\n  let s:Job = a:V.import('VS.System.Job')\n  let s:Emitter = a:V.import('VS.Event.Emitter')\nendfunction\n\n\"\n\" _vital_depends\n\"\nfunction! s:_vital_depends() abort\n  return ['Async.Promise', 'VS.Event.Emitter', 'VS.System.Job']\nendfunction\n\n\"\n\" new\n\"\nfunction! s:new() abort\n  return s:Connection.new()\nendfunction\n\n\"\n\" s:Connection\n\"\nlet s:Connection = {}\n\n\"\n\" new\n\"\nfunction! s:Connection.new() abort\n  return extend(deepcopy(s:Connection), {\n  \\   'job': s:Job.new(),\n  \\   'events': s:Emitter.new(),\n  \\   'buffer':  '',\n  \\   'header_length': -1,\n  \\   'message_length': -1,\n  \\   'request_map': {},\n  \\ })\nendfunction\n\n\"\n\" start\n\"\nfunction! s:Connection.start(args) abort\n  if !self.job.is_running()\n    call self.job.events.on('stdout', self.on_stdout)\n    call self.job.events.on('stderr', self.on_stderr)\n    call self.job.events.on('exit', self.on_exit)\n    call self.job.start(a:args)\n  endif\nendfunction\n\n\"\n\" stop\n\"\nfunction! s:Connection.stop() abort\n  if self.job.is_running()\n    call self.job.events.off('stdout', self.on_stdout)\n    call self.job.events.off('stderr', self.on_stderr)\n    call self.job.events.off('exit', self.on_exit)\n    call self.job.stop()\n  endif\nendfunction\n\n\"\n\" is_running\n\"\nfunction! s:Connection.is_running() abort\n  return self.job.is_running()\nendfunction\n\n\"\n\" request\n\"\nfunction! s:Connection.request(id, method, params) abort\n  let l:ctx = {}\n  function! l:ctx.callback(id, method, params, resolve, reject) abort\n    let self.request_map[a:id] = { 'resolve': a:resolve, 'reject': a:reject }\n    let l:message = { 'id': a:id, 'method': a:method }\n    if a:params isnot# v:null\n      let l:message.params = a:params\n    endif\n    call self.job.send(self.to_message(l:message))\n  endfunction\n  return s:Promise.new(function(l:ctx.callback, [a:id, a:method, a:params], self))\nendfunction\n\n\"\n\" response\n\"\nfunction! s:Connection.response(id, ...) abort\n  let l:message = { 'id': a:id }\n  let l:message = extend(l:message, len(a:000) > 0 ? a:000[0] : {})\n  call self.job.send(self.to_message(l:message))\nendfunction\n\n\"\n\" notify\n\"\nfunction! s:Connection.notify(method, params) abort\n  let l:message = { 'method': a:method }\n  if a:params isnot# v:null\n    let l:message.params = a:params\n  endif\n  call self.job.send(self.to_message(l:message))\nendfunction\n\n\"\n\" cancel\n\"\nfunction! s:Connection.cancel(id) abort\n  if has_key(self.request_map, a:id)\n    call remove(self.request_map, a:id)\n  endif\nendfunction\n\n\"\n\" to_message\n\"\nfunction! s:Connection.to_message(message) abort\n  let a:message.jsonrpc = '2.0'\n  let l:message = json_encode(a:message)\n  return 'Content-Length: ' . strlen(l:message) . \"\\r\\n\\r\\n\" . l:message\nendfunction\n\n\"\n\" on_message\n\"\nfunction! s:Connection.on_message(message) abort\n  if has_key(a:message, 'id')\n    \" Request from server.\n    if has_key(a:message, 'method')\n      call self.events.emit('request', a:message)\n\n    \" Response from server.\n    else\n      if has_key(self.request_map, a:message.id)\n        let l:request = remove(self.request_map, a:message.id)\n        if has_key(a:message, 'error')\n          call l:request.reject(a:message.error)\n        else\n          call l:request.resolve(get(a:message, 'result', v:null))\n        endif\n      endif\n    endif\n\n  \" Notify from server.\n  elseif has_key(a:message, 'method')\n    call self.events.emit('notify', a:message)\n  endif\nendfunction\n\n\"\n\" flush\n\"\nfunction! s:Connection.flush(data) abort\n  let self.buffer .= a:data\n\n  while self.buffer !=# ''\n    \" header check.\n    if self.header_length == -1\n      let l:header_length = stridx(self.buffer, \"\\r\\n\\r\\n\") + 4\n      if l:header_length < 4\n        return\n      endif\n      let self.header_length = l:header_length\n      let self.message_length = self.header_length + str2nr(get(matchlist(self.buffer, '\\ccontent-length:\\s*\\(\\d\\+\\)'), 1, '-1'))\n    endif\n\n    \" content check.\n    let l:buffer_len = strlen(self.buffer)\n    if l:buffer_len < self.message_length\n      return\n    endif\n\n    let l:content = strpart(self.buffer, self.header_length, self.message_length - self.header_length)\n    try\n      call self.on_message(json_decode(l:content))\n    catch /.*/\n    endtry\n    let self.buffer = strpart(self.buffer, self.message_length)\n    let self.header_length = -1\n  endwhile\nendfunction\n\n\"\n\" on_stdout\n\"\nfunction! s:Connection.on_stdout(data) abort\n  call self.flush(a:data)\nendfunction\n\n\"\n\" on_stderr\n\"\nfunction! s:Connection.on_stderr(data) abort\n  call self.events.emit('stderr', a:data)\nendfunction\n\n\"\n\" on_exit\n\"\nfunction! s:Connection.on_exit(code) abort\n  call self.events.emit('exit', a:code)\nendfunction\n\n"
  },
  {
    "path": "autoload/vital/_fzf_preview/VS/System/Job.vim",
    "content": "\" ___vital___\n\" NOTE: lines between '\" ___vital___' is generated by :Vitalize.\n\" Do not modify the code nor insert new lines before '\" ___vital___'\nfunction! s:_SID() abort\n  return matchstr(expand('<sfile>'), '<SNR>\\zs\\d\\+\\ze__SID$')\nendfunction\nexecute join(['function! vital#_fzf_preview#VS#System#Job#import() abort', printf(\"return map({'_vital_depends': '', 'new': '', '_vital_loaded': ''}, \\\"vital#_fzf_preview#function('<SNR>%s_' . v:key)\\\")\", s:_SID()), 'endfunction'], \"\\n\")\ndelfunction s:_SID\n\" ___vital___\n\"\n\" _vital_loaded\n\"\nfunction! s:_vital_loaded(V) abort\n  let s:Emitter = a:V.import('VS.Event.Emitter')\nendfunction\n\n\"\n\" _vital_depends\n\"\nfunction! s:_vital_depends() abort\n  return ['VS.Event.Emitter']\nendfunction\n\n\"\n\" new\n\"\nfunction! s:new() abort\n  return s:Job.new()\nendfunction\n\nlet s:chunk_size = 2048\n\nlet s:Job = {}\n\n\"\n\" new\n\"\nfunction! s:Job.new() abort\n  let l:job = extend(deepcopy(s:Job), {\n  \\   'events': s:Emitter.new(),\n  \\   'write_buffer': '',\n  \\   'write_timer': -1,\n  \\   'job': v:null,\n  \\ })\n  let l:job.write = function(l:job.write, [], l:job)\n  return l:job\nendfunction\n\n\"\n\" start\n\"\nfunction! s:Job.start(args) abort\n  if self.is_running()\n    return\n  endif\n\n  let l:option = {}\n  for l:key in ['cwd', 'env']\n    if has_key(a:args, l:key)\n      let l:option[l:key] = a:args[l:key]\n    endif\n  endfor\n\n  let self.job = s:_create(\n  \\   a:args.cmd,\n  \\   l:option,\n  \\   function(self.on_stdout, [], self),\n  \\   function(self.on_stderr, [], self),\n  \\   function(self.on_exit, [], self)\n  \\ )\nendfunction\n\n\"\n\" stop\n\"\nfunction! s:Job.stop() abort\n  if !self.is_running()\n    return\n  endif\n  call self.job.stop()\n  let self.job = v:null\nendfunction\n\n\"\n\" is_running\n\"\nfunction! s:Job.is_running() abort\n  return !empty(self.job)\nendfunction\n\n\"\n\" send\n\"\nfunction! s:Job.send(data) abort\n  if !self.is_running()\n    return\n  endif\n  let self.write_buffer .= a:data\n  if self.write_timer != -1\n    return\n  endif\n  call self.write()\nendfunction\n\n\"\n\" write\n\"\nfunction! s:Job.write(...) abort\n  let self.write_timer = -1\n  if self.write_buffer ==# ''\n    return\n  endif\n  call self.job.send(strpart(self.write_buffer, 0, s:chunk_size))\n  let self.write_buffer = strpart(self.write_buffer, s:chunk_size)\n  if self.write_buffer !=# ''\n    let self.write_timer = timer_start(0, self.write)\n  endif\nendfunction\n\n\"\n\" on_stdout\n\"\nfunction! s:Job.on_stdout(data) abort\n  call self.events.emit('stdout', a:data)\nendfunction\n\n\"\n\" on_stderr\n\"\nfunction! s:Job.on_stderr(data) abort\n  call self.events.emit('stderr', a:data)\nendfunction\n\n\"\n\" on_exit\n\"\nfunction! s:Job.on_exit(code) abort\n  call self.events.emit('exit', a:code)\nendfunction\n\n\"\n\" create job instance\n\"\nif has('nvim')\n  function! s:_create(cmd, option, out, err, exit) abort\n    let a:option.on_stdout = { id, data, event -> a:out(join(data, \"\\n\")) }\n    let a:option.on_stderr = { id, data, event -> a:err(join(data, \"\\n\")) }\n    let a:option.on_exit = { id, data, code -> a:exit(code) }\n    let l:job = jobstart(a:cmd, a:option)\n    return {\n    \\   'stop': { -> jobstop(l:job) },\n    \\   'send': { data -> jobsend(l:job, data) }\n    \\ }\n  endfunction\nelse\n  function! s:_create(cmd, option, out, err, exit) abort\n    let a:option.noblock = v:true\n    let a:option.in_io = 'pipe'\n    let a:option.in_mode = 'raw'\n    let a:option.out_io = 'pipe'\n    let a:option.out_mode = 'raw'\n    let a:option.err_io = 'pipe'\n    let a:option.err_mode = 'raw'\n    let a:option.out_cb = { job, data -> a:out(data) }\n    let a:option.err_cb = { job, data -> a:err(data) }\n    let a:option.exit_cb = { job, code -> a:exit(code) }\n    let l:job = job_start(a:cmd, a:option)\n    return {\n    \\   'stop': { ->  ch_close(l:job) },\n    \\   'send': { data -> ch_sendraw(l:job, data) }\n    \\ }\n  endfunction\nendif\n\n"
  },
  {
    "path": "autoload/vital/_fzf_preview.vim",
    "content": "let s:_plugin_name = expand('<sfile>:t:r')\n\nfunction! vital#{s:_plugin_name}#new() abort\n  return vital#{s:_plugin_name[1:]}#new()\nendfunction\n\nfunction! vital#{s:_plugin_name}#function(funcname) abort\n  silent! return function(a:funcname)\nendfunction\n"
  },
  {
    "path": "autoload/vital/fzf_preview.vim",
    "content": "let s:plugin_name = expand('<sfile>:t:r')\nlet s:vital_base_dir = expand('<sfile>:h')\nlet s:project_root = expand('<sfile>:h:h:h')\nlet s:is_vital_vim = s:plugin_name is# 'vital'\n\nlet s:loaded = {}\nlet s:cache_sid = {}\n\nfunction! vital#{s:plugin_name}#new() abort\n  return s:new(s:plugin_name)\nendfunction\n\nfunction! vital#{s:plugin_name}#import(...) abort\n  if !exists('s:V')\n    let s:V = s:new(s:plugin_name)\n  endif\n  return call(s:V.import, a:000, s:V)\nendfunction\n\nlet s:Vital = {}\n\nfunction! s:new(plugin_name) abort\n  let base = deepcopy(s:Vital)\n  let base._plugin_name = a:plugin_name\n  return base\nendfunction\n\nfunction! s:vital_files() abort\n  if !exists('s:vital_files')\n    let s:vital_files = map(\n    \\   s:is_vital_vim ? s:_global_vital_files() : s:_self_vital_files(),\n    \\   'fnamemodify(v:val, \":p:gs?[\\\\\\\\/]?/?\")')\n  endif\n  return copy(s:vital_files)\nendfunction\nlet s:Vital.vital_files = function('s:vital_files')\n\nfunction! s:import(name, ...) abort dict\n  let target = {}\n  let functions = []\n  for a in a:000\n    if type(a) == type({})\n      let target = a\n    elseif type(a) == type([])\n      let functions = a\n    endif\n    unlet a\n  endfor\n  let module = self._import(a:name)\n  if empty(functions)\n    call extend(target, module, 'keep')\n  else\n    for f in functions\n      if has_key(module, f) && !has_key(target, f)\n        let target[f] = module[f]\n      endif\n    endfor\n  endif\n  return target\nendfunction\nlet s:Vital.import = function('s:import')\n\nfunction! s:load(...) abort dict\n  for arg in a:000\n    let [name; as] = type(arg) == type([]) ? arg[: 1] : [arg, arg]\n    let target = split(join(as, ''), '\\W\\+')\n    let dict = self\n    let dict_type = type({})\n    while !empty(target)\n      let ns = remove(target, 0)\n      if !has_key(dict, ns)\n        let dict[ns] = {}\n      endif\n      if type(dict[ns]) == dict_type\n        let dict = dict[ns]\n      else\n        unlet dict\n        break\n      endif\n    endwhile\n    if exists('dict')\n      call extend(dict, self._import(name))\n    endif\n    unlet arg\n  endfor\n  return self\nendfunction\nlet s:Vital.load = function('s:load')\n\nfunction! s:unload() abort dict\n  let s:loaded = {}\n  let s:cache_sid = {}\n  unlet! s:vital_files\nendfunction\nlet s:Vital.unload = function('s:unload')\n\nfunction! s:exists(name) abort dict\n  if a:name !~# '\\v^\\u\\w*%(\\.\\u\\w*)*$'\n    throw 'vital: Invalid module name: ' . a:name\n  endif\n  return s:_module_path(a:name) isnot# ''\nendfunction\nlet s:Vital.exists = function('s:exists')\n\nfunction! s:search(pattern) abort dict\n  let paths = s:_extract_files(a:pattern, self.vital_files())\n  let modules = sort(map(paths, 's:_file2module(v:val)'))\n  return uniq(modules)\nendfunction\nlet s:Vital.search = function('s:search')\n\nfunction! s:plugin_name() abort dict\n  return self._plugin_name\nendfunction\nlet s:Vital.plugin_name = function('s:plugin_name')\n\nfunction! s:_self_vital_files() abort\n  let builtin = printf('%s/__%s__/', s:vital_base_dir, s:plugin_name)\n  let installed = printf('%s/_%s/', s:vital_base_dir, s:plugin_name)\n  let base = builtin . ',' . installed\n  return split(globpath(base, '**/*.vim', 1), \"\\n\")\nendfunction\n\nfunction! s:_global_vital_files() abort\n  let pattern = 'autoload/vital/__*__/**/*.vim'\n  return split(globpath(&runtimepath, pattern, 1), \"\\n\")\nendfunction\n\nfunction! s:_extract_files(pattern, files) abort\n  let tr = {'.': '/', '*': '[^/]*', '**': '.*'}\n  let target = substitute(a:pattern, '\\.\\|\\*\\*\\?', '\\=tr[submatch(0)]', 'g')\n  let regexp = printf('autoload/vital/[^/]\\+/%s.vim$', target)\n  return filter(a:files, 'v:val =~# regexp')\nendfunction\n\nfunction! s:_file2module(file) abort\n  let filename = fnamemodify(a:file, ':p:gs?[\\\\/]?/?')\n  let tail = matchstr(filename, 'autoload/vital/_\\w\\+/\\zs.*\\ze\\.vim$')\n  return join(split(tail, '[\\\\/]\\+'), '.')\nendfunction\n\n\" @param {string} name e.g. Data.List\nfunction! s:_import(name) abort dict\n  if has_key(s:loaded, a:name)\n    return copy(s:loaded[a:name])\n  endif\n  let module = self._get_module(a:name)\n  if has_key(module, '_vital_created')\n    call module._vital_created(module)\n  endif\n  let export_module = filter(copy(module), 'v:key =~# \"^\\\\a\"')\n  \" Cache module before calling module._vital_loaded() to avoid cyclic\n  \" dependences but remove the cache if module._vital_loaded() fails.\n  \" let s:loaded[a:name] = export_module\n  let s:loaded[a:name] = export_module\n  if has_key(module, '_vital_loaded')\n    try\n      call module._vital_loaded(vital#{s:plugin_name}#new())\n    catch\n      unlet s:loaded[a:name]\n      throw 'vital: fail to call ._vital_loaded(): ' . v:exception . \" from:\\n\" . s:_format_throwpoint(v:throwpoint)\n    endtry\n  endif\n  return copy(s:loaded[a:name])\nendfunction\nlet s:Vital._import = function('s:_import')\n\nfunction! s:_format_throwpoint(throwpoint) abort\n  let funcs = []\n  let stack = matchstr(a:throwpoint, '^function \\zs.*, .\\{-} \\d\\+$')\n  for line in split(stack, '\\.\\.')\n    let m = matchlist(line, '^\\(.\\+\\)\\%(\\[\\(\\d\\+\\)\\]\\|, .\\{-} \\(\\d\\+\\)\\)$')\n    if !empty(m)\n      let [name, lnum, lnum2] = m[1:3]\n      if empty(lnum)\n        let lnum = lnum2\n      endif\n      let info = s:_get_func_info(name)\n      if !empty(info)\n        let attrs = empty(info.attrs) ? '' : join([''] + info.attrs)\n        let flnum = info.lnum == 0 ? '' : printf(' Line:%d', info.lnum + lnum)\n        call add(funcs, printf('function %s(...)%s Line:%d (%s%s)',\n        \\        info.funcname, attrs, lnum, info.filename, flnum))\n        continue\n      endif\n    endif\n    \" fallback when function information cannot be detected\n    call add(funcs, line)\n  endfor\n  return join(funcs, \"\\n\")\nendfunction\n\nfunction! s:_get_func_info(name) abort\n  let name = a:name\n  if a:name =~# '^\\d\\+$'  \" is anonymous-function\n    let name = printf('{%s}', a:name)\n  elseif a:name =~# '^<lambda>\\d\\+$'  \" is lambda-function\n    let name = printf(\"{'%s'}\", a:name)\n  endif\n  if !exists('*' . name)\n    return {}\n  endif\n  let body = execute(printf('verbose function %s', name))\n  let lines = split(body, \"\\n\")\n  let signature = matchstr(lines[0], '^\\s*\\zs.*')\n  let [_, file, lnum; __] = matchlist(lines[1],\n  \\   '^\\t\\%(Last set from\\|.\\{-}:\\)\\s*\\zs\\(.\\{-}\\)\\%( \\S\\+ \\(\\d\\+\\)\\)\\?$')\n  return {\n  \\   'filename': substitute(file, '[/\\\\]\\+', '/', 'g'),\n  \\   'lnum': 0 + lnum,\n  \\   'funcname': a:name,\n  \\   'arguments': split(matchstr(signature, '(\\zs.*\\ze)'), '\\s*,\\s*'),\n  \\   'attrs': filter(['dict', 'abort', 'range', 'closure'], 'signature =~# (\").*\" . v:val)'),\n  \\ }\nendfunction\n\n\" s:_get_module() returns module object wihch has all script local functions.\nfunction! s:_get_module(name) abort dict\n  let funcname = s:_import_func_name(self.plugin_name(), a:name)\n  try\n    return call(funcname, [])\n  catch /^Vim\\%((\\a\\+)\\)\\?:E117:/\n    return s:_get_builtin_module(a:name)\n  endtry\nendfunction\n\nfunction! s:_get_builtin_module(name) abort\n return s:sid2sfuncs(s:_module_sid(a:name))\nendfunction\n\nif s:is_vital_vim\n  \" For vital.vim, we can use s:_get_builtin_module directly\n  let s:Vital._get_module = function('s:_get_builtin_module')\nelse\n  let s:Vital._get_module = function('s:_get_module')\nendif\n\nfunction! s:_import_func_name(plugin_name, module_name) abort\n  return printf('vital#_%s#%s#import', a:plugin_name, s:_dot_to_sharp(a:module_name))\nendfunction\n\nfunction! s:_module_sid(name) abort\n  let path = s:_module_path(a:name)\n  if !filereadable(path)\n    throw 'vital: module not found: ' . a:name\n  endif\n  let vital_dir = s:is_vital_vim ? '__\\w\\+__' : printf('_\\{1,2}%s\\%%(__\\)\\?', s:plugin_name)\n  let base = join([vital_dir, ''], '[/\\\\]\\+')\n  let p = base . substitute('' . a:name, '\\.', '[/\\\\\\\\]\\\\+', 'g')\n  let sid = s:_sid(path, p)\n  if !sid\n    call s:_source(path)\n    let sid = s:_sid(path, p)\n    if !sid\n      throw printf('vital: cannot get <SID> from path: %s', path)\n    endif\n  endif\n  return sid\nendfunction\n\nfunction! s:_module_path(name) abort\n  return get(s:_extract_files(a:name, s:vital_files()), 0, '')\nendfunction\n\nfunction! s:_module_sid_base_dir() abort\n  return s:is_vital_vim ? &rtp : s:project_root\nendfunction\n\nfunction! s:_dot_to_sharp(name) abort\n  return substitute(a:name, '\\.', '#', 'g')\nendfunction\n\nfunction! s:_source(path) abort\n  execute 'source' fnameescape(a:path)\nendfunction\n\n\" @vimlint(EVL102, 1, l:_)\n\" @vimlint(EVL102, 1, l:__)\nfunction! s:_sid(path, filter_pattern) abort\n  let unified_path = s:_unify_path(a:path)\n  if has_key(s:cache_sid, unified_path)\n    return s:cache_sid[unified_path]\n  endif\n  for line in filter(split(execute(':scriptnames'), \"\\n\"), 'v:val =~# a:filter_pattern')\n    let [_, sid, path; __] = matchlist(line, '^\\s*\\(\\d\\+\\):\\s\\+\\(.\\+\\)\\s*$')\n    if s:_unify_path(path) is# unified_path\n      let s:cache_sid[unified_path] = sid\n      return s:cache_sid[unified_path]\n    endif\n  endfor\n  return 0\nendfunction\n\nif filereadable(expand('<sfile>:r') . '.VIM') \" is case-insensitive or not\n  let s:_unify_path_cache = {}\n  \" resolve() is slow, so we cache results.\n  \" Note: On windows, vim can't expand path names from 8.3 formats.\n  \" So if getting full path via <sfile> and $HOME was set as 8.3 format,\n  \" vital load duplicated scripts. Below's :~ avoid this issue.\n  function! s:_unify_path(path) abort\n    if has_key(s:_unify_path_cache, a:path)\n      return s:_unify_path_cache[a:path]\n    endif\n    let value = tolower(fnamemodify(resolve(fnamemodify(\n    \\                   a:path, ':p')), ':~:gs?[\\\\/]?/?'))\n    let s:_unify_path_cache[a:path] = value\n    return value\n  endfunction\nelse\n  function! s:_unify_path(path) abort\n    return resolve(fnamemodify(a:path, ':p:gs?[\\\\/]?/?'))\n  endfunction\nendif\n\n\" copied and modified from Vim.ScriptLocal\nlet s:SNR = join(map(range(len(\"\\<SNR>\")), '\"[\\\\x\" . printf(\"%0x\", char2nr(\"\\<SNR>\"[v:val])) . \"]\"'), '')\nfunction! s:sid2sfuncs(sid) abort\n  let fs = split(execute(printf(':function /^%s%s_', s:SNR, a:sid)), \"\\n\")\n  let r = {}\n  let pattern = printf('\\m^function\\s<SNR>%d_\\zs\\w\\{-}\\ze(', a:sid)\n  for fname in map(fs, 'matchstr(v:val, pattern)')\n    let r[fname] = function(s:_sfuncname(a:sid, fname))\n  endfor\n  return r\nendfunction\n\n\"\" Return funcname of script local functions with SID\nfunction! s:_sfuncname(sid, funcname) abort\n  return printf('<SNR>%s_%s', a:sid, a:funcname)\nendfunction\n"
  },
  {
    "path": "autoload/vital/fzf_preview.vital",
    "content": "fzf_preview\n8e269699b0b993fc68599ed94571db5d3e933bcf\n\nVS.RPC.JSON\nAsync.Promise\nVS.System.Job\nVS.Event.Emitter\n"
  },
  {
    "path": "bin/git_actions_preview",
    "content": "#!/usr/bin/env bash\n\nif [[ $1 == 'status' ]]; then\n\tgit -c color.status=always status\nelif [[ $1 == 'branch' ]]; then\n\tgit for-each-ref --sort=-committerdate --count=10 --color=always --format=\"Date: %(color:red)%(authordate:iso)%(color:reset)  %(color:green)[%(authorname)]%(color:reset)  Ref: %(color:yellow)%(refname:short)%(color:reset)\nSubject: %(subject)\n\"\nelif [[ $1 =~ ^(log|push|fetch|pull) ]]; then\n\tgit log --decorate --pretty='format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an]' --date=iso --graph --color=always\nelif [[ $1 =~ ^current-log ]]; then\n\tfile=$(echo \"$1\" | awk -F':' '{print $2}')\n\tif [[ $file != '' ]]; then\n\t\tgit log --decorate --pretty='format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an]' --date=iso --graph --color=always -- \"$file\"\n\tfi\nelif [[ $1 =~ ^commit ]]; then\n\tgit diff --cached --color=always\nfi\n"
  },
  {
    "path": "bin/git_blame_pr",
    "content": "#! /usr/bin/perl\n#\n# Written in 2017 by Kazuho Oku\n#\n# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.\n# You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.\n\nuse strict;\nuse warnings;\n\nmy $git_blame_pid = open(my $fh, \"-|\", \"git\", \"blame\", \"--first-parent\", @ARGV)\n    or die \"failed to invoke git-blame:$!\";\n\nmy %cached; # commit-id -> substitution string\n\nwhile (my $line = <$fh>) {\n    my ($commit, $src) = split / .*?\\) /, $line, 2;\n    $cached{$commit} = lookup($commit)\n        unless $cached{$commit};\n    print $cached{$commit}, ' ', $src;\n}\n\nwhile (waitpid($git_blame_pid, 0) != $git_blame_pid) {}\nexit $?;\n\nsub lookup {\n    my $commit = shift;\n    my $message = `git show --oneline $commit`;\n    if ($message =~ /Merge\\s+(?:pull\\s+request|pr)\\s+\\#?(\\d+)\\s/i) {\n        return sprintf '%-9s', \"PR #$1\";\n    }\n    return $commit;\n}\n"
  },
  {
    "path": "bin/preview_yankround_register",
    "content": "#!/usr/bin/env bash\n\nif which gsed > /dev/null && which gcut > /dev/null; then\n  gsed -n \"$2,$2p\" \"$1\" | gcut -f 2 | gsed -e \"s/\\x0/\\n/g\"\nelse\n  sed -n \"$2,$2p\" \"$1\" | cut -f 2 | sed -e \"s/\\x0/\\n/g\"\nfi\n"
  },
  {
    "path": "doc/fzf_preview_vim.txt",
    "content": "*fzf-preview-vim.txt*\n\nAuthor:  yuki-yano\nLicense: MIT\nVersion: 0.1\n\n\n==============================================================================\nCONTENTS                                   *fzf-preview-contents*\n    Introduction                           |fzf-preview-introduction|\n    Installation                           |fzf-preview-installation|\n    Mappings                               |fzf-preview-mappings|\n    Commands                               |fzf-preview-commands|\n    Keymap                                 |fzf-preview-keymap|\n\n==============================================================================\nINTRODUCTION                              *fzf-preview-introduction*\n\n*fzf-preview* is Vim script RPC, coc extensions or Neovim remote plugin to\nprovide some fzf sources with preview.\n\nRequirements:\n- Neovim (Remote Plugin)\n    https://neovim.io/\n\n- coc.nvim (coc extensions)\n    https://github.com/neoclide/coc.nvim\n\n- Node\n    https://nodejs.org/\n\n- git\n    https://git-scm.com/\n\n- fzf\n    https://github.com/junegunn/fzf\n\n- ripgrep (Require some preview)\n    https://github.com/BurntSushi/ripgrep\n\nOptional:\n- bat (Add color to the preview)\n    https://github.com/sharkdp/bat\n\n- vim-devicons (Use devicons)\n    https://github.com/ryanoasis/vim-devicons\n\n- Fugitive (Require git integration)\n    https://github.com/tpope/vim-fugitive\n\n- Gina (Require git integration)\n    https://github.com/lambdalisue/gina.vim\n\n- universal-ctags (Requre FzfPreviewCtags and FzfPreviewBufferTags)\n    https://github.com/universal-ctags/ctags\n\n- vista.vim (Require FzfPreviewVistaCtags and FzfPreviewVistaBufferCtags)\n    https://github.com/liuchengxu/vista.vim\n\n- vim-bookmarks (Require FzfPreviewBookmarks)\n    https://github.com/MattesGroeger/vim-bookmarks\n\n- yankround.vim (Require FzfPreviewYankround)\n    https://github.com/LeafCage/yankround.vim\n\n- memolist.vim (Require FzfPreviewMemoList and FzfPreviewMemoListGrep)\n    https://github.com/glidenote/memolist.vim\n\n- todo-comments.nvim (Require FzfPreviewTodoComments)\n    https://github.com/folke/todo-comments.nvim\n\n- GitHub cli (Require integrate with GitHub)\n    https://github.com/cli/cli\n\n- Yarn (Build latest remote plugin)\n    https://classic.yarnpkg.com/\n\nLatest version:\nhttps://github.com/yuki-yano/fzf-preview.vim\n\n==============================================================================\nVIM SCRIPT RPC PLUGIN INSTALLATION        *fzf-preview-vim-rpc-installation*\n\nUse Dein, vim-plug or any Vim plugin manager of your choice.\nInstall release/rpc branch.\n\n>\n    Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }\n    Plug 'yuki-yano/fzf-preview.vim', { 'branch': 'release/rpc' }\n<\n\nor\n\n>\n    call dein#add('junegunn/fzf', { 'build': './install --all', 'merged': 0 })\n    call dein#add('yuki-yano/fzf-preview.vim', { 'rev': 'release/rpc' })\n<\n\n==============================================================================\nREMOTE PLUGIN INSTALLATION                *fzf-preview-remote-installation*\n\nInstall the npm package [neovim](https://www.npmjs.com/package/neovim)\nto get the remote plugin working.\n\n>\n    $ npm install -g neovim\n<\n\nUse Dein, vim-plug or any Vim plugin manager of your choice.\nInstall release/remote branch and `:UpdateRemotePlugins`\nwhen after installed plugin.\n\n>\n    Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }\n    Plug 'yuki-yano/fzf-preview.vim', { 'branch': 'release/remote', 'do': ':UpdateRemotePlugins' }\n<\n\nor\n\n>\n    call dein#add('junegunn/fzf', { 'build': './install --all', 'merged': 0 })\n    call dein#add('yuki-yano/fzf-preview.vim', { 'rev': 'release/remote' })\n<\n\n==============================================================================\nCOC EXTENSION INSTALLATION                   *fzf-preview-coc-installation*\n\nInstall the [coc.nvim](https://github.com/neoclide/coc.nvim)\nInstall coc extensions fzf-preview.\n\n\nuse vim-plug:\n>\n    Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }\n    Plug 'neoclide/coc.nvim', { 'branch': 'release' }\n<\n\nuse dein:\n\n>\n    call dein#add('junegunn/fzf', { 'build': './install --all', 'merged': 0 })\n    call dein#add('neoclide/coc.nvim', { 'rev': 'release', 'merged': 0 })\n<\n\nexecute after\n\n:CocInstall coc-fzf-preview\n\n==============================================================================\nCOMMANDS                                        *fzf-preview-commands*\n\nVim script RPC, Remote Plugin, and coc extensions, in that order.\n\n                                                *:FzfPreviewProjectFiles*\n:FzfPreviewProjectFilesRpc\n:FzfPreviewProjectFiles\n:CocCommand fzf-preview.ProjectFiles\n     Select and open git repository files from project. \n\n                                                *:FzfPreviewGitFiles*\n:FzfPreviewGitFilesRpc\n:FzfPreviewGitFiles\n:CocCommand fzf-preview.GitFiles\n     Select and open git repository files from git ls-files.\n\n                                                *:FzfPreviewDirectoryFiles*\n:FzfPreviewDirectoryFilesRpc {path or none}\n:FzfPreviewDirectoryFiles {path or none}\n:CocCommand fzf-preview.DirectoryFiles {path or none}\n     Select and open directory files from ripgrep with fzf interface.\n     Default to current working directory.\n\n                                                *:FzfPreviewBuffers*\n:FzfPreviewBuffersRpc\n:FzfPreviewBuffers\n:CocCommand fzf-preview.Buffers\n     Select and open file buffers.\n     Use open-buffer processes.\n\n                                                *:FzfPreviewAllBuffers*\n:FzfPreviewAllBuffersRpc\n:FzfPreviewAllBuffers\n:CocCommand fzf-preview.AllBuffers\n     Select and open all buffers(include not file).\n     Use open-bufnr processes.\n\n                                                *:FzfPreviewProjectOldFiles*\n\n:FzfPreviewProjectOldFilesRpc\n:FzfPreviewProjectOldFiles\n:CocCommand fzf-preview.ProjectOldFiles\n     Select and open the past open files in the project using fzf.\n     The target file is selected from  |v:oldfiles|.\n\n                                                *:FzfPreviewProjectMruFiles*\n:FzfPreviewProjectMruFilesRpc\n:FzfPreviewProjectMruFiles\n:CocCommand fzf-preview.ProjectMruFiles\n     Select and open the past open files in the project using fzf.\n     The target file is selected from most recently used.\n\n                                                *:FzfPreviewProjectMrwFiles*\n:FzfPreviewMrwFilesRpc\n:FzfPreviewMrwFiles\n:CocCommand fzf-preview.MrwFiles\n     Select and open the past open files in the project using fzf.\n     The target file is selected from most recently written.\n\n                                                *:FzfPreviewProjectGrep*\n:FzfPreviewProjectGrepRpc\n:FzfPreviewProjectGrep\n:CocCommand fzf-preview.ProjectGrep\n     Search text from the project.\n     The retrieved result is displayed in file name, number of lines, preview\n     and can be opened with fzf interface.\n\n                                                *:FzfPreviewProjectGrepRecall*\n:FzfPreviewProjectGrepRecallRpc\n:FzfPreviewProjectGrepRecall\n:CocCommand fzf-preview.ProjectGrepRecall\n     Run FzfPreviewProjectGrep with the same arguments as before.\n\n                                                *:FzfPreviewCTags*\n:FzfPreviewCtagsRpc\n:FzfPreviewCtags\n:CocCommand fzf-preview.Ctags\n     Select tags from tags file\n     The same script as FzfPreviewProjectGrep is used for preview.\n     Required: |universal-ctags|\n\n     Cautions:\n       Set --excmd=number or --excmd=combine to universal-ctags option\n\n                                                *:FzfPreviewBufferTags*\n:FzfPreviewBufferTagsRpc\n:FzfPreviewBufferTags\n:CocCommand fzf-preview.BufferTags\n     Select from tags of currently open buffer\n     The same script as FzfPreviewProjectGrep is used for preview.\n     Required: |universal-ctags|\n\n                                                *:FzfPreviewOldFiles*\n:FzfPreviewOldFilesRpc\n:FzfPreviewOldFiles\n:CocCommand fzf-preview.OldFiles\n     Select and open the opened file.\n     For the target file, see |v:oldfiles|.\n\n                                                *:FzfPreviewMruFiles*\n:FzfPreviewMruFilesRpc\n:FzfPreviewMruFiles\n:CocCommand fzf-preview.MruFiles\n     Select and open the opened file.\n     For the target file, most recently used.\n\n                                                *:FzfPreviewMrwFiles*\n:FzfPreviewMrwFilesRpc\n:FzfPreviewMrwFiles\n:CocCommand fzf-preview.MrwFiles\n     Select and open the opened file.\n     For the target file, most recently written.\n\n                                                *:FzfPreviewQuickFix*\n:FzfPreviewQuickFixRpc\n:FzfPreviewQuickFix\n:CocCommand fzf-preview.QuickFix\n     Select and open the QuickFix item.\n\n                                                *:FzfPreviewLocationList*\n:FzfPreviewLocationListRpc\n:FzfPreviewLocationList\n:CocCommand fzf-preview.LocationList\n     Select and open the LocationList item.\n\n                                                *:FzfPreviewLines*\n:FzfPreviewLinesRpc\n:FzfPreviewLines\n:CocCommand fzf-preview.Lines\n     Select line from current buffer.\n\n                                                *:FzfPreviewBufferLines*\n:FzfPreviewBufferLinesRpc\n:FzfPreviewBufferLines\n:CocCommand fzf-preview.BufferLines\n     Select line from all buffer\n\n                                                *:FzfPreviewJumps*\n:FzfPreviewJumpsRpc\n:FzfPreviewJumps\n:CocCommand fzf-preview.Jumps\n     Select and open the jumplist\n\n                                                *:FzfPreviewChanges*\n:FzfPreviewChangesRpc\n:FzfPreviewChanges\n:CocCommand fzf-preview.Changes\n     Select and open the changelist\n\n                                                *:FzfPreviewMarks*\n:FzfPreviewMarksRpc\n:FzfPreviewMarks\n:CocCommand fzf-preview.Marks\n     List marks from the project.\n     The retrieved result is displayed in file name, number of lines.\n     The same script as FzfPreviewProjectGrep is used for preview.\n\n                                                *:FzfPreviewFromResources*\n:FzfPreviewFromResourcesRpc\n:FzfPreviewFromResources\n:CocCommand fzf-preview.FromResources\n     Select a resource and generate a file list.\n     From there, select the file using the fzf interface.\n\n     Resources: [project, git, directory, buffer, project_old,\n                 project_mru, project_mrw, old, mru, mrw]\n\n                                                *:FzfPreviewCommandPalette*\n:FzfPreviewCommandPaletteRpc\n:FzfPreviewCommandPalette\n:CocCommand fzf-preview.CommandPalette\n     Execute and edit command history\n\n                                                *:FzfPreviewGrepHelp*\n:FzfPreviewGrepHelpRpc\n:FzfPreviewGrepHelp\n:CocCommand fzf-preview.GrepHelp\n     Grep vim help.\n\n                                                *:FzfPreviewGitStatus*\n:FzfPreviewGitStatusRpc\n:FzfPreviewGitStatus\n:CocCommand fzf-preview.GitStatus\n     Git status integration.\n\n                                                *:FzfPreviewGitActions*\n:FzfPreviewGitActionsRpc\n:FzfPreviewGitActions\n:CocCommand fzf-preview.GitActions\n     Interactive git integration.\n     Select resource and action.\n\n                                                *:FzfPreviewVistaCtags*\n:FzfPreviewVistaCtagsRpc\n:FzfPreviewVistaCtags\n:CocCommand fzf-preview.VistaCtags\n     Select tags from vista.vim.\n     Required: vista.vim\n\n                                                *:FzfPreviewVistaBufferCtags*\n:FzfPreviewVistaBufferCtagsRpc\n:FzfPreviewVistaBufferCtags\n:CocCommand fzf-preview.VistaBufferCtags\n     Select current buffer tags from vista.vim.\n     Required: vista.vim\n\n                                                *:FzfPreviewNvimLspReferences*\n:FzfPreviewNvimLspReferencesRpc\n:FzfPreviewNvimLspReferences\n     Select and open the references from nvim-lsp.\n\n                                                *:FzfPreviewNvimLspDiagnostics*\n:FzfPreviewNvimLspDiagnosticsRpc\n:FzfPreviewNvimLspDiagnostics\n     Select and open the diagnostics from nvim-lsp.\n\n                                                *:FzfPreviewNvimLspCurrentDiagnostics*\n:FzfPreviewNvimLspCurrentDiagnosticsRpc\n:FzfPreviewNvimLspCurrentDiagnostics\n     Select and open the current file diagnostics from nvim-lsp.\n\n                                                *:FzfPreviewNvimLspDefinitions*\n:FzfPreviewNvimLspDefinitionRpc\n:FzfPreviewNvimLspDefinition\n     Select and open the definitions from nvim-lsp.\n\n                                                *:FzfPreviewNvimLspTypeDefinitions*\n:FzfPreviewNvimLspTypeDefinitionsRpc\n:FzfPreviewNvimLspTypeDefinition\n     Select and open the type definitions from nvim-lsp.\n\n                                                *:FzfPreviewNvimLspImplementations*\n:FzfPreviewNvimLspImplementationsRpc\n:FzfPreviewNvimLspImplementations\n     Select and open the implementations from nvim-lsp.\n\n                                                *:FzfPreviewVimLspReferences*\n:FzfPreviewVimLspReferencesRpc\n:FzfPreviewVimLspReferences\n     Select and open the references from vim-lsp.\n\n                                                *:FzfPreviewVimLspDiagnostics*\n:FzfPreviewVimLspDiagnosticsRpc\n:FzfPreviewVimLspDiagnostics\n     Select and open the diagnostics from vim-lsp.\n\n                                                *:FzfPreviewVimLspCurrentDiagnostics*\n:FzfPreviewVimLspCurrentDiagnosticsRpc\n:FzfPreviewVimLspCurrentDiagnostics\n     Select and open the current file diagnostics from vim-lsp.\n\n                                                *:FzfPreviewVimLspDefinitions*\n:FzfPreviewVimLspDefinitionRpc\n:FzfPreviewVimLspDefinition\n     Select and open the definitions from vim-lsp.\n\n                                                *:FzfPreviewVimLspTypeDefinitions*\n:FzfPreviewVimLspTypeDefinitionsRpc\n:FzfPreviewVimLspTypeDefinition\n     Select and open the type definitions from vim-lsp.\n\n                                                *:FzfPreviewVimLspImplementations*\n:FzfPreviewVimLspImplementationsRpc\n:FzfPreviewVimLspImplementations\n     Select and open the implementations from vim-lsp.\n\n                                                *:FzfPreviewBookmarks*\n:FzfPreviewBookmarksRpc\n:FzfPreviewBookmarks\n:CocCommand fzf-preview.Bookmarks\n     Select and open the bookmarks from vim-bookmarks\n\n                                                *:FzfPreviewYankround*\n:FzfPreviewYankroundRpc\n:FzfPreviewYankround\n:CocCommand fzf-preview.Yankround\n     Select register history and insert \" register from yankround.vim\n     Use register processes.\n\n                                                *:FzfPreviewMemoList*\n:FzfPreviewMemoListRpc\n:FzfPreviewMemoList\n:CocCommand fzf-preview.MemoList\n     Select memolist and open from memolist.vim.\n\n                                                *:FzfPreviewMemoListGrep*\n:FzfPreviewMemoListGrepRpc\n:FzfPreviewMemoListGrep\n:CocCommand fzf-preview.MemoListGrep\n     Grep memolist and open from memolist.vim.\n\n                                                *:FzfPreviewTodoComments*\n:FzfPreviewTodoCommentsRpc\n:FzfPreviewTodoComments\n:CocCommand fzf-preview.TodoComments\n     Search TodoComments from todo-comments.nvim\n\n                                                *:FzfPreviewBlamePR*\n:FzfPreviewBlamePRRpc\n:FzfPreviewBlamePR\n:CocCommand fzf-preview.BlamePR\n     The PR corresponding to each line is displayed and\n     the selected PR is opened in the browser.\n     Use open-pr processes.\n\n                                                *:FzfPreviewCocReferences*\n:CocCommand fzf-preview.CocReferences\n     Select and open the references from coc.nvim.\n     Only coc extensions.\n\n                                                *:FzfPreviewCocDiagnostics*\n:CocCommand fzf-preview.CocDiagnostics\n     Select and open the diagnostics from coc.nvim.\n     Only coc extensions.\n\n                                                *:FzfPreviewCocCurrentDiagnostics*\n:CocCommand fzf-preview.CocCurrentDiagnostics\n     Select and open the current file diagnostics from coc.nvim.\n     Only coc extensions.\n\n                                                *:FzfPreviewCocDefinition*\n:CocCommand fzf-preview.CocDefinition\n     Select and open the definitions from coc.nvim.\n     Only coc extensions.\n\n                                                *:FzfPreviewCocTypeDefinition*\n:CocCommand fzf-preview.CocTypeDefinition\n     Select and open the type definitions from coc.nvim.\n     Only coc extensions.\n\n                                                *:FzfPreviewCocImplementations*\n:CocCommand fzf-preview.CocImplementations\n     Select and open the implementations from coc.nvim.\n     Only coc extensions.\n\n                                                *:FzfPreviewCocOutline*\n:CocCommand fzf-preview.CocOutline\n     Select and open the outline from coc.nvim.\n     Only coc extensions.\n\n==============================================================================\nCOMMAND OPTIONS                                 *fzf-preview-command-options*\n\n--processes\n    Set process when selecting element with fzf started by this command.\n    Value must be a global variable name.\n    Variable is dictionary and format is\n    same as get from |fzf_preview#remote#process#get_default_processes|.\n\n    Most command pass a file paths to the process.\n    FzfPreviewAllBuffers will be passed “buffer {bufnr}”\n\n    Value example: let g:foo_processes = {\n                   \\ 'enter':  'FzfPreviewOpenFileEnter',\n                   \\ 'ctrl-x': get(function('s:foo_function'), 'name'),\n                   \\ }\n\n--add-fzf-arg\n    Set the arguments to be passed when executing fzf.\n    This value is added to the default options.\n    Value must be a string without spaces.\n\n    Usage example: Exclude filename with FzfPreviewProjectGrep\n>\n    nnoremap <Leader>g :<C-u>FzfPreviewProjectGrep --add-fzf-arg=--nth=3<Space>\n    \" nnoremap <Leader>g :<C-u>CocCommand fzf-preview.ProjectGrep --add-fzf-arg=--nth=3<Space>\n<\n\n--resume\n    Reuse the input that was last used to select the element with fzf.\n    Do not need to pass a value for this option.\n\n    Usage example: Reuse last query for project grep.\n>\n    nnoremap <Leader>G :<C-u>FzfPreviewProjectGrep . --resume<Space>\n    \" nnoremap <Leader>G :<C-u>CocCommand fzf-preview.ProjectGrep . --resume<Space>\n<\n\n==============================================================================\nOPTIONS                                         *fzf-preview-options*\n\n*g:fzf_preview_floating_window_rate*\n    This value is used for the size of the floating window.\n    The size of the floating window is the size of the vim multiplied\n    by this value.\n    Set between 0 and 1.\n\n    Default value is 0.9\n\n\n*g:fzf_preview_direct_window_option*\n    This value is used to position the window.\n    It is passed to the window option of |fzf#run|, and\n    |g:fzf_preview_floating_window_rate| is disabled.\n\n    Default value is ''\n\n\n*g:fzf_preview_default_fzf_options*\n    It is used as the default option when starting fzf.\n    Set a dictionary variable whose option name is key.\n    The string you pass to value is automatically enclosed in double quotes.\n    If the value to be passed to the option is empty, set v:true.\n\n    Default value is  { '--reverse': v:true, '--preview-window': 'wrap' }\n\n\n*g:fzf_preview_quit_map*\n    If this value is 1, mapping that will safely quit\n    in fzf's normal mode and visual mode is added\n\n    Default value is 1\n\n\n*g:fzf_preview_command*\n    Shell command used for fzf preview. The head command is used by default.\n    If the bat command is installed, the bat is used by default and\n    the preview is syntax highlighted.\n\n    Not installed bat:\n        Default value is 'cat'\n\n    Installed bat:\n        Default value is 'bat --color=always --plain {-1}'\n\n\n*g:fzf_preview_if_binary_command*\n    g:fzf_binary_preview_command is executed if this command succeeds,\n    and g:fzf_preview_command is executed if it fails\n\n    Default value is '[[ \"$(file --mime {})\" =~ binary ]]'\n\n\n*g:fzf_binary_preview_command*\n    Shell command used for binary file preview.\n    Since it is heavy to display in text, if there is no particular reason,\n    echo etc. substitute.\n\n    Default value is 'echo \"{} is a binary file\"'\n\n\n*g:fzf_preview_filelist_command*\n    This is the command used to search for files in the project.\n    If ripgrep is not included, git ls-files will be used.\n\n    Installed ripgrep:\n        Default value is 'rg --files --hidden --follow --no-messages --glob \"!.git/*\" --glob \\!\"* *\"'\n\n    Not installed ripgrep:\n        Default value is 'git ls-files --exclude-standard'\n\n*g:fzf_preview_git_files_command*\n    This is the command used to search for files in the git repository.\n\n    Default value is 'git ls-files --exclude-standard'\n\n\n*g:fzf_preview_directory_files_command*\n    This is the command used to search for files in the current directory.\n\n    Default value is 'rg --files --hidden --follow --no-messages -g \\!\"* *\"'\n\n    Keep in mind a path can be append at the end of the command.\n\n\n*g:fzf_preview_git_status_command*\n    This is the command used to git status files\n\n    Default value is 'git -c color.status=always status --short --untracked-files=all'\n\n\n*g:fzf_preview_git_status_preview_command*\n    This is the command used to git status preview\n\n    Default value is  \"[[ $(git diff --cached -- {-1}) != \\\"\\\" ]] && git diff --cached --color=always -- {-1} || \" .\n                    \\ \"[[ $(git diff -- {-1}) != \\\"\\\" ]] && git diff --color=always -- {-1} || \" .\n                    \\ g:fzf_preview_command\n\n\n*g:fzf_preview_grep_cmd*\n    This command is used for project grep.\n    Recommend using a fast grep command such as ripgrep or ag.\n    Interactively grep the specified directory.\n\n    Installed ripgrep:\n        Default value is 'rg --line-number --no-heading --color=never --hidden'\n\n    Not installed ripgrep:\n        :ProjectGrepPreview is disabled.\n\n\n*g:fzf_preview_cache_directory*\n    Specify the directory to store the MRU and MRW cache files.\n\n    Default value is 'expand('~/.cache/vim/fzf_preview')'\n\n\n*g:fzf_preview_disable_mru*\n    If this value is not 0, disable mru and mrw.\n\n    Default value is 0\n\n\n*g:fzf_preview_mru_limit*\n    Limit of the number of files to be saved by mru.\n\n    Default value is 1000\n\n\n*g:fzf_preview_lines_command*\n    This command is used for get current file lines.\n\n    Installed bat:\n        Default value is 'bat --color=always --plain --number'\n\n    Not installed bat:\n        Default value is 'cat -n'\n\n\n*g:fzf_preview_grep_preview_cmd*\n    This command is used for :ProjectGrepPreview. bin/preview.rb is used by default.\n\n    Default value is 'expand(\"<sfile>:h:h\") . \"/bin/preview.rb\"'\n\n\n*g:fzf_preview_preview_key_bindings*\n    This command determines keyboard shortcuts during an interactive FZF\n    session. Options are a string passed directly to fzf's \"--bind\" option.\n\n    Default value is ''\n\n\n*g:fzf_preview_fzf_color_option*\n    Specify the color option to be passed to the fzf command.\n    Options are a string passed directly to fzf's \"--color\" option.\n\n    Default value is ''\n\n\n*g:fzf_preview_custom_processes*\n    Set the custom processes.\n    Dictionary format is { '{processes_name}': { '{input_key}': |String|(Global function name) } }\n    Default child value can be get with |fzf_preview#remote#process#get_default_processes|\n\n    Default value is {}\n\n    Example:  {\n                'open-file': {\n                  'ctrl-o': 'FzfPreviewOpenFileCtrlO',\n                  'ctrl-q': 'FzfPreviewOpenFileCtrlQ',\n                  'ctrl-t': 'FzfPreviewOpenFileCtrlT',\n                  'ctrl-v': 'FzfPreviewOpenFileCtrlV',\n                  'ctrl-x': 'FzfPreviewOpenFileCtrlX',\n                  'enter': 'FzfPreviewOpenFileEnter'\n                },\n                'register': {\n                  'enter': 'FzfPreviewRegisterEnter'\n                }\n              }\n\n\n*g:fzf_preview_fzf_preview_window_option*\n    Used as fzf preview-window option\n\n    For example, 'up:30%'\n\n    Default value is ''\n\n\n*g:fzf_preview_use_dev_icons*\n    If this value is 1, devicons is used as fzf candidate.\n\n    Default value is 0\n\n\n*g:fzf_preview_history_dir*\n    If this value is directory path, use the files in the target directory\n    and the fzf history option will be enabled.\n\n    For example, '~/.fzf'\n\n    Default value is false\n\n\n*g:fzf_preview_dev_icon_prefix_string_length*\n    Set how many string length devicon is represented.\n\n    Default value is 3\n\n\n*g:fzf_preview_dev_icons_limit*\n    Devicons can make fzf-preview slow when the number of results is high.\n    By default icons are disable when number of results is higher this value.\n\n    Default value is 5000\n\n\n*g:fzf_preview_yankround_preview_command*\n    Command to preview yankround history.\n\n    Defaul value is expand('<sfile>:h:h') . '/bin/preview_yankround_register'\n\n*g:fzf_preview_blame_pr_command*\n    Command to FzfPreviewBlamePR source.\n\n    Defaul value is expand('<sfile>:h:h') . '/bin/git_blame_pr'\n\n*g:fzf_preview_update_statusline*\n    If true, statusline is updated during fzf-preview startup.\n\n    Defaul value is true\n\n*$FZF_PREVIEW_PREVIEW_BAT_THEME*\n    The theme used in the bat preview.\n    Default value is 'OneHalfDark'\n\n*$FZF_PREVIEW_PLUGIN_HELP_ROOT_DIR*\n    The root directory to be searched by GrepHelp.\n    Default value is ''\n\n\n==============================================================================\nFUNCTIONS                                       *fzf-preview-functions*\n\n*fzf_preview#remote#process#get_default_processes*\n    Get the initial value of the processes.\n    Args is {process_name} and {plugin_type (optional)}.\n    processes_name is 'open-file', 'open-buffer' and 'open-bufnr'.\n    plugin_type is 'remote', 'coc' or 'rpc'. Default value is 'remote'.\n\n    value from 'open-file' (and 'remote') is\n      {\n        'ctrl-o': 'FzfPreviewOpenFileCtrlO',\n        'ctrl-q': 'FzfPreviewOpenFileCtrlQ',\n        'ctrl-t': 'FzfPreviewOpenFileCtrlT',\n        'ctrl-v': 'FzfPreviewOpenFileCtrlV',\n        'ctrl-x': 'FzfPreviewOpenFileCtrlX',\n        'enter': 'FzfPreviewOpenFileEnter'\n      }\n\n    value from 'open-file' and 'coc' is\n      {\n        'ctrl-o': 'OpenFileCtrlO',\n        'ctrl-q': 'OpenFileCtrlQ',\n        'ctrl-t': 'OpenFileCtrlT',\n        'ctrl-v': 'OpenFileCtrlV',\n        'ctrl-x': 'OpenFileCtrlX',\n        'enter': 'OpenFileEnter'\n      }\n\n    value from 'open-file' and 'rpc' is\n      {\n        'ctrl-o': 'FzfPreviewOpenFileCtrlO',\n        'ctrl-q': 'FzfPreviewOpenFileCtrlQ',\n        'ctrl-t': 'FzfPreviewOpenFileCtrlT',\n        'ctrl-v': 'FzfPreviewOpenFileCtrlV',\n        'ctrl-x': 'FzfPreviewOpenFileCtrlX',\n        'enter': 'FzfPreviewOpenFileEnter'\n      }\n\n==============================================================================\nUSER AUTOCMD EVENTS                        *fzf-preview-user-autocmd-events*\n\n*fzf_preview#remote#initialized*\n    Runs when initialization of the Remote Plugin is complete.\n\n*fzf_preview#rpc#initialized*\n    Runs when initialization of the Vim script RPC is complete.\n\n*fzf_preview#coc#initialized*\n    Runs when initialization of the coc extensions is complete.\n\nDeprecated\n*fzf_preview#initialized*\n    Runs when initialization of the Remote Plugin, coc extensions and\n    Vim script RPC is complete.\n\n==============================================================================\nBASE DEFAULT KEYMAP                             *fzf-preview-keymap*\n\n<C-g>, <Esc>\n  - Cancel fzf\n\n<C-x>\n  - Open split\n\n<C-v>\n  - Open vsplit\n\n<C-t>\n  - Open tabedit\n\n<C-o>\n  - Open drop\n\n<C-q>\n  - Build QuickFix from open-file processes.\n  - Execute :bdelete! command from open-buffer and open-bufnr processes.\n\n<C-d>\n  - Preview page down\n\n<C-u>\n  - Preview page up\n\n?\n  - Toggle Preview\n\n==============================================================================\nEXAMPLE                                         *fzf-preview-mappings*\n\nHere is mapping example.\n>\n    nnoremap <silent> <Leader>p :<C-u>FzfPreviewProjectFiles<CR>\n    nnoremap <silent> <Leader>b :<C-u>FzfPreviewBuffers<CR>\n    nnoremap <silent> <Leader>m :<C-u>FzfPreviewProjectOldFiles<CR>\n    nnoremap <silent> <Leader>M :<C-u>FzfPreviewOldFiles<CR>\n<\nvim:tw=78:sw=2:ts=2:ft=help:norl:nowrap:\n"
  },
  {
    "path": "jest.config.ts",
    "content": "import type { Config } from \"@jest/types\"\n\nconst config: Config.InitialOptions = {\n  verbose: true,\n  preset: \"ts-jest/presets/js-with-ts\",\n  transform: {\n    \"^.+\\\\.ts$\": \"ts-jest\",\n  },\n  moduleNameMapper: {\n    \"^@/(.*)$\": \"<rootDir>/src/$1\",\n  },\n  testMatch: [\"**/*.test.ts\"],\n  restoreMocks: true,\n  clearMocks: true,\n  resetMocks: true,\n}\n\nexport default config\n"
  },
  {
    "path": "lua/fzf-preview/init.lua",
    "content": "local M = {}\n\nlocal lsp = vim.lsp\n\nfunction M.nvim_lsp_references()\n  vim.g.fzf_preview_nvim_lsp_references = nil\n\n  local method = 'textDocument/references'\n  ---@diagnostic disable-next-line: missing-parameter\n  local params = lsp.util.make_position_params()\n  params.context = { includeDeclaration = false }\n  local response = lsp.buf_request_sync(0, method, params, 1000)\n\n  if response == nil or vim.tbl_isempty(response) then\n    print('No location found: ' .. method)\n    return\n  end\n\n  local result = {}\n  for _, v in pairs(response) do\n    vim.list_extend(result, v.result)\n  end\n  vim.g.fzf_preview_nvim_lsp_references = result\nend\n\nfunction M.nvim_lsp_diagnostics()\n  vim.g.fzf_preview_nvim_lsp_diagnostics = vim.diagnostic.get()\nend\n\nfunction M.nvim_lsp_current_diagnostics()\n  vim.g.fzf_preview_nvim_lsp_current_diagnostics = vim.diagnostic.get(0)\nend\n\nfunction M.nvim_lsp_definition()\n  vim.g.fzf_preview_nvim_lsp_definition = nil\n\n  local method = 'textDocument/definition'\n  ---@diagnostic disable-next-line: missing-parameter\n  local params = lsp.util.make_position_params()\n  local response = lsp.buf_request_sync(0, method, params, 1000)\n\n  if response == nil or vim.tbl_isempty(response) then\n    print('No location found: ' .. method)\n    return\n  end\n\n  local result = {}\n  for _, v in pairs(response) do\n    vim.list_extend(result, v.result)\n  end\n  vim.g.fzf_preview_nvim_lsp_definition = result\nend\n\nfunction M.nvim_lsp_type_definition()\n  vim.g.fzf_preview_nvim_lsp_type_definition = nil\n\n  local method = 'textDocument/typeDefinition'\n  ---@diagnostic disable-next-line: missing-parameter\n  local params = lsp.util.make_position_params()\n  local response = lsp.buf_request_sync(0, method, params, 1000)\n\n  if response == nil or vim.tbl_isempty(response) then\n    print('No location found: ' .. method)\n    return\n  end\n\n  local result = {}\n  for _, v in pairs(response) do\n    vim.list_extend(result, v.result)\n  end\n  vim.g.fzf_preview_nvim_lsp_type_definition = result\nend\n\nfunction M.nvim_lsp_implementations()\n  vim.g.fzf_preview_nvim_lsp_implementations = nil\n\n  local method = 'textDocument/implementation'\n  ---@diagnostic disable-next-line: missing-parameter\n  local params = lsp.util.make_position_params()\n  local response = lsp.buf_request_sync(0, method, params, 1000)\n\n  if response == nil or vim.tbl_isempty(response) then\n    print('No location found: ' .. method)\n    return\n  end\n\n  local result = {}\n  for _, v in pairs(response) do\n    vim.list_extend(result, v.result)\n  end\n  vim.g.fzf_preview_nvim_lsp_implementations = result\nend\n\nreturn M\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"coc-fzf-preview\",\n  \"version\": \"2.16.6\",\n  \"description\": \"The plugin that powerfully integrates fzf and (Neo)vim. It is also possible to integrate with coc.nvim.\",\n  \"author\": \"yuki-yano\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"url\": \"git@github.com:yuki-yano/fzf-preview.vim\"\n  },\n  \"main\": \"./lib/coc.js\",\n  \"files\": [\n    \"lib/coc.js\",\n    \"autoload\",\n    \"plugin\",\n    \"bin\"\n  ],\n  \"keywords\": [\n    \"coc.nvim\",\n    \"fzf\"\n  ],\n  \"engines\": {\n    \"coc\": \"^0.0.80\",\n    \"node\": \">=12.0.0\"\n  },\n  \"activationEvents\": [\n    \"*\"\n  ],\n  \"scripts\": {\n    \"build\": \"npm-run-all --parallel build:*\",\n    \"build:remote\": \"yarn run webpack --config webpack.remote.ts\",\n    \"build:coc\": \"yarn run webpack --config webpack.coc.ts\",\n    \"build:rpc\": \"yarn run webpack --config webpack.rpc.ts\",\n    \"build:preview-script\": \"yarn run webpack --config webpack.preview.ts\",\n    \"dev\": \"npm-run-all --parallel dev:*\",\n    \"dev:remote\": \"yarn run webpack --watch --config webpack.remote.ts\",\n    \"dev:coc\": \"yarn run webpack --watch --config webpack.coc.ts\",\n    \"dev:rpc\": \"yarn run webpack --watch --config webpack.rpc.ts\",\n    \"release-build:remote\": \"yarn run clean && yarn run build:remote --mode=production\",\n    \"release-build:coc\": \"yarn run clean && yarn run build:coc --mode=production\",\n    \"release-build:rpc\": \"yarn run clean && yarn run build:rpc --mode=production\",\n    \"typecheck\": \"tsc --noEmit\",\n    \"typecheck:watch\": \"tsc --noEmit --watch\",\n    \"lint\": \"eslint --ext .ts src\",\n    \"lint:fix\": \"eslint --ext .ts --fix src\",\n    \"lint:watch\": \"esw --watch --color --clear --ext .ts src\",\n    \"prettier\": \"prettier --check src/**/*.ts\",\n    \"prettier:fix\": \"prettier --write src/**/*.ts\",\n    \"test\": \"jest\",\n    \"test:watch\": \"jest --watch\",\n    \"cli\": \"ts-node --files -r tsconfig-paths/register\",\n    \"clean\": \"rimraf lib rplugin/node/fzf-preview.vim/index.js\",\n    \"print-version\": \"cat package.json | yarn run --silent json version\"\n  },\n  \"dependencies\": {\n    \"@reduxjs/toolkit\": \"^1.8.5\",\n    \"camelcase\": \"^6.3.0\",\n    \"chalk\": \"^5.0.1\",\n    \"coc.nvim\": \"^0.0.82\",\n    \"expand-tilde\": \"^2.0.2\",\n    \"immer\": \"^9.0.15\",\n    \"lodash\": \"^4.17.20\",\n    \"neovim\": \"^4.10.1\",\n    \"printf\": \"^0.6.0\",\n    \"redux\": \"^4.2.0\",\n    \"strip-ansi\": \"^7.0.1\",\n    \"type-fest\": \"^2.19.0\",\n    \"uuid\": \"^9.0.0\",\n    \"vscode-jsonrpc\": \"^8.0.2\",\n    \"vscode-languageserver-types\": \"^3.17.2\",\n    \"yargs\": \"^17.5.1\"\n  },\n  \"devDependencies\": {\n    \"@jest/types\": \"^29.0.3\",\n    \"@types/eslint\": \"^8.4.6\",\n    \"@types/expand-tilde\": \"^2.0.0\",\n    \"@types/jest\": \"^29.0.1\",\n    \"@types/lodash\": \"^4.14.185\",\n    \"@types/node\": \"^18.7.16\",\n    \"@types/prettier\": \"^2.7.0\",\n    \"@types/rimraf\": \"^3.0.2\",\n    \"@types/uuid\": \"^8.3.4\",\n    \"@types/webpack\": \"^5.28.0\",\n    \"@types/webpack-merge\": \"^5.0.0\",\n    \"@types/yargs\": \"^17.0.12\",\n    \"@typescript-eslint/eslint-plugin\": \"^5.36.2\",\n    \"@typescript-eslint/parser\": \"^5.36.2\",\n    \"can-npm-publish\": \"^1.3.6\",\n    \"eslint\": \"^8.23.0\",\n    \"eslint-config-airbnb-base\": \"^15.0.0\",\n    \"eslint-config-prettier\": \"^8.5.0\",\n    \"eslint-import-resolver-typescript\": \"^3.5.1\",\n    \"eslint-plugin-eslint-comments\": \"^3.2.0\",\n    \"eslint-plugin-import\": \"^2.26.0\",\n    \"eslint-plugin-jest\": \"^27.0.4\",\n    \"eslint-plugin-n\": \"^15.2.5\",\n    \"eslint-plugin-simple-import-sort\": \"^8.0.0\",\n    \"eslint-watch\": \"^8.0.0\",\n    \"jest\": \"^29.0.3\",\n    \"json\": \"^11.0.0\",\n    \"npm-run-all\": \"^4.1.5\",\n    \"prettier\": \"^2.7.1\",\n    \"rimraf\": \"^3.0.2\",\n    \"ts-jest\": \"^29.0.0\",\n    \"ts-loader\": \"^9.3.1\",\n    \"ts-node\": \"^10.9.1\",\n    \"tsconfig-paths\": \"^4.1.0\",\n    \"typescript\": \"^4.8.3\",\n    \"webpack\": \"^5.74.0\",\n    \"webpack-cli\": \"^4.10.0\",\n    \"webpack-merge\": \"^5.8.0\"\n  }\n}\n"
  },
  {
    "path": "plugin/fzf_preview.vim",
    "content": "scriptencoding utf-8\n\nif exists('s:loaded')\n  finish\nendif\nlet s:loaded = 1\n\nif !exists('$FZF_PREVIEW_PREVIEW_BAT_THEME')\n  let $FZF_PREVIEW_PREVIEW_BAT_THEME = 'OneHalfDark'\nendif\n\nlet s:bat_theme_option = '--theme=' . $FZF_PREVIEW_PREVIEW_BAT_THEME\n\nif !exists('g:fzf_preview_floating_window_rate')\n  let g:fzf_preview_floating_window_rate = 0.9\nendif\n\nif !exists('g:fzf_preview_direct_window_option')\n  let g:fzf_preview_direct_window_option = ''\nendif\n\nif !exists('g:fzf_preview_default_fzf_options')\n  let g:fzf_preview_default_fzf_options = {\n  \\ '--reverse': v:true,\n  \\ '--preview-window': 'wrap',\n  \\ }\nendif\n\nif !exists('g:fzf_preview_quit_map')\n  let g:fzf_preview_quit_map = 1\nendif\n\nif !exists('g:fzf_preview_command')\n  if executable('bat')\n    let g:fzf_preview_command = 'bat ' . s:bat_theme_option . ' --color=always --plain --number {-1}'\n  else\n    let g:fzf_preview_command = 'head -100 {-1}'\n  endif\nendif\n\nif !exists('g:fzf_preview_if_binary_command')\n  let g:fzf_preview_if_binary_command = '[[ \"$(file --mime {})\" =~ binary ]]'\nendif\n\nif !exists('g:fzf_binary_preview_command')\n  let g:fzf_binary_preview_command = 'echo \"{} is a binary file\"'\nendif\n\nif !exists('g:fzf_preview_filelist_command')\n  if executable('rg')\n    let g:fzf_preview_filelist_command = \"rg --files --hidden --no-messages --glob '!.git/*' --glob \\!'* *'\"\n  else\n    let g:fzf_preview_filelist_command = 'git ls-files --exclude-standard'\n  endif\nendif\n\nif !exists('g:fzf_preview_git_files_command')\n  let g:fzf_preview_git_files_command = 'git ls-files --exclude-standard'\nendif\n\nif !exists('g:fzf_preview_directory_files_command')\n  let g:fzf_preview_directory_files_command = 'rg --files --hidden --no-messages -g \\!\"* *\"'\nendif\n\nif !exists('g:fzf_preview_git_status_command')\n  let g:fzf_preview_git_status_command = 'git -c color.status=always status --short --untracked-files=all'\nendif\n\nif !exists('g:fzf_preview_git_status_preview_command')\n  let g:fzf_preview_git_status_preview_command =  '[[ $(git diff --cached -- {-1}) != \"\" ]] && git diff --cached --color=always -- {-1} || ' .\n  \\ '[[ $(git diff -- {-1}) != \"\" ]] && git diff --color=always -- {-1} || ' .\n  \\ g:fzf_preview_command\nendif\n\nif !exists('g:fzf_preview_grep_cmd')\n  let g:fzf_preview_grep_cmd = 'rg --line-number --no-heading --color=never --hidden'\nendif\n\nif !exists('g:fzf_preview_lines_command')\n  if executable('bat')\n    let g:fzf_preview_lines_command = 'bat ' . s:bat_theme_option . ' --color=always --plain --number'\n  else\n    let g:fzf_preview_lines_command = 'cat -n'\n  endif\nendif\n\nif !exists('g:fzf_preview_grep_preview_cmd')\n  let g:fzf_preview_grep_preview_cmd = expand('<sfile>:h:h') . '/bin/preview_fzf_grep'\nendif\n\nif !exists('g:fzf_preview_disable_mru')\n  let g:fzf_preview_disable_mru = 0\nendif\n\nif !exists('g:fzf_preview_mru_limit')\n  let g:fzf_preview_mru_limit = 1000\nendif\n\nif !exists('g:fzf_preview_cache_directory')\n  let g:fzf_preview_cache_directory = expand('~/.cache/vim/fzf_preview')\nendif\n\nif !exists('g:fzf_preview_fzf_color_option')\n  let g:fzf_preview_fzf_color_option = ''\nendif\n\nif !exists('g:fzf_preview_custom_processes')\n  let g:fzf_preview_custom_processes = {}\nendif\n\nif !exists('g:fzf_preview_fzf_preview_window_option')\n  let g:fzf_preview_fzf_preview_window_option = ''\nendif\n\nif !exists('g:fzf_preview_preview_key_bindings')\n  let g:fzf_preview_preview_key_bindings = ''\nendif\n\nif !exists('g:fzf_preview_history_dir')\n  let g:fzf_preview_history_dir = v:false\nendif\n\nif !exists('g:fzf_preview_buffers_jump')\n  let g:fzf_preview_buffers_jump = 0\nendif\n\nif !exists('g:fzf_preview_use_dev_icons')\n  let g:fzf_preview_use_dev_icons = 0\nendif\n\nif !exists('g:fzf_preview_dev_icon_prefix_string_length')\n  let g:fzf_preview_dev_icon_prefix_string_length = 3\nendif\n\nif !exists('g:fzf_preview_dev_icons_limit')\n  let g:fzf_preview_dev_icons_limit = 5000\nendif\n\nif !exists('g:fzf_preview_yankround_preview_command')\n  let g:fzf_preview_yankround_preview_command = expand('<sfile>:h:h') . '/bin/preview_yankround_register'\nendif\n\nif !exists('g:fzf_preview_blame_pr_command')\n  let g:fzf_preview_blame_pr_command = expand('<sfile>:h:h') . '/bin/git_blame_pr'\nendif\n\nif !exists('g:fzf_preview_update_statusline')\n  let g:fzf_preview_update_statusline = v:true\nendif\n\nlet g:fzf_preview_script_dir = expand('<sfile>:h:h') . '/bin'\n\nlet s:save_cpo = &cpoptions\nset cpoptions&vim\n\ncommand! FzfPreviewInstall :call fzf_preview#install()\n\naugroup fzf_preview_buffers\n  autocmd!\n  if g:fzf_preview_quit_map\n    autocmd FileType fzf tnoremap <silent> <buffer> <Esc> <C-g>\n    autocmd FileType fzf nnoremap <silent> <buffer> <C-g> i<C-g>\n    autocmd FileType fzf vnoremap <silent> <buffer> <C-g> <Esc>i<C-g>\n  endif\naugroup END\n\naugroup fzf_preview_mr\n  autocmd!\n\n  if g:fzf_preview_disable_mru == 0\n    autocmd BufEnter,VimEnter,BufWinEnter,BufWritePost * call s:mru_append(expand('<amatch>'))\n    autocmd BufWritePost * call s:mrw_append(expand('<amatch>'))\n  endif\naugroup END\n\nfunction! s:mru_append(path) abort\n  if s:enable_file(a:path)\n    call fzf_preview#remote#mr#append(a:path, fzf_preview#remote#mr#mru_file_path())\n  endif\nendfunction\n\nfunction! s:mrw_append(path) abort\n  if s:enable_file(a:path)\n    call fzf_preview#remote#mr#append(a:path, fzf_preview#remote#mr#mrw_file_path())\n  endif\nendfunction\n\nfunction! s:enable_file(path) abort\n  if bufnr('%') != expand('<abuf>') || a:path == ''\n    return v:false\n  else\n    return v:true\n  endif\nendfunction\n\naugroup fzf_preview_initialized\n  autocmd!\n  autocmd VimEnter *       call s:doautocmd_from_remote()\n  autocmd User CocNvimInit call s:doautocmd_from_coc()\n  autocmd VimEnter *       call s:doautocmd_from_rpc()\n\n  autocmd FileType fzf call fzf_preview#remote#window#set_fzf_last_query()\n\n  autocmd FileType fzf call fzf_preview#remote#window#set_status_line(v:false)\naugroup END\n\nfunction! s:doautocmd_from_remote() abort\n  if exists(':FzfPreviewRemoteEnvironment')\n    let g:fzf_preview_has_remote = v:true\n    silent doautocmd User fzf_preview#initialized\n    silent doautocmd User fzf_preview#remote#initialized\n  endif\nendfunction\n\nfunction! s:doautocmd_from_coc() abort\n  silent doautocmd User fzf_preview#initialized\n  silent doautocmd User fzf_preview#coc#initialized\nendfunction\n\nfunction! s:doautocmd_from_rpc() abort\n  call fzf_preview#rpc#initialize()\nendfunction\n\ncommand! -nargs=? FzfPreviewProjectFilesRpc call fzf_preview#rpc#command('FzfPreviewProjectFiles', <f-args>)\ncommand! -nargs=? FzfPreviewGitFilesRpc call fzf_preview#rpc#command('FzfPreviewGitFiles', <f-args>)\ncommand! -nargs=? FzfPreviewDirectoryFilesRpc call fzf_preview#rpc#command('FzfPreviewDirectoryFiles', <f-args>)\ncommand! -nargs=? FzfPreviewBuffersRpc call fzf_preview#rpc#command('FzfPreviewBuffers', <f-args>)\ncommand! -nargs=? FzfPreviewAllBuffersRpc call fzf_preview#rpc#command('FzfPreviewAllBuffers', <f-args>)\ncommand! -nargs=? FzfPreviewProjectOldFilesRpc call fzf_preview#rpc#command('FzfPreviewProjectOldFiles', <f-args>)\ncommand! -nargs=? FzfPreviewProjectMruFilesRpc call fzf_preview#rpc#command('FzfPreviewProjectMruFiles', <f-args>)\ncommand! -nargs=? FzfPreviewProjectMrwFilesRpc call fzf_preview#rpc#command('FzfPreviewProjectMrwFiles', <f-args>)\ncommand! -nargs=? FzfPreviewLinesRpc call fzf_preview#rpc#command('FzfPreviewLines', <f-args>)\ncommand! -nargs=? FzfPreviewBufferLinesRpc call fzf_preview#rpc#command('FzfPreviewBufferLines', <f-args>)\ncommand! -nargs=? FzfPreviewCtagsRpc call fzf_preview#rpc#command('FzfPreviewCtags', <f-args>)\ncommand! -nargs=? FzfPreviewBufferTagsRpc call fzf_preview#rpc#command('FzfPreviewBufferTags', <f-args>)\ncommand! -nargs=? FzfPreviewOldFilesRpc call fzf_preview#rpc#command('FzfPreviewOldFiles', <f-args>)\ncommand! -nargs=? FzfPreviewMruFilesRpc call fzf_preview#rpc#command('FzfPreviewMruFiles', <f-args>)\ncommand! -nargs=? FzfPreviewMrwFilesRpc call fzf_preview#rpc#command('FzfPreviewMrwFiles', <f-args>)\ncommand! -nargs=? FzfPreviewQuickFixRpc call fzf_preview#rpc#command('FzfPreviewQuickFix', <f-args>)\ncommand! -nargs=? FzfPreviewLocationListRpc call fzf_preview#rpc#command('FzfPreviewLocationList', <f-args>)\ncommand! -nargs=? FzfPreviewJumpsRpc call fzf_preview#rpc#command('FzfPreviewJumps', <f-args>)\ncommand! -nargs=? FzfPreviewChangesRpc call fzf_preview#rpc#command('FzfPreviewChanges', <f-args>)\ncommand! -nargs=? FzfPreviewMarksRpc call fzf_preview#rpc#command('FzfPreviewMarks', <f-args>)\ncommand! -nargs=? FzfPreviewProjectGrepRpc call fzf_preview#rpc#command('FzfPreviewProjectGrep', <f-args>)\ncommand! -nargs=? FzfPreviewProjectGrepRecallRpc call fzf_preview#rpc#command('FzfPreviewProjectGrepRecall', <f-args>)\ncommand! -nargs=? FzfPreviewFromResourcesRpc call fzf_preview#rpc#command('FzfPreviewFromResources', <f-args>)\ncommand! -nargs=? FzfPreviewCommandPaletteRpc call fzf_preview#rpc#command('FzfPreviewCommandPalette', <f-args>)\ncommand! -nargs=1 FzfPreviewGrepHelpRpc call fzf_preview#rpc#command('FzfPreviewGrepHelp', <f-args>)\ncommand! -nargs=? FzfPreviewGitActionsRpc call fzf_preview#rpc#command('FzfPreviewGitActions', <f-args>)\ncommand! -nargs=? FzfPreviewGitStatusRpc call fzf_preview#rpc#command('FzfPreviewGitStatus', <f-args>)\ncommand! -nargs=? FzfPreviewGitStatusActionsRpc call fzf_preview#rpc#command('FzfPreviewGitStatusActions', <f-args>)\ncommand! -nargs=? FzfPreviewGitBranchesRpc call fzf_preview#rpc#command('FzfPreviewGitBranches', <f-args>)\ncommand! -nargs=? FzfPreviewGitBranchActionsRpc call fzf_preview#rpc#command('FzfPreviewGitBranchActions', <f-args>)\ncommand! -nargs=? FzfPreviewGitLogsRpc call fzf_preview#rpc#command('FzfPreviewGitLogs', <f-args>)\ncommand! -nargs=? FzfPreviewGitCurrentLogsRpc call fzf_preview#rpc#command('FzfPreviewGitCurrentLogs', <f-args>)\ncommand! -nargs=? FzfPreviewGitLogActionsRpc call fzf_preview#rpc#command('FzfPreviewGitLogActions', <f-args>)\ncommand! -nargs=? FzfPreviewGitStashesRpc call fzf_preview#rpc#command('FzfPreviewGitStashes', <f-args>)\ncommand! -nargs=? FzfPreviewGitStashActionsRpc call fzf_preview#rpc#command('FzfPreviewGitStashActions', <f-args>)\ncommand! -nargs=? FzfPreviewGitReflogsRpc call fzf_preview#rpc#command('FzfPreviewGitReflogs', <f-args>)\ncommand! -nargs=? FzfPreviewGitReflogActionsRpc call fzf_preview#rpc#command('FzfPreviewGitReflogActions', <f-args>)\ncommand! -nargs=? FzfPreviewVimLspReferencesRpc call fzf_preview#rpc#command('FzfPreviewVimLspReferences', <f-args>)\ncommand! -nargs=? FzfPreviewVimLspDiagnosticsRpc call fzf_preview#rpc#command('FzfPreviewVimLspDiagnostics', <f-args>)\ncommand! -nargs=? FzfPreviewVimLspCurrentDiagnosticsRpc call fzf_preview#rpc#command('FzfPreviewVimLspCurrentDiagnostics', <f-args>)\ncommand! -nargs=? FzfPreviewVimLspDefinitionRpc call fzf_preview#rpc#command('FzfPreviewVimLspDefinition', <f-args>)\ncommand! -nargs=? FzfPreviewVimLspTypeDefinitionRpc call fzf_preview#rpc#command('FzfPreviewVimLspTypeDefinition', <f-args>)\ncommand! -nargs=? FzfPreviewVimLspImplementationRpc call fzf_preview#rpc#command('FzfPreviewVimLspImplementation', <f-args>)\ncommand! -nargs=? FzfPreviewNvimLspReferencesRpc call fzf_preview#rpc#command('FzfPreviewNvimLspReferences', <f-args>)\ncommand! -nargs=? FzfPreviewNvimLspDiagnosticsRpc call fzf_preview#rpc#command('FzfPreviewNvimLspDiagnostics', <f-args>)\ncommand! -nargs=? FzfPreviewNvimLspCurrentDiagnosticsRpc call fzf_preview#rpc#command('FzfPreviewNvimLspCurrentDiagnostics', <f-args>)\ncommand! -nargs=? FzfPreviewNvimLspDefinitionRpc call fzf_preview#rpc#command('FzfPreviewNvimLspDefinition', <f-args>)\ncommand! -nargs=? FzfPreviewNvimLspTypeDefinitionRpc call fzf_preview#rpc#command('FzfPreviewNvimLspTypeDefinition', <f-args>)\ncommand! -nargs=? FzfPreviewNvimLspImplementationRpc call fzf_preview#rpc#command('FzfPreviewNvimLspImplementation', <f-args>)\ncommand! -nargs=? FzfPreviewBookmarksRpc call fzf_preview#rpc#command('FzfPreviewBookmarks', <f-args>)\ncommand! -nargs=? FzfPreviewYankroundRpc call fzf_preview#rpc#command('FzfPreviewYankround', <f-args>)\ncommand! -nargs=? FzfPreviewMemoListRpc call fzf_preview#rpc#command('FzfPreviewMemoList', <f-args>)\ncommand! -nargs=? FzfPreviewMemoListGrepRpc call fzf_preview#rpc#command('FzfPreviewMemoListGrep', <f-args>)\ncommand! -nargs=? FzfPreviewTodoCommentsRpc call fzf_preview#rpc#command('FzfPreviewTodoComments', <f-args>)\ncommand! -nargs=? FzfPreviewVistaCtagsRpc call fzf_preview#rpc#command('FzfPreviewVistaCtags', <f-args>)\ncommand! -nargs=? FzfPreviewVistaBufferCtagsRpc call fzf_preview#rpc#command('FzfPreviewVistaBufferCtags', <f-args>)\ncommand! -nargs=? FzfPreviewBlamePRRpc call fzf_preview#rpc#command('FzfPreviewBlamePR', <f-args>)\n\nlet &cpoptions = s:save_cpo\nunlet s:save_cpo\n\n\" vim:set expandtab shiftwidth=2 softtabstop=2 tabstop=2 foldenable foldmethod=marker:\n"
  },
  {
    "path": "rplugin/node/fzf-preview.vim/.keep",
    "content": ""
  },
  {
    "path": "scripts/preview.js",
    "content": "const { execSync } = require(\"child_process\")\nconst path = require(\"path\")\nconst { existsSync } = require(\"fs\")\nconst util = require(\"util\")\nconst glob = util.promisify(require(\"glob\"))\n\nconst MAX_BUFFER_SIZE = 1024 * 1024 * 1000\nconst BAT_THEME = process.env.FZF_PREVIEW_PREVIEW_BAT_THEME || \"OneHalfDark\"\nconst VIM_RUNTIME_DIR = process.env.VIMRUNTIME || \"\"\nconst HELP_ROOT_DIR = process.env.FZF_PREVIEW_PLUGIN_HELP_ROOT_DIR || \"\"\n\nconst GREP_OUTPUT_REGEX = /^(?<devIcon>.\\s\\s)?(?<fileName>[^:]+):(?<lineNum>\\d+)(:(?<col>\\d+))?(:(?<match>.*))?/\n\nconst expandHome = (filePath) => {\n  if (filePath.startsWith(\"~\")) {\n    return path.join(process.env.HOME, filePath.slice(1))\n  }\n\n  return filePath\n}\n\nconst isInstalled = (command) => {\n  try {\n    execSync(`which ${command.split(\" \")[0]}`, { encoding: \"utf-8\" })\n    return true\n  } catch (_) {\n    return false\n  }\n}\n\nconst main = async () => {\n  const match = GREP_OUTPUT_REGEX.exec(process.argv[2])\n\n  if (match == null) {\n    console.log(\n      \"Cannot process the entry :(\\n\",\n      \"Please open an issue and describe what happened\\n\",\n      \"including information such as file name and g:fzf_preview_grep_cmd\"\n    )\n\n    process.exit(1)\n  }\n\n  let fileName = match.groups[\"fileName\"]\n  const lineNum = Number(match.groups[\"lineNum\"])\n\n  if (!existsSync(fileName)) {\n    let helpFileList = []\n    if (VIM_RUNTIME_DIR != \"\") {\n      helpFileList = await glob(`${VIM_RUNTIME_DIR}/doc/*`)\n    }\n\n    if (HELP_ROOT_DIR != \"\") {\n      helpFileList = [...helpFileList, ...(await glob(`${expandHome(HELP_ROOT_DIR)}/**/doc/*`))]\n    }\n\n    const matchHelpFile = helpFileList.find((file) => file.split(\"/\").slice(-1)[0] === fileName)\n    if (matchHelpFile == null) {\n      process.exit(1)\n    } else {\n      fileName = matchHelpFile\n    }\n  }\n\n  const cats = [`bat --highlight-line=\"${lineNum}\" --color=always --theme=\"${BAT_THEME}\" --plain --number`, \"cat\"]\n  const cat = cats.find((cat) => isInstalled(cat))\n\n  const result = execSync(`${cat} ${fileName}`, { encoding: \"utf-8\", maxBuffer: MAX_BUFFER_SIZE })\n\n  if (cat === \"cat\") {\n    for (const [index, line] of result.split(\"\\n\").entries()) {\n      if (lineNum - 1 === index) {\n        console.log(`\\x1b[1m\\x1b[4m\\x1b[31m${line}\\x1b[0m`)\n      } else {\n        console.log(line)\n      }\n    }\n  } else {\n    console.log(result)\n  }\n}\n\nmain()\n"
  },
  {
    "path": "src/@types/index.d.ts",
    "content": "declare namespace NodeJS {\n  interface ProcessEnv {\n    readonly VIMRUNTIME: string\n    readonly FZF_PREVIEW_PLUGIN_HELP_ROOT_DIR?: string\n  }\n}\n\ndeclare const PLUGIN: {\n  ENV: \"remote\" | \"coc\" | \"rpc\"\n}\n"
  },
  {
    "path": "src/args/add-fzf-arg-parser.test.ts",
    "content": "import { parseAddFzfArg } from \"@/args/add-fzf-arg-parser\"\n\ndescribe(\"parseAddFzfArgs\", () => {\n  it('parseAddFzfArgs(\"--add-fzf-arg=-a\")', () => {\n    expect(parseAddFzfArg(\"--add-fzf-arg=-a\")).toEqual([\n      {\n        optionName: \"-a\",\n      },\n    ])\n  })\n\n  it('parseAddFzfArgs(\"--add-fzf-arg=--foo\")', () => {\n    expect(parseAddFzfArg(\"--add-fzf-arg=--foo\")).toEqual([\n      {\n        optionName: \"--foo\",\n      },\n    ])\n  })\n\n  it('parseAddFzfArgs(\"--add-fzf-arg=--foo --add-fzf-arg=--bar\")', () => {\n    expect(parseAddFzfArg(\"--add-fzf-arg=--foo --add-fzf-arg=--bar\")).toEqual([\n      {\n        optionName: \"--foo\",\n      },\n      {\n        optionName: \"--bar\",\n      },\n    ])\n  })\n\n  it('parseAddFzfArgs(\"--add-fzf-arg=--foo=bar\")', () => {\n    expect(parseAddFzfArg(\"--add-fzf-arg=--foo=bar\")).toEqual([\n      {\n        optionName: \"--foo\",\n        value: \"bar\",\n      },\n    ])\n  })\n\n  it('parseAddFzfArgs(\"--add-fzf-arg=--foo --add-fzf-arg=--foobar=\"hoge fuga\"\")', () => {\n    expect(parseAddFzfArg('--add-fzf-arg=--foo --add-fzf-arg=--foobar=\"hoge fuga\"')).toEqual([\n      {\n        optionName: \"--foo\",\n      },\n      {\n        optionName: \"--foobar\",\n        value: '\"hoge fuga\"',\n      },\n    ])\n  })\n})\n"
  },
  {
    "path": "src/args/add-fzf-arg-parser.ts",
    "content": "import { argsParser } from \"@/args/parser\"\nimport type { AddFzfArg, ArgsOptions } from \"@/type\"\n\nconst optionsToAddFzfArg = (options: ArgsOptions): ReadonlyArray<string> => {\n  if (options[\"add-fzf-arg\"] != null && Array.isArray(options[\"add-fzf-arg\"])) {\n    return options[\"add-fzf-arg\"] as ReadonlyArray<string>\n  }\n  if (options[\"add-fzf-arg\"] != null && typeof options[\"add-fzf-arg\"] === \"string\") {\n    return [options[\"add-fzf-arg\"]]\n  }\n\n  return []\n}\n\nconst parseOptions = (options: ArgsOptions) => {\n  const addFzfArg = optionsToAddFzfArg(options)\n\n  const notExistsValueOptions: ReadonlyArray<AddFzfArg> = addFzfArg\n    .map((arg) => /(.+)$/.exec(arg))\n    .filter((match): match is RegExpExecArray => match != null && !match[0].includes(\"=\"))\n    .map((match) => {\n      return { optionName: match[1] }\n    })\n\n  const existsValueOptions: ReadonlyArray<AddFzfArg> = addFzfArg\n    .map((arg) => /(.+)=(.+)$/.exec(arg))\n    .filter((match): match is RegExpExecArray => match != null)\n    .map((match) => ({ optionName: match[1], value: match[2] }))\n\n  return [...notExistsValueOptions, ...existsValueOptions]\n}\n\nexport const parseAddFzfArg = (args: string): ReadonlyArray<AddFzfArg> => {\n  const parser = argsParser()\n  const options = parser.parseSync(args)\n\n  return parseOptions(options)\n}\n"
  },
  {
    "path": "src/args/directory-files-args-parser.ts",
    "content": "import { argsParser } from \"@/args/parser\"\nimport type { SourceFuncArgs } from \"@/type\"\n\nexport const parseDictionaryFilesArgs = (args: string): SourceFuncArgs => {\n  const parser = argsParser()\n  const options = parser.parseSync(args)\n\n  const directories = options._.map((resource) => (typeof resource === \"number\" ? resource.toString() : resource))\n\n  return {\n    args: directories.length > 0 ? [directories[0]] : [],\n  }\n}\n"
  },
  {
    "path": "src/args/empty-source-func-args-parser.ts",
    "content": "import type { SourceFuncArgs } from \"@/type\"\n\nexport const parseEmptySourceFuncArgs = (_args: string): SourceFuncArgs => {\n  return {\n    args: [],\n  }\n}\n"
  },
  {
    "path": "src/args/experimental-parser.ts",
    "content": "import { argsParser } from \"@/args/parser\"\n\ntype Experimental = {\n  fast: boolean\n}\n\nexport const parseExperimental = (args: string): Experimental => {\n  const parser = argsParser()\n  const options = parser.parseSync(args)\n\n  return {\n    fast: options[\"experimental-fast\"] != null,\n  }\n}\n"
  },
  {
    "path": "src/args/files-from-resources-parser.ts",
    "content": "import { argsParser } from \"@/args/parser\"\nimport { FILE_RESOURCES } from \"@/const/fzf-option\"\nimport type { SourceFuncArgs } from \"@/type\"\n\nexport const parseResources = (args: string): SourceFuncArgs => {\n  const parser = argsParser()\n  const options = parser.parseSync(args)\n\n  const resources = options._.map((resource) => (typeof resource === \"number\" ? resource.toString() : resource))\n\n  if (resources.length === 0) {\n    throw new Error(\"Select one or more resources\")\n  }\n\n  if (!resources.every((resource) => (FILE_RESOURCES as ReadonlyArray<string>).includes(resource))) {\n    throw new Error(`Invalid resource: \"${resources.join(\", \")}\"`)\n  }\n\n  return {\n    args: resources,\n  }\n}\n"
  },
  {
    "path": "src/args/grep-args-parser.ts",
    "content": "import { argsParser } from \"@/args/parser\"\nimport type { SourceFuncArgs } from \"@/type\"\n\nexport const parseGrepArgs = (args: string): SourceFuncArgs => {\n  const parser = argsParser()\n  const options = parser.parseSync(args)\n\n  const grepArgs = options._.map((resource) => (typeof resource === \"number\" ? resource.toString() : resource))\n\n  return {\n    args: grepArgs,\n  }\n}\n"
  },
  {
    "path": "src/args/index.ts",
    "content": "export * from \"@/args/add-fzf-arg-parser\"\nexport * from \"@/args/directory-files-args-parser\"\nexport * from \"@/args/empty-source-func-args-parser\"\nexport * from \"@/args/grep-args-parser\"\nexport * from \"@/args/processes-parser\"\nexport * from \"@/args/resume-parser\"\n"
  },
  {
    "path": "src/args/parser.ts",
    "content": "import yargs from \"yargs\"\n\nexport const argsParser = () => {\n  return yargs\n    .options(\"add-fzf-arg\", { type: \"string\" })\n    .options(\"processes\", { type: \"string\" })\n    .options(\"resume\", { type: \"boolean\" })\n    .options(\"session\", { type: \"string\" })\n    .options(\"experimental-fast\", { type: \"boolean\" })\n    .parserConfiguration({\n      \"camel-case-expansion\": false,\n      \"unknown-options-as-args\": true,\n    })\n}\n"
  },
  {
    "path": "src/args/processes-parser.test.ts",
    "content": "import { parseProcesses } from \"@/args/processes-parser\"\n\ndescribe(\"parseProcesses\", () => {\n  it('parseProcesses(\"foo\")', () => {\n    expect(parseProcesses(\"open-file\", \"foo\")).toBeUndefined()\n  })\n\n  it('parseProcesses(\"--foo --processes=foo_processes\")', () => {\n    expect(parseProcesses(\"open-file\", \"--processes=foo_processes\")).toEqual({\n      type: \"global_variable\",\n      value: \"foo_processes\",\n    })\n  })\n\n  it('parseProcesses(\"--processes=foo_processes --processes=bar_processes\")', () => {\n    expect(() => {\n      parseProcesses(\"open-file\", \"--processes=foo_processes --processes=bar_processes\")\n    }).toThrow()\n  })\n})\n"
  },
  {
    "path": "src/args/processes-parser.ts",
    "content": "import { isObject } from \"lodash\"\n\nimport { argsParser } from \"@/args/parser\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { ArgsOptions, CustomProcessesVimVariable, ProcessesName, UserProcesses } from \"@/type\"\n\nconst parseOptions = (options: ArgsOptions): UserProcesses | null => {\n  const processesArgs = options.processes\n\n  if (processesArgs == null) {\n    return null\n  }\n\n  if (typeof processesArgs === \"string\") {\n    return { type: \"global_variable\", value: processesArgs }\n  }\n\n  throw new Error(\"--processes option can only be used once\")\n}\n\nexport const parseProcesses = (defaultProcessesName: ProcessesName, args: string): UserProcesses | undefined => {\n  const parser = argsParser()\n  const options = parser.parseSync(args)\n\n  const parsedOptions = parseOptions(options)\n  if (parsedOptions != null) {\n    return parsedOptions\n  }\n\n  const customProcessesDictionary = globalVariableSelector(\"fzfPreviewCustomProcesses\")\n  if (\n    isObject(customProcessesDictionary) &&\n    isObject((customProcessesDictionary as CustomProcessesVimVariable)[defaultProcessesName])\n  ) {\n    return { type: \"custom_processes_variable\", value: defaultProcessesName }\n  }\n\n  return undefined\n}\n"
  },
  {
    "path": "src/args/resume-parser.ts",
    "content": "import { argsParser } from \"@/args/parser\"\nimport { resumeSelector } from \"@/module/selector/resume\"\nimport type { FzfCommandName, ResumeQuery } from \"@/type\"\n\nexport const parseResume = (commandName: FzfCommandName, args: string): ResumeQuery => {\n  const parser = argsParser()\n  const options = parser.parseSync(args)\n\n  if (options.resume == null) {\n    return null\n  }\n\n  const resumeQuery = resumeSelector(commandName)\n\n  return resumeQuery != null ? resumeQuery : null\n}\n"
  },
  {
    "path": "src/args/session-parser.ts",
    "content": "import { argsParser } from \"@/args/parser\"\nimport { sessionSelector } from \"@/module/selector/session\"\nimport type { Session } from \"@/type\"\n\nexport const parseSession = (args: string): Session | null => {\n  const parser = argsParser()\n  const options = parser.parseSync(args)\n\n  if (options.session == null) {\n    return null\n  }\n\n  const sessionToken = options.session\n  const currentSession = sessionSelector(sessionToken)\n\n  if (currentSession == null) {\n    throw new Error(`Invalid session token: ${sessionToken}`)\n  }\n\n  return currentSession\n}\n"
  },
  {
    "path": "src/association/coc-command.ts",
    "content": "import { parseEmptySourceFuncArgs } from \"@/args\"\nimport { commandDefinition, vimCommandOptions } from \"@/association/command\"\nimport {\n  cocCurrentDiagnostics,\n  cocCurrentDiagnosticsDefaultOptions,\n  cocDiagnostics,\n  cocDiagnosticsDefaultOptions,\n  cocImplementations,\n  cocImplementationsDefaultOptions,\n  cocReferences,\n  cocReferencesDefaultOptions,\n  cocTypeDefinitions,\n  cocTypeDefinitionsDefaultOptions,\n} from \"@/fzf/resource/coc\"\nimport { cocDefinitions, cocDefinitionsDefaultOptions } from \"@/fzf/resource/coc/coc-definitions\"\nimport { cocOutline, cocOutlineDefaultOptions } from \"@/fzf/resource/coc/coc-outline\"\nimport {\n  cocTsServerSourceDefinition,\n  cocTsServerSourceDefinitionsDefaultOptions,\n} from \"@/fzf/resource/coc/coc-tsserver-source-definition\"\nimport type { FzfCommand } from \"@/type\"\n\nexport const cocCommandDefinition: ReadonlyArray<FzfCommand> = [\n  ...commandDefinition,\n  {\n    commandName: \"FzfPreviewCocReferences\",\n    sourceFunc: cocReferences,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: cocReferencesDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewCocDiagnostics\",\n    sourceFunc: cocDiagnostics,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: cocDiagnosticsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewCocCurrentDiagnostics\",\n    sourceFunc: cocCurrentDiagnostics,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: cocCurrentDiagnosticsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewCocDefinition\",\n    sourceFunc: cocDefinitions,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: cocDefinitionsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewCocTypeDefinition\",\n    sourceFunc: cocTypeDefinitions,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: cocTypeDefinitionsDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewCocImplementations\",\n    sourceFunc: cocImplementations,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: cocImplementationsDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewCocOutline\",\n    sourceFunc: cocOutline,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: cocOutlineDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewCocTsServerSourceDefinition\",\n    sourceFunc: cocTsServerSourceDefinition,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: cocTsServerSourceDefinitionsDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n]\n"
  },
  {
    "path": "src/association/command.ts",
    "content": "import { parseDictionaryFilesArgs, parseEmptySourceFuncArgs, parseGrepArgs } from \"@/args\"\nimport { parseResources } from \"@/args/files-from-resources-parser\"\nimport {\n  allBuffers,\n  allBuffersDefaultOptions,\n  blamePr,\n  blamePrDefaultOptions,\n  bookmarks,\n  bookmarksDefaultOptions,\n  bufferLines,\n  bufferLinesDefaultOptions,\n  buffers,\n  buffersDefaultOptions,\n  bufferTags,\n  bufferTagsDefaultOptions,\n  changes,\n  changesDefaultOptions,\n  commandPalette,\n  commandPaletteDefaultOptions,\n  ctags,\n  ctagsDefaultOptions,\n  directoryFiles,\n  directoryFilesDefaultOptions,\n  filesFromResources,\n  filesFromResourcesDefaultOptions,\n  gitActions,\n  gitActionsDefaultOptions,\n  gitBranchActions,\n  gitBranchActionsDefaultOptions,\n  gitBranches,\n  gitBranchesDefaultOptions,\n  gitCurrentLogs,\n  gitCurrentLogsDefaultOptions,\n  gitFiles,\n  gitFilesDefaultOptions,\n  gitLogActions,\n  gitLogActionsDefaultOptions,\n  gitLogs,\n  gitLogsDefaultOptions,\n  gitReflogActions,\n  gitReflogActionsDefaultOptions,\n  gitReflogs,\n  gitReflogsDefaultOptions,\n  gitStashActions,\n  gitStashActionsDefaultOptions,\n  gitStashes,\n  gitStashesDefaultOptions,\n  gitStatus,\n  gitStatusActions,\n  gitStatusActionsDefaultOptions,\n  gitStatusDefaultOptions,\n  jumps,\n  jumpsDefaultOptions,\n  lines,\n  linesDefaultOptions,\n  locationList,\n  locationListDefaultOptions,\n  marks,\n  marksDefaultOptions,\n  memoList,\n  memoListDefaultOptions,\n  memoListGrep,\n  memoListGrepDefaultOptions,\n  mruFiles,\n  mruFilesDefaultOptions,\n  mrwFiles,\n  mrwFilesDefaultOptions,\n  oldFiles,\n  oldFilesDefaultOptions,\n  projectFiles,\n  projectFilesDefaultOptions,\n  projectGrep,\n  projectGrepDefaultOptions,\n  projectMruFiles,\n  projectMruFilesDefaultOptions,\n  projectMrwFiles,\n  projectMrwFilesDefaultOptions,\n  projectOldFiles,\n  projectOldFilesDefaultOptions,\n  quickFix,\n  quickFixDefaultOptions,\n  vistaBufferCtags,\n  vistaBufferCtagsDefaultOptions,\n  vistaCtags,\n  vistaCtagsDefaultOptions,\n  yankround,\n  yankroundDefaultOptions,\n} from \"@/fzf/resource\"\nimport {\n  nvimLspCurrentDiagnostics,\n  nvimLspCurrentDiagnosticsDefaultOptions,\n} from \"@/fzf/resource/nvim-lsp-current-diagnostics\"\nimport { nvimLspDefinition, nvimLspDefinitionDefaultOptions } from \"@/fzf/resource/nvim-lsp-definition\"\nimport { nvimLspDiagnostics, nvimLspDiagnosticsDefaultOptions } from \"@/fzf/resource/nvim-lsp-diagnostics\"\nimport { nvimLspImplementation, nvimLspImplementationDefaultOptions } from \"@/fzf/resource/nvim-lsp-implementation\"\nimport { nvimLspReferences, nvimLspReferencesDefaultOptions } from \"@/fzf/resource/nvim-lsp-references\"\nimport { nvimLspTypeDefinition, nvimLspTypeDefinitionDefaultOptions } from \"@/fzf/resource/nvim-lsp-type-definition\"\nimport { todoComments, todoCommentsDefaultOptions } from \"@/fzf/resource/todo-comments\"\nimport { grepHelp, grepHelpDefaultOptions } from \"@/fzf/resource/vim-help\"\nimport {\n  vimLspCurrentDiagnostics,\n  vimLspCurrentDiagnosticsDefaultOptions,\n} from \"@/fzf/resource/vim-lsp-current-diagnostics\"\nimport { vimLspDefinition, vimLspDefinitionDefaultOptions } from \"@/fzf/resource/vim-lsp-definition\"\nimport { vimLspDiagnostics, vimLspDiagnosticsDefaultOptions } from \"@/fzf/resource/vim-lsp-diagnostics\"\nimport { vimLspImplementation, vimLspImplementationDefaultOptions } from \"@/fzf/resource/vim-lsp-implementation\"\nimport { vimLspReferences, vimLspReferencesDefaultOptions } from \"@/fzf/resource/vim-lsp-references\"\nimport { vimLspTypeDefinition, vimLspTypeDefinitionDefaultOptions } from \"@/fzf/resource/vim-lsp-type-definition\"\nimport type { BaseFzfCommand } from \"@/type\"\n\nexport const vimCommandOptions = {\n  nargs: \"?\",\n  sync: true,\n} as const\n\nexport const commandDefinition: ReadonlyArray<BaseFzfCommand> = [\n  {\n    commandName: \"FzfPreviewProjectFiles\",\n    sourceFunc: projectFiles,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: projectFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n    addGitStatus: true,\n  },\n  {\n    commandName: \"FzfPreviewGitFiles\",\n    sourceFunc: gitFiles,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewDirectoryFiles\",\n    sourceFunc: directoryFiles,\n    sourceFuncArgsParser: parseDictionaryFilesArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: directoryFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewBuffers\",\n    sourceFunc: buffers,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: buffersDefaultOptions,\n    defaultProcessesName: \"open-buffer\",\n    enableConvertForFzf: true,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewAllBuffers\",\n    sourceFunc: allBuffers,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: allBuffersDefaultOptions,\n    defaultProcessesName: \"open-bufnr\",\n    enableConvertForFzf: true,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewProjectOldFiles\",\n    sourceFunc: projectOldFiles,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: projectOldFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n    addGitStatus: true,\n  },\n  {\n    commandName: \"FzfPreviewProjectMruFiles\",\n    sourceFunc: projectMruFiles,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: projectMruFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n    addGitStatus: true,\n  },\n  {\n    commandName: \"FzfPreviewProjectMrwFiles\",\n    sourceFunc: projectMrwFiles,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: projectMrwFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n    addGitStatus: true,\n  },\n  {\n    commandName: \"FzfPreviewLines\",\n    sourceFunc: lines,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: linesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewBufferLines\",\n    sourceFunc: bufferLines,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: bufferLinesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewCtags\",\n    sourceFunc: ctags,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: ctagsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewBufferTags\",\n    sourceFunc: bufferTags,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: bufferTagsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewOldFiles\",\n    sourceFunc: oldFiles,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: oldFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewMruFiles\",\n    sourceFunc: mruFiles,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: mruFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewMrwFiles\",\n    sourceFunc: mrwFiles,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: mrwFilesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewQuickFix\",\n    sourceFunc: quickFix,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: quickFixDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewLocationList\",\n    sourceFunc: locationList,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: locationListDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewJumps\",\n    sourceFunc: jumps,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: jumpsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewChanges\",\n    sourceFunc: changes,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: changesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewMarks\",\n    sourceFunc: marks,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: marksDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewProjectGrep\",\n    sourceFunc: projectGrep,\n    sourceFuncArgsParser: parseGrepArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: projectGrepDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewProjectGrepRecall\",\n    sourceFunc: projectGrep,\n    sourceFuncArgsParser: parseGrepArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: projectGrepDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewFromResources\",\n    sourceFunc: filesFromResources,\n    sourceFuncArgsParser: parseResources,\n    vimCommandOptions,\n    defaultFzfOptionFunc: filesFromResourcesDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n    addGitStatus: true,\n  },\n  {\n    commandName: \"FzfPreviewCommandPalette\",\n    sourceFunc: commandPalette,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: commandPaletteDefaultOptions,\n    defaultProcessesName: \"command-palette\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGrepHelp\",\n    sourceFunc: grepHelp,\n    sourceFuncArgsParser: parseGrepArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: grepHelpDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitActions\",\n    sourceFunc: gitActions,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitActionsDefaultOptions,\n    defaultProcessesName: \"git-action\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitStatus\",\n    sourceFunc: gitStatus,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitStatusDefaultOptions,\n    defaultProcessesName: \"git-status\",\n    enableConvertForFzf: true,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitStatusActions\",\n    sourceFunc: gitStatusActions,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitStatusActionsDefaultOptions,\n    defaultProcessesName: \"git-status-actions\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitBranches\",\n    sourceFunc: gitBranches,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitBranchesDefaultOptions,\n    defaultProcessesName: \"git-branch\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitBranchActions\",\n    sourceFunc: gitBranchActions,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitBranchActionsDefaultOptions,\n    defaultProcessesName: \"git-branch-actions\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitLogs\",\n    sourceFunc: gitLogs,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitLogsDefaultOptions,\n    defaultProcessesName: \"git-log\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitCurrentLogs\",\n    sourceFunc: gitCurrentLogs,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitCurrentLogsDefaultOptions,\n    defaultProcessesName: \"git-log\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitLogActions\",\n    sourceFunc: gitLogActions,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitLogActionsDefaultOptions,\n    defaultProcessesName: \"git-log-actions\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitStashes\",\n    sourceFunc: gitStashes,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitStashesDefaultOptions,\n    defaultProcessesName: \"git-stash\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitStashActions\",\n    sourceFunc: gitStashActions,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitStashActionsDefaultOptions,\n    defaultProcessesName: \"git-stash-actions\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitReflogs\",\n    sourceFunc: gitReflogs,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitReflogsDefaultOptions,\n    defaultProcessesName: \"git-reflog\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewGitReflogActions\",\n    sourceFunc: gitReflogActions,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: gitReflogActionsDefaultOptions,\n    defaultProcessesName: \"git-reflog-actions\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewVimLspReferences\",\n    sourceFunc: vimLspReferences,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: vimLspReferencesDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewVimLspDiagnostics\",\n    sourceFunc: vimLspDiagnostics,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: vimLspDiagnosticsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewVimLspCurrentDiagnostics\",\n    sourceFunc: vimLspCurrentDiagnostics,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: vimLspCurrentDiagnosticsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewVimLspDefinition\",\n    sourceFunc: vimLspDefinition,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: vimLspDefinitionDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewVimLspTypeDefinition\",\n    sourceFunc: vimLspTypeDefinition,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: vimLspTypeDefinitionDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewVimLspImplementation\",\n    sourceFunc: vimLspImplementation,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: vimLspImplementationDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewNvimLspReferences\",\n    sourceFunc: nvimLspReferences,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: nvimLspReferencesDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewNvimLspDiagnostics\",\n    sourceFunc: nvimLspDiagnostics,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: nvimLspDiagnosticsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewNvimLspCurrentDiagnostics\",\n    sourceFunc: nvimLspCurrentDiagnostics,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: nvimLspCurrentDiagnosticsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewNvimLspDefinition\",\n    sourceFunc: nvimLspDefinition,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: nvimLspDefinitionDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewNvimLspTypeDefinition\",\n    sourceFunc: nvimLspTypeDefinition,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: nvimLspTypeDefinitionDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewNvimLspImplementation\",\n    sourceFunc: nvimLspImplementation,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: nvimLspImplementationDefaultOptions,\n    defaultProcessesName: \"open-file-with-tag-stack\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewBookmarks\",\n    sourceFunc: bookmarks,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: bookmarksDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewYankround\",\n    sourceFunc: yankround,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: yankroundDefaultOptions,\n    defaultProcessesName: \"register\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewMemoList\",\n    sourceFunc: memoList,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: memoListDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewMemoListGrep\",\n    sourceFunc: memoListGrep,\n    sourceFuncArgsParser: parseGrepArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: memoListGrepDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewTodoComments\",\n    sourceFunc: todoComments,\n    sourceFuncArgsParser: parseGrepArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: todoCommentsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: true,\n    enableDevIcons: true,\n  },\n  {\n    commandName: \"FzfPreviewVistaCtags\",\n    sourceFunc: vistaCtags,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: vistaCtagsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewVistaBufferCtags\",\n    sourceFunc: vistaBufferCtags,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: vistaBufferCtagsDefaultOptions,\n    defaultProcessesName: \"open-file\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n  {\n    commandName: \"FzfPreviewBlamePR\",\n    sourceFunc: blamePr,\n    sourceFuncArgsParser: parseEmptySourceFuncArgs,\n    vimCommandOptions,\n    defaultFzfOptionFunc: blamePrDefaultOptions,\n    defaultProcessesName: \"open-pr\",\n    enableConvertForFzf: false,\n    enableDevIcons: false,\n  },\n] as const\n"
  },
  {
    "path": "src/association/vim-variable.ts",
    "content": "export const vimVariableAssociation = {\n  fzfPreviewDefaultFzfOptions: \"fzf_preview_default_fzf_options\",\n  fzfPreviewUseDevIcons: \"fzf_preview_use_dev_icons\",\n  fzfPreviewDevIconPrefixStringLength: \"fzf_preview_dev_icon_prefix_string_length\",\n  fzfPreviewDevIconsLimit: \"fzf_preview_dev_icons_limit\",\n  webDevIconsUnicodeDecorateFileNodesDefaultSymbol: \"WebDevIconsUnicodeDecorateFileNodesDefaultSymbol\",\n  webDevIconsUnicodeDecorateFileNodesExtensionSymbols: \"WebDevIconsUnicodeDecorateFileNodesExtensionSymbols\",\n  webDevIconsUnicodeDecorateFileNodesExactSymbols: \"WebDevIconsUnicodeDecorateFileNodesExactSymbols\",\n  webDevIconsUnicodeDecorateFileNodesPatternSymbols: \"WebDevIconsUnicodeDecorateFileNodesPatternSymbols\",\n  fzfPreviewCommand: \"fzf_preview_command\",\n  fzfBinaryPreviewCommand: \"fzf_binary_preview_command\",\n  fzfPreviewIfBinaryCommand: \"fzf_preview_if_binary_command\",\n  fzfPreviewFilelistCommand: \"fzf_preview_filelist_command\",\n  fzfPreviewGitFilesCommand: \"fzf_preview_git_files_command\",\n  fzfPreviewDirectoryFilesCommand: \"fzf_preview_directory_files_command\",\n  fzfPreviewGitStatusCommand: \"fzf_preview_git_status_command\",\n  fzfPreviewGitStatusPreviewCommand: \"fzf_preview_git_status_preview_command\",\n  fzfPreviewGrepCmd: \"fzf_preview_grep_cmd\",\n  fzfPreviewScriptDir: \"fzf_preview_script_dir\",\n  fzfPreviewCacheDirectory: \"fzf_preview_cache_directory\",\n  fzfPreviewLinesCommand: \"fzf_preview_lines_command\",\n  fzfPreviewGrepPreviewCmd: \"fzf_preview_grep_preview_cmd\",\n  fzfPreviewCustomProcesses: \"fzf_preview_custom_processes\",\n  fzfPreviewFzfPreviewWindowOption: \"fzf_preview_fzf_preview_window_option\",\n  fzfPreviewPreviewKeyBindings: \"fzf_preview_preview_key_bindings\",\n  fzfPreviewFzfColorOption: \"fzf_preview_fzf_color_option\",\n  fzfPreviewHistoryDir: \"fzf_preview_history_dir\",\n  fzfPreviewBuffersJump: \"fzf_preview_buffers_jump\",\n  yankroundDir: \"yankround_dir\",\n  fzfPreviewYankroundPreviewCommand: \"fzf_preview_yankround_preview_command\",\n  fzfPreviewBlamePrCommand: \"fzf_preview_blame_pr_command\",\n} as const\n\nexport const vimOptions = [\"columns\"] as const\n"
  },
  {
    "path": "src/coc.ts",
    "content": "import type { ExtensionContext } from \"coc.nvim\"\nimport { commands } from \"coc.nvim\"\n\nimport {\n  initializeExtension,\n  registerCommands,\n  registerFunctions,\n  registerProcesses,\n  setRuntimePath,\n} from \"@/register/coc\"\n\nexport async function activate(context: ExtensionContext): Promise<void> {\n  await initializeExtension()\n  await setRuntimePath(context)\n\n  context.subscriptions.push(\n    ...registerCommands(commands),\n    ...registerProcesses(commands),\n    ...registerFunctions(commands)\n  )\n}\n"
  },
  {
    "path": "src/connector/bookmarks.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { pluginCall } from \"@/plugin\"\n\ntype Bookmark = ReadonlyDeep<{\n  file: string\n  line: string\n  text: string\n  comment: string\n}>\n\nexport const getBookmarks = async (): Promise<ReadonlyArray<Bookmark>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#bookmarks#get\")) as ReadonlyArray<Bookmark>\n"
  },
  {
    "path": "src/connector/buffers.ts",
    "content": "import { pluginCall, pluginCommand } from \"@/plugin\"\nimport type { VimBuffer } from \"@/type\"\n\nexport const getBuffers = async (): Promise<ReadonlyArray<VimBuffer>> => {\n  const buffers = (await pluginCall(\"fzf_preview#remote#resource#buffers#get\")) as ReadonlyArray<VimBuffer>\n\n  return buffers\n}\n\nexport const getCurrentBuffer = async (): Promise<VimBuffer> => {\n  const buffer = (await pluginCall(\"fzf_preview#remote#resource#buffers#get_current_buffer\")) as VimBuffer\n\n  return buffer\n}\n\nexport const getAlternateBuffer = async (): Promise<VimBuffer> => {\n  const buffer = (await pluginCall(\"fzf_preview#remote#resource#buffers#get_alternate_buffer\")) as VimBuffer\n\n  return buffer\n}\n\nexport const getOtherBuffers = async (): Promise<ReadonlyArray<VimBuffer>> => {\n  const buffers = (await pluginCall(\n    \"fzf_preview#remote#resource#buffers#get_other_buffers\"\n  )) as ReadonlyArray<VimBuffer>\n\n  return buffers\n}\n\nexport const getAllBuffers = async (): Promise<ReadonlyArray<VimBuffer>> => {\n  const buffers = (await pluginCall(\"fzf_preview#remote#resource#all_buffers#get\")) as ReadonlyArray<VimBuffer>\n\n  return buffers\n}\n\nexport const deleteBuffer = async (bufnr: string): Promise<void> => {\n  await pluginCommand(`bdelete! ${bufnr}`)\n}\n"
  },
  {
    "path": "src/connector/changes.ts",
    "content": "import { pluginCall } from \"@/plugin\"\n\nexport const getChanges = async (): Promise<ReadonlyArray<string>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#changes#get\")) as ReadonlyArray<string>\n"
  },
  {
    "path": "src/connector/coc.ts",
    "content": "import type {\n  CancellationToken,\n  DefinitionProvider,\n  DiagnosticItem,\n  ImplementationProvider,\n  Position,\n  Range,\n  ReferenceProvider,\n  TypeDefinitionProvider,\n} from \"coc.nvim\"\nimport { CancellationTokenSource, languages, services, workspace } from \"coc.nvim\"\nimport type {\n  DefinitionLink as CocDefinitionLink,\n  Location as CocLocation,\n  LocationLink as CocLocationLink,\n} from \"vscode-languageserver-types\"\n\nimport { diagnosticItemToData, lspLocationToLocation } from \"@/connector/lsp\"\nimport { pluginCall } from \"@/plugin\"\nimport { getCurrentFilePath, getCurrentPath, readFileLine } from \"@/system/file\"\nimport { dropFileProtocol, filePathToRelativeFilePath } from \"@/system/project\"\nimport type { Diagnostic, Location } from \"@/type\"\nimport { uniqWith } from \"@/util/uniq-with\"\n\ntype ReferenceProviders = ReadonlyArray<{\n  provider: ReferenceProvider\n}>\n\ntype DefinitionProviders = ReadonlyArray<{\n  provider: DefinitionProvider\n}>\n\ntype TypeDefinitionProviders = ReadonlyArray<{\n  provider: TypeDefinitionProvider\n}>\n\ntype ImplementationProviders = ReadonlyArray<{\n  provider: ImplementationProvider\n}>\n\nexport const getDiagnostics = async (): Promise<ReadonlyArray<Diagnostic>> => {\n  const diagnosticItems = (await pluginCall(\"CocAction\", [\"diagnosticList\"])) as ReadonlyArray<DiagnosticItem>\n  const diagnostics = await Promise.all(diagnosticItems.map(async (item) => await diagnosticItemToData(item)))\n\n  return diagnostics.filter((diagnostic): diagnostic is Diagnostic => diagnostic != null)\n}\n\nexport const getCurrentDiagnostics = async (): Promise<ReadonlyArray<Diagnostic>> => {\n  const currentFile = await getCurrentFilePath()\n  const diagnosticItems = (await pluginCall(\"CocAction\", [\"diagnosticList\"])) as ReadonlyArray<DiagnosticItem>\n  const diagnostics = await Promise.all(\n    diagnosticItems.map(async (item) => await diagnosticItemToData(item, { currentFile }))\n  )\n\n  return diagnostics.filter((diagnostic): diagnostic is Diagnostic => diagnostic != null)\n}\n\nconst getCurrentState = async () => {\n  const { document, position } = await workspace.getCurrentState()\n  const range = (await workspace.document).getWordRangeAtPosition(position)\n  const symbol = range != null ? document.getText(range) : \"\"\n\n  return { document, position, symbol } as const\n}\n\nexport const getReferences = async (): Promise<{\n  references: ReadonlyArray<Location>\n  symbol: string\n}> => {\n  let locations: ReadonlyArray<CocLocation> = []\n\n  const { document, position, symbol } = await getCurrentState()\n  const tokenSource = new CancellationTokenSource()\n\n  // @ts-expect-error\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n  const providers: ReferenceProviders = Array.from(languages.referenceManager.providers)\n  for (const { provider } of providers) {\n    // eslint-disable-next-line no-await-in-loop\n    const references = await provider.provideReferences(\n      document,\n      position,\n      { includeDeclaration: false },\n      tokenSource.token\n    )\n    if (references != null) {\n      locations = [...locations, ...references]\n    }\n  }\n\n  const references = uniqWith(\n    (await lspLocationToLocation(locations.map((v) => ({ ...v, kind: \"location\" })))) as Array<Location>,\n    (a, b) => a.file === b.file && a.lineNumber === b.lineNumber && a.text === b.text\n  )\n\n  return {\n    references,\n    symbol,\n  } as const\n}\n\nexport const getDefinition = async (): Promise<{ definitions: ReadonlyArray<Location>; symbol: string }> => {\n  let locations: ReadonlyArray<CocLocation> = []\n\n  const { document, position, symbol } = await getCurrentState()\n  const tokenSource = new CancellationTokenSource()\n\n  // @ts-expect-error\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument\n  const providers: DefinitionProviders = Array.from(languages.definitionManager.providers)\n  for (const { provider } of providers) {\n    /* eslint-disable no-await-in-loop */\n    const definitions = (\n      (await provider.provideDefinition(document, position, tokenSource.token)) as unknown as\n        | ReadonlyArray<CocDefinitionLink>\n        | undefined\n    )?.map<CocLocation>((definitionLink) => ({\n      range: definitionLink.targetRange,\n      uri: definitionLink.targetUri,\n    }))\n    /* eslint-enable */\n\n    if (definitions != null) {\n      locations = [...locations, ...definitions]\n    }\n  }\n\n  const definitions = uniqWith(\n    (await lspLocationToLocation(locations.map((v) => ({ ...v, kind: \"location\" })))) as Array<Location>,\n    (a, b) => a.file === b.file && a.lineNumber === b.lineNumber && a.text === b.text\n  )\n\n  return {\n    definitions,\n    symbol,\n  } as const\n}\n\nexport const getTypeDefinition = async (): Promise<{ typeDefinitions: ReadonlyArray<Location>; symbol: string }> => {\n  let locations: ReadonlyArray<CocLocationLink> = []\n\n  const { document, position, symbol } = await getCurrentState()\n  const tokenSource = new CancellationTokenSource()\n\n  // @ts-expect-error\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument\n  const providers: TypeDefinitionProviders = Array.from(languages.typeDefinitionManager.providers)\n  for (const { provider } of providers) {\n    // eslint-disable-next-line no-await-in-loop\n    const typeDefinitions = (await provider.provideTypeDefinition(\n      document,\n      position,\n      tokenSource.token\n    )) as unknown as ReadonlyArray<CocLocationLink>\n    if (typeDefinitions != null) {\n      locations = [...locations, ...typeDefinitions]\n    }\n  }\n\n  const typeDefinitions = uniqWith(\n    (await lspLocationToLocation(locations.map((v) => ({ ...v, kind: \"locationLink\" })))) as Array<Location>,\n    (a, b) => a.file === b.file && a.lineNumber === b.lineNumber && a.text === b.text\n  )\n\n  return {\n    typeDefinitions,\n    symbol,\n  } as const\n}\n\nexport const getImplementation = async (): Promise<{\n  implementations: ReadonlyArray<Location>\n  symbol: string\n}> => {\n  let locations: ReadonlyArray<CocLocationLink> = []\n\n  const { document, position, symbol } = await getCurrentState()\n  const tokenSource = new CancellationTokenSource()\n\n  // @ts-expect-error\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument\n  const providers: ImplementationProviders = Array.from(languages.implementationManager.providers)\n  for (const { provider } of providers) {\n    // eslint-disable-next-line no-await-in-loop\n    const implementations = (await provider.provideImplementation(\n      document,\n      position,\n      tokenSource.token\n    )) as unknown as ReadonlyArray<CocLocationLink>\n    if (implementations != null) {\n      locations = [...locations, ...implementations]\n    }\n  }\n\n  const implementations = uniqWith(\n    (await lspLocationToLocation(locations.map((v) => ({ ...v, kind: \"locationLink\" })))) as Array<Location>,\n    (a, b) => a.file === b.file && a.lineNumber === b.lineNumber && a.text === b.text\n  )\n\n  return {\n    implementations,\n    symbol,\n  } as const\n}\n\ntype CocOutlineItem = {\n  data?: {\n    kind: string\n  }\n  filterText: string\n  label: string\n  location: {\n    range: Range\n    uri: string\n  }\n}\n\ntype OutlineItem = {\n  kind: string | undefined\n  text: string\n  label: string\n  lineNumber: number\n  file: string\n}\n\nconst outlineItemToData = async ({\n  data,\n  filterText,\n  label,\n  location: {\n    uri,\n    range: {\n      start: { line },\n    },\n  },\n}: CocOutlineItem): Promise<OutlineItem | null> => {\n  const currentPath = await getCurrentPath()\n  const file = filePathToRelativeFilePath(decodeURIComponent(dropFileProtocol(uri)), currentPath)\n\n  if (file == null) {\n    return null\n  }\n\n  return {\n    kind: data?.kind,\n    file,\n    text: filterText,\n    label,\n    lineNumber: line + 1,\n  }\n}\n\nexport const getOutline = async (): Promise<ReadonlyArray<OutlineItem>> => {\n  const cocOutlineItems = (await pluginCall(\"CocAction\", [\"listLoadItems\", \"outline\"])) as ReadonlyArray<CocOutlineItem>\n  const data = Promise.all(\n    cocOutlineItems\n      .map(async (cocItem) => await outlineItemToData(cocItem))\n      .filter(async (item) => (await item) != null)\n  ) as Promise<ReadonlyArray<OutlineItem>>\n\n  return data\n}\n\ntype TsServerSourceDefinitionServiceClient = {\n  toOpenedFilePath: (uri: string) => string\n  execute: (\n    command: \"findSourceDefinition\",\n    args: { file: string; line: number; offset: number },\n    token: CancellationToken\n  ) => Promise<{\n    type: \"response\"\n    success: true\n    body: Array<{\n      file: string\n      start: Position\n      end: Position\n    }>\n  }>\n}\n\nexport const getTsServerSourceDefinition = async (): Promise<{\n  sourceDefinitions: ReadonlyArray<Location>\n  symbol: string\n}> => {\n  const { document, position, symbol } = await getCurrentState()\n  const currentPath = await getCurrentPath()\n\n  // @ts-expect-error\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  const serviceClient = services.getService(\"tsserver\")?.clientHost\n    ?.serviceClient as TsServerSourceDefinitionServiceClient\n\n  if (serviceClient == null) {\n    return { sourceDefinitions: [], symbol }\n  }\n\n  const file = serviceClient.toOpenedFilePath(document.uri)\n  const tokenSource = new CancellationTokenSource()\n\n  const args = {\n    file,\n    line: position.line + 1,\n    offset: position.character + 1,\n  }\n\n  const response = await serviceClient.execute(\"findSourceDefinition\", args, tokenSource.token)\n\n  return {\n    symbol,\n    sourceDefinitions: response.body.map((v) => {\n      const relativeFilePath = filePathToRelativeFilePath(v.file, currentPath)\n\n      if (relativeFilePath == null) {\n        console.error(v)\n        throw new Error(\"Source definition response error.\")\n      }\n\n      return {\n        file: relativeFilePath,\n        lineNumber: v.start.line,\n        text: readFileLine(v.file, v.start.line),\n      }\n    }),\n  }\n}\n"
  },
  {
    "path": "src/connector/convert-for-fzf.ts",
    "content": "import stripAnsi from \"strip-ansi\"\nimport type { ReadonlyDeep } from \"type-fest\"\n\nimport { execGitStatus } from \"@/connector/git\"\nimport { USE_DEV_ICONS_PATTERN_LIMIT } from \"@/const/fzf-resource\"\nimport { colorize, colorizeDevIcon } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FileData, ResourceLines } from \"@/type\"\n\ntype Options = ReadonlyDeep<{\n  enableConvertForFzf: boolean\n  enableDevIcons: boolean\n  addGitStatus: boolean | undefined\n}>\n\nconst createDevIconsList = (files: ReadonlyArray<string>): ReadonlyArray<string> => {\n  const defaultIcon = globalVariableSelector(\"webDevIconsUnicodeDecorateFileNodesDefaultSymbol\") as string\n  const extensionIcons = globalVariableSelector(\"webDevIconsUnicodeDecorateFileNodesExtensionSymbols\") as {\n    [key: string]: string | undefined\n  }\n  const exactIcons = globalVariableSelector(\"webDevIconsUnicodeDecorateFileNodesExactSymbols\") as {\n    [key: string]: string | undefined\n  }\n  const patternIcons = globalVariableSelector(\"webDevIconsUnicodeDecorateFileNodesPatternSymbols\") as {\n    [key: string]: string | undefined\n  }\n\n  return files.map((file) => {\n    if (USE_DEV_ICONS_PATTERN_LIMIT > files.length) {\n      for (const [regexp, icon] of Object.entries(patternIcons)) {\n        if (icon == null) {\n          throw new Error(\"Unexpected pattern icon\")\n        }\n\n        if (new RegExp(regexp).exec(file)) {\n          return icon\n        }\n      }\n    }\n\n    const exactFile = exactIcons[file.toLowerCase()]\n    if (exactFile != null) {\n      return exactFile\n    }\n\n    const extension = file.split(\".\").slice(-1)[0]\n\n    const extensionIcon = extensionIcons[extension]\n\n    return extensionIcon != null ? extensionIcon : defaultIcon\n  })\n}\n\nexport const convertForFzf = async (lines: ResourceLines, options: Options): Promise<ResourceLines> => {\n  const { enableConvertForFzf, enableDevIcons, addGitStatus } = options\n\n  if (!enableConvertForFzf) {\n    return lines\n  }\n\n  let convertedLines: ResourceLines = []\n\n  if (enableDevIcons) {\n    const convertedTexts = lines.map((line) => stripAnsi(line.displayText).split(\":\")[0])\n    const icons = createDevIconsList(convertedTexts).map((icon) => colorizeDevIcon(icon))\n\n    convertedLines = lines.map((line, i) => {\n      const lineNumber = line.data.lineNumber != null ? `${line.data.lineNumber} ` : \"\"\n\n      return {\n        data: line.data,\n        displayText: `${lineNumber}${icons[i]}  ${line.displayText}`,\n      }\n    })\n  } else {\n    convertedLines = lines.map((line) => {\n      const lineNumber = line.data.lineNumber != null ? `${line.data.lineNumber} ` : \"\"\n\n      return {\n        data: line.data,\n        displayText: `${lineNumber}${line.displayText}`,\n      }\n    })\n  }\n\n  if (addGitStatus === true) {\n    const status = await execGitStatus()\n\n    if (status.length > 0) {\n      convertedLines = convertedLines.map((line) => {\n        const data = line.data as FileData\n        const statusLine = status.find((s) => s.file === data.file)\n\n        if (statusLine == null) {\n          return {\n            data: line.data,\n            displayText: `\\xA0\\xA0${line.displayText}`,\n          }\n        }\n\n        const statusText = stripAnsi(statusLine.status.trim()).slice(0, 1)\n\n        return {\n          data: line.data,\n          displayText: `${colorize(statusText, \"yellow\")} ${line.displayText}`,\n        }\n      })\n    }\n  }\n\n  return convertedLines\n}\n"
  },
  {
    "path": "src/connector/directory-files.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { pluginCall } from \"@/plugin\"\n\nexport const execDirectoryFiles = async (args: string): Promise<ReadonlyArray<string>> => {\n  const filelistCommand = globalVariableSelector(\"fzfPreviewDirectoryFilesCommand\")\n\n  if (typeof filelistCommand !== \"string\") {\n    return []\n  }\n\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#directory_files#get\", [\n    `${filelistCommand} ${args}`,\n  ])) as ReadonlyArray<string>\n\n  return lines\n}\n"
  },
  {
    "path": "src/connector/fzf.ts",
    "content": "import { sessionModule } from \"@/module/session\"\nimport { pluginCall } from \"@/plugin\"\nimport { dispatch } from \"@/store\"\nimport type { FzfCommandName } from \"@/type\"\n\ntype Options = {\n  sessionToken?: string\n  clearSession?: boolean\n}\n\nexport const execFzfCommand = async (command: FzfCommandName, options?: Options): Promise<void> => {\n  if (options != null && options.clearSession === true) {\n    dispatch(sessionModule.actions.clearCurrentSession())\n  }\n\n  if (options?.sessionToken != null) {\n    await pluginCall(\"fzf_preview#remote#exec_fzf#exec\", [command, PLUGIN.ENV, options.sessionToken])\n  } else {\n    await pluginCall(\"fzf_preview#remote#exec_fzf#exec\", [command, PLUGIN.ENV])\n  }\n}\n"
  },
  {
    "path": "src/connector/git.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { GIT_BRANCH_COMMAND } from \"@/const/git\"\nimport {\n  createGitLogCommand,\n  gitReflogDecorateCommand,\n  gitReflogNameCommand,\n  gitStashDecorateCommand,\n  gitStashNameCommand,\n} from \"@/fzf/util\"\nimport { gitConfigSelector } from \"@/module/selector/git-config\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { pluginCall } from \"@/plugin\"\nimport { getCurrentFilePath } from \"@/system/file\"\nimport type { GitBranch, GitLog, GitReflog, GitStash, ParsedGitStatus } from \"@/type\"\nimport { unreachable } from \"@/util/type\"\n\nexport const execGitFiles = async (): Promise<ReadonlyArray<string>> => {\n  const gitFilesCommand = globalVariableSelector(\"fzfPreviewGitFilesCommand\")\n  if (typeof gitFilesCommand !== \"string\") {\n    return []\n  }\n\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#git_files#get\", [\n    gitFilesCommand,\n  ])) as ReadonlyArray<string>\n\n  return lines\n}\n\nexport const execGitStatus = async (): Promise<ReadonlyArray<ParsedGitStatus>> => {\n  const gitStatusCommand = globalVariableSelector(\"fzfPreviewGitStatusCommand\")\n  if (typeof gitStatusCommand !== \"string\") {\n    return []\n  }\n\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#git_status#get\", [\n    gitStatusCommand,\n  ])) as ReadonlyArray<string>\n\n  return lines.map((line) => {\n    const result = /(?<status>.+)\\s(?<file>.+)/.exec(line)\n    if (result?.groups == null) {\n      throw new Error(`Unexpected line: ${line}`)\n    }\n\n    const file = stripAnsi(result.groups.file)\n    const { status } = result.groups\n\n    return {\n      file,\n      status,\n    }\n  })\n}\n\nexport const execGitBranch = async (): Promise<ReadonlyArray<GitBranch>> => {\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#util#exec_command\", [\n    GIT_BRANCH_COMMAND,\n  ])) as ReadonlyArray<string>\n\n  return lines.map((line) => {\n    const [prefix, name, date, author] = line.split(\"    \")\n\n    return {\n      prefix,\n      name,\n      date,\n      author,\n    }\n  })\n}\n\nexport const execGitLog = async (options?: { currentFile: boolean }): Promise<ReadonlyArray<GitLog>> => {\n  const command =\n    options?.currentFile === true ? createGitLogCommand(await getCurrentFilePath()) : createGitLogCommand()\n\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#util#exec_command\", [command])) as ReadonlyArray<string>\n\n  return lines.map((line) => {\n    const [prefix, hash, date, author, comment] = line.split(/\\s{4,}/)\n\n    return {\n      prefix,\n      hash,\n      date,\n      author,\n      comment,\n    }\n  })\n}\n\nexport const execGitReflog = async (): Promise<ReadonlyArray<GitReflog>> => {\n  const lines1 = (await pluginCall(\"fzf_preview#remote#resource#util#exec_command\", [\n    gitReflogDecorateCommand,\n  ])) as ReadonlyArray<string>\n  const lines2 = (await pluginCall(\"fzf_preview#remote#resource#util#exec_command\", [\n    gitReflogNameCommand,\n  ])) as ReadonlyArray<string>\n\n  return lines1.map((line, i) => {\n    const [prefix, hash, date, author, comment] = line.split(/\\s{4,}/)\n    const name = lines2[i]\n\n    return {\n      prefix,\n      name,\n      hash,\n      date,\n      author,\n      comment,\n    }\n  })\n}\n\nexport const execGitStash = async (): Promise<ReadonlyArray<GitStash>> => {\n  const lines1 = (await pluginCall(\"fzf_preview#remote#resource#util#exec_command\", [\n    gitStashDecorateCommand,\n  ])) as ReadonlyArray<string>\n  const lines2 = (await pluginCall(\"fzf_preview#remote#resource#util#exec_command\", [\n    gitStashNameCommand,\n  ])) as ReadonlyArray<string>\n\n  return lines1.map((line, i) => {\n    const [prefix, hash, date, author, comment] = line.split(/\\s{4,}/)\n    const name = lines2[i]\n\n    return {\n      prefix,\n      name,\n      hash,\n      date,\n      author,\n      comment,\n    }\n  })\n}\n\nexport const gitAdd = async (file: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#add\", [file])\n}\n\nexport const gitReset = async (file: string, option?: \"--soft\" | \"--hard\"): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#reset\", [file, option == null ? \"\" : option])\n}\n\nexport const gitPatch = async (file: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#patch\", [file])\n}\n\nexport const gitChaperon = async (file: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#chaperon\", [file])\n}\n\nexport const gitAddIntentToAdd = async (file: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#add_intent_to_add\", [file])\n}\n\nexport const gitResetIntentToAdd = async (file: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#reset_intent_to_add\", [file])\n}\n\ntype CommitOption =\n  | { name: \"--amend\" }\n  | { name: \"--amend --no-edit\" }\n  | { name: \"--squash\"; hash: string }\n  | { name: \"--fixup\"; hash: string }\n\nexport const gitCommit = async (option?: CommitOption): Promise<void> => {\n  const noVerify = gitConfigSelector(\"noVerify\")\n\n  const addNoVerifyOption = (optionString: string) => (noVerify ? `${optionString} --no-verify` : optionString)\n\n  if (option == null) {\n    await pluginCall(\"fzf_preview#remote#consumer#git#commit\", [addNoVerifyOption(\"\")])\n\n    return\n  }\n\n  switch (option.name) {\n    case \"--amend\":\n    case \"--amend --no-edit\": {\n      await pluginCall(\"fzf_preview#remote#consumer#git#commit\", [addNoVerifyOption(option.name)])\n      break\n    }\n    case \"--squash\":\n    case \"--fixup\": {\n      await pluginCall(\"fzf_preview#remote#consumer#git#commit\", [addNoVerifyOption(`${option.name} ${option.hash}`)])\n      break\n    }\n    default: {\n      unreachable(option)\n    }\n  }\n}\n\nexport const gitRestore = async (file: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#restore\", [file])\n}\n\nexport const gitSwitch = async (branch: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#switch\", [branch])\n}\n\nexport const gitCreateBranch = async (): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#create_branch\")\n}\n\nexport const gitDiff = async (branch: string, branch2?: string): Promise<void> => {\n  if (branch2 == null) {\n    await pluginCall(\"fzf_preview#remote#consumer#git#diff\", [branch])\n  } else {\n    await pluginCall(\"fzf_preview#remote#consumer#git#diff\", [branch, branch2])\n  }\n}\n\nexport const gitShow = async (nameOrHash: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#show\", [nameOrHash])\n}\n\nexport const gitPush = async (option?: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#push\", [option != null ? option : \"\"])\n}\n\nexport const gitFetch = async (): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#fetch\")\n}\n\nexport const gitPull = async (): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#pull\")\n}\n\nexport const gitMerge = async (branch: string, option?: \"--no-ff\"): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#merge\", [branch, option != null ? option : \"\"])\n}\n\nexport const gitRebase = async (branch: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#rebase\", [branch])\n}\n\nexport const gitRebaseInteractive = async (branchOrHash: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#rebase_interactive\", [branchOrHash])\n}\n\nexport const gitDeleteBranch = async (branch: string, option?: { name: \"--force\" }): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#delete_branch\", [branch, option != null ? option.name : \"\"])\n}\n\nexport const gitRenameBranch = async (branch: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#rename_branch\", [branch])\n}\n\nexport const gitStashApply = async (name: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#stash_apply\", [name])\n}\n\nexport const gitStashPop = async (name: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#stash_pop\", [name])\n}\n\nexport const gitStashDrop = async (name: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#stash_drop\", [name])\n}\n\nexport const gitStashCreate = async (): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#stash_create\")\n}\n\nexport const gitYank = async (branchOrHash: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#git#yank\", [branchOrHash])\n}\n"
  },
  {
    "path": "src/connector/grep.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { pluginCall } from \"@/plugin\"\n\nexport const execGrep = async (args: string): Promise<ReadonlyArray<string>> => {\n  const grepCommand = globalVariableSelector(\"fzfPreviewGrepCmd\") as string\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#grep#get\", [\n    `${grepCommand} ${args}`,\n  ])) as ReadonlyArray<string>\n\n  return lines\n}\n"
  },
  {
    "path": "src/connector/jumps.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { pluginCall } from \"@/plugin\"\n\ntype Jump = ReadonlyDeep<{\n  file: string\n  line: string\n  text: string\n}>\n\nexport const getJumps = async (): Promise<ReadonlyArray<Jump>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#jumps#get\")) as ReadonlyArray<Jump>\n"
  },
  {
    "path": "src/connector/lines.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { pluginCall } from \"@/plugin\"\n\nexport const execLines = async (filePath: string): Promise<ReadonlyArray<string>> => {\n  const linesCommand = globalVariableSelector(\"fzfPreviewLinesCommand\") as string\n  if (typeof linesCommand !== \"string\") {\n    return []\n  }\n\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#lines#get\", [\n    `${linesCommand} ${filePath}`,\n  ])) as ReadonlyArray<string>\n\n  return lines\n}\n"
  },
  {
    "path": "src/connector/lsp.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\nimport type { Location as LspLocation, LocationLink } from \"vscode-languageserver-types\"\n\nimport { getLineFromFile } from \"@/connector/util\"\nimport { collapseHome, existsFileAsync, getCurrentPath } from \"@/system/file\"\nimport { dropFileProtocol, filePathToRelativeFilePath } from \"@/system/project\"\nimport type { Diagnostic, DiagnosticItem, DiagnosticLevel, Location } from \"@/type\"\n\nexport const diagnosticItemToData = async (\n  item: ReadonlyDeep<DiagnosticItem>,\n  option?: { currentFile: string }\n): Promise<ReadonlyDeep<Diagnostic | null>> => {\n  if (!(await existsFileAsync(item.file))) {\n    return null\n  }\n\n  const currentPath = await getCurrentPath()\n  const file = filePathToRelativeFilePath(item.file, currentPath)\n\n  if (file == null) {\n    return null\n  }\n  if (option?.currentFile != null && option.currentFile !== file) {\n    return null\n  }\n\n  return {\n    file,\n    lineNumber: item.lnum,\n    severity: item.severity as DiagnosticLevel,\n    message: item.message,\n  } as const\n}\n\ntype LocationOrLocationLink =\n  | (LspLocation & {\n      kind?: undefined\n    })\n  | (LspLocation & {\n      kind: \"location\"\n    })\n  | (LocationLink & {\n      kind: \"locationLink\"\n    })\n\nexport const lspLocationToLocation = async (\n  locations: ReadonlyArray<LocationOrLocationLink>\n): Promise<ReadonlyArray<Location>> => {\n  const currentPath = await getCurrentPath()\n\n  return (\n    await Promise.all(\n      locations.map(async (location) => {\n        let lineNumber: number\n        let uri: string\n        if (location.kind == null || location.kind === \"location\") {\n          lineNumber = location.range.start.line + 1\n          uri = location.uri\n        } else if (location.targetRange != null) {\n          lineNumber = location.targetRange.start.line + 1\n          uri = location.targetUri\n        } else {\n          throw new Error(\"Unexpected location\")\n        }\n\n        const absoluteFilePath = decodeURIComponent(dropFileProtocol(uri))\n        const filePath =\n          new RegExp(`^${currentPath}`).exec(absoluteFilePath) != null\n            ? filePathToRelativeFilePath(absoluteFilePath, currentPath)\n            : collapseHome(absoluteFilePath)\n\n        if (filePath == null) {\n          return null\n        }\n        const text = await getLineFromFile(absoluteFilePath, lineNumber)\n\n        return { file: filePath, lineNumber, text }\n      })\n    )\n  ).filter((location): location is Location => location != null)\n}\n"
  },
  {
    "path": "src/connector/marks.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { pluginCall } from \"@/plugin\"\n\ntype Mark = ReadonlyDeep<{\n  file: string\n  line: string\n  text: string\n}>\n\nexport const getMarks = async (): Promise<ReadonlyArray<Mark>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#marks#get\")) as ReadonlyArray<Mark>\n"
  },
  {
    "path": "src/connector/memolist.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { pluginCall } from \"@/plugin\"\n\nexport const execMemoListFiles = async (): Promise<ReadonlyArray<string>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#memolist#files\")) as ReadonlyArray<string>\n\nexport const execMemoListGrep = async (args: string): Promise<ReadonlyArray<string>> => {\n  const grepCommand = globalVariableSelector(\"fzfPreviewGrepCmd\") as string\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#memolist#grep\", [\n    `${grepCommand} ${args}`,\n  ])) as ReadonlyArray<string>\n\n  return lines\n}\n"
  },
  {
    "path": "src/connector/nvim-lsp.ts",
    "content": "import type { LocationLink } from \"coc.nvim\"\nimport type { Location as LspLocation } from \"vscode-languageserver-types\"\n\nimport { lspLocationToLocation } from \"@/connector/lsp\"\nimport { pluginCall, pluginCommand, pluginGetVar } from \"@/plugin\"\nimport type { Diagnostic, Location } from \"@/type\"\n\nexport const getReferences = async (): Promise<{ references: ReadonlyArray<Location> }> => {\n  await pluginCommand(`lua require(\"fzf-preview\").nvim_lsp_references()`)\n  const references = (await pluginGetVar(\"fzf_preview_nvim_lsp_references\")) as ReadonlyArray<LspLocation>\n\n  return {\n    references: await lspLocationToLocation(references),\n  }\n}\n\ntype NvimLspDiagnostic = {\n  bufnr: number\n  lnum: number\n  message: string\n  severity: number\n}\n\nconst severity = [\"\", \"Error\", \"Warning\", \"Information\", \"Hint\"] as const\n\nconst nvimLspDiagnosticToDiagnosticItem = async (nvimDiagnostic: NvimLspDiagnostic): Promise<Diagnostic> => {\n  const file = (await pluginCall(\"bufname\", [nvimDiagnostic.bufnr])) as string\n\n  return {\n    file,\n    lineNumber: nvimDiagnostic.lnum + 1,\n    message: nvimDiagnostic.message,\n    severity: severity[nvimDiagnostic.severity],\n  }\n}\n\nexport const getDiagnostics = async (): Promise<{ diagnostics: ReadonlyArray<Diagnostic> }> => {\n  await pluginCommand(`lua require(\"fzf-preview\").nvim_lsp_diagnostics()`)\n  const diagnostics = (await pluginGetVar(\"fzf_preview_nvim_lsp_diagnostics\")) as ReadonlyArray<NvimLspDiagnostic>\n\n  return {\n    diagnostics: await Promise.all(diagnostics.map(nvimLspDiagnosticToDiagnosticItem)),\n  }\n}\n\nexport const getCurrentDiagnostics = async (): Promise<{ diagnostics: ReadonlyArray<Diagnostic> }> => {\n  await pluginCommand(`lua require(\"fzf-preview\").nvim_lsp_current_diagnostics()`)\n  const diagnostics = (await pluginGetVar(\n    \"fzf_preview_nvim_lsp_current_diagnostics\"\n  )) as ReadonlyArray<NvimLspDiagnostic>\n\n  return {\n    diagnostics: await Promise.all(diagnostics.map(nvimLspDiagnosticToDiagnosticItem)),\n  }\n}\n\nexport const getDefinition = async (): Promise<{ definition: ReadonlyArray<Location> }> => {\n  await pluginCommand(`lua require(\"fzf-preview\").nvim_lsp_definition()`)\n  const definition = (await pluginGetVar(\"fzf_preview_nvim_lsp_definition\")) as ReadonlyArray<LocationLink>\n\n  return {\n    definition: await lspLocationToLocation(definition.map((v) => ({ ...v, kind: \"locationLink\" }))),\n  }\n}\n\nexport const getTypeDefinition = async (): Promise<{ typeDefinition: ReadonlyArray<Location> }> => {\n  await pluginCommand(`lua require(\"fzf-preview\").nvim_lsp_type_definition()`)\n  const typeDefinition = (await pluginGetVar(\"fzf_preview_nvim_lsp_type_definition\")) as ReadonlyArray<LspLocation>\n\n  return {\n    typeDefinition: await lspLocationToLocation(typeDefinition),\n  }\n}\n\nexport const getImplementation = async (): Promise<{ implementations: ReadonlyArray<Location> }> => {\n  await pluginCommand(`lua require(\"fzf-preview\").nvim_lsp_implementations()`)\n  const implementations = (await pluginGetVar(\"fzf_preview_nvim_lsp_implementations\")) as ReadonlyArray<LspLocation>\n\n  return {\n    implementations: await lspLocationToLocation(implementations),\n  }\n}\n"
  },
  {
    "path": "src/connector/old-files.ts",
    "content": "import { pluginGetVvar } from \"@/plugin\"\n\nexport const getOldFiles = async (): Promise<ReadonlyArray<string>> =>\n  (await pluginGetVvar(\"oldfiles\")) as ReadonlyArray<string>\n"
  },
  {
    "path": "src/connector/open-bufnr.ts",
    "content": "import { pluginCommand } from \"@/plugin\"\nimport type { OpenCommand } from \"@/type\"\n\nexport const openBufnr = async (openCommand: OpenCommand, bufnr: string): Promise<void> => {\n  if (openCommand !== \"edit\") {\n    await pluginCommand(`execute 'silent ${openCommand} | buffer ${bufnr}'`)\n  }\n  await pluginCommand(`execute 'silent buffer ${bufnr}'`)\n}\n"
  },
  {
    "path": "src/connector/open-file.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { pluginCall, pluginCommand } from \"@/plugin\"\nimport type { ExportQuickFix, OpenFile } from \"@/type\"\n\nexport const openFile = async ({\n  openCommand,\n  file,\n  lineNumber,\n  setTagStack,\n}: ReadonlyDeep<OpenFile>): Promise<void> => {\n  if (setTagStack === true) {\n    await pluginCall(\"fzf_preview#remote#tagstack#push_tag_stack\")\n  }\n  await pluginCommand(`execute 'silent ${openCommand} ${file}'`)\n  if (lineNumber != null) {\n    await pluginCall(\"cursor\", [lineNumber, 0])\n  }\n}\n\ntype Option = {\n  readonly title?: string\n}\n\nexport const exportQuickFix = async (\n  quickFixList: ReadonlyDeep<ReadonlyArray<ExportQuickFix>>,\n  option?: Option\n): Promise<void> => {\n  await pluginCall(\"setqflist\", [[], \"r\", { items: quickFixList, ...option }])\n  await pluginCommand(\"copen\")\n}\n"
  },
  {
    "path": "src/connector/project-files.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { pluginCall } from \"@/plugin\"\n\nexport const execProjectFiles = async (): Promise<ReadonlyArray<string>> => {\n  const filelistCommand = globalVariableSelector(\"fzfPreviewFilelistCommand\")\n\n  if (typeof filelistCommand !== \"string\") {\n    return []\n  }\n\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#project_files#get\", [\n    filelistCommand,\n  ])) as ReadonlyArray<string>\n\n  return lines\n}\n"
  },
  {
    "path": "src/connector/quickfix-and-locationlist.ts",
    "content": "import { pluginCall } from \"@/plugin\"\n\nexport const getQuickFix = async (): Promise<ReadonlyArray<string>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#quickfix_and_locationlist#get\", [\"quickfix\"])) as ReadonlyArray<string>\n\nexport const getLocationList = async (): Promise<ReadonlyArray<string>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#quickfix_and_locationlist#get\", [\"loclist\"])) as ReadonlyArray<string>\n"
  },
  {
    "path": "src/connector/register.ts",
    "content": "import { pluginCall } from \"@/plugin\"\n\nexport const setRegister = async (str: string, options: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#register#set\", [str, options])\n}\n\nexport const pasteRegister = async (str: string, options: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#consumer#register#paste\", [str, options])\n}\n"
  },
  {
    "path": "src/connector/resume.ts",
    "content": "import { resumeModule } from \"@/module/resume\"\nimport { pluginCall } from \"@/plugin\"\nimport { dispatch } from \"@/store\"\nimport type { FzfPreviewCommandList } from \"@/type\"\n\nexport const setResourceCommandName = async (commandName: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#window#set_resource_command_name\", [commandName])\n}\n\nexport const dispatchResumeQuery = ([commandName, query]: [FzfPreviewCommandList, string]): void => {\n  dispatch(resumeModule.actions.setQuery({ commandName, query }))\n}\n"
  },
  {
    "path": "src/connector/tags.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { pluginCall } from \"@/plugin\"\n\ntype Tag = ReadonlyDeep<{\n  name: string\n  file: string\n  line: string\n  type: string\n}>\n\nexport const getCtags = async (): Promise<ReadonlyArray<Tag>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#tags#ctags\")) as ReadonlyArray<Tag>\n"
  },
  {
    "path": "src/connector/todo-comments.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { pluginCall } from \"@/plugin\"\n\nexport const execSearchTodoComments = async (): Promise<ReadonlyArray<string>> => {\n  const grepCommand = globalVariableSelector(\"fzfPreviewGrepCmd\") as string\n  const todoKeywords = (await pluginCall(\"fzf_preview#remote#resource#todo_comments#get\", [])) as ReadonlyArray<string>\n  const keywordsRegexp = todoKeywords.map((keyword) => `${keyword}: `).join(\"|\")\n\n  const grepKeywords = `${grepCommand} \"${keywordsRegexp}\"`\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#grep#get\", [grepKeywords])) as ReadonlyArray<string>\n\n  return lines\n}\n"
  },
  {
    "path": "src/connector/util.ts",
    "content": "import { pluginCall, pluginCommand } from \"@/plugin\"\nimport { execAsyncCommand } from \"@/system/command\"\n\nexport const vimEchoMessage = async (message: string): Promise<void> => {\n  await pluginCommand(`echomsg '${message}'`)\n}\n\nexport const isGitDirectory = async (): Promise<boolean> => {\n  const result = (await pluginCall(\"fzf_preview#remote#util#is_git_directory\")) as boolean\n\n  return result\n}\n\nexport const getLineFromFile = async (file: string, line: number): Promise<string> =>\n  (await execAsyncCommand(`sed -n ${line}p ${file}`)).stdout.trim()\n"
  },
  {
    "path": "src/connector/vim-command.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { pluginCall } from \"@/plugin\"\n\ntype VimCommand = ReadonlyDeep<{\n  name: string\n  number: number | null\n}>\n\nexport const getVimCommands = async (): Promise<ReadonlyArray<VimCommand>> => {\n  const commands = (await pluginCall(\"fzf_preview#remote#resource#vim_command#commands\")) as ReadonlyArray<VimCommand>\n\n  return commands\n}\n\nexport const getVimCommandHistory = async (): Promise<ReadonlyArray<VimCommand>> => {\n  const commands = (await pluginCall(\"fzf_preview#remote#resource#vim_command#history\")) as ReadonlyArray<VimCommand>\n\n  return commands\n}\n\nexport const execVimCommand = async (command: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#resource#vim_command#exec\", [command])\n}\n\nexport const editVimCommand = async (command: string): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#resource#vim_command#edit\", [command])\n}\n"
  },
  {
    "path": "src/connector/vim-help.ts",
    "content": "import { pluginCall } from \"@/plugin\"\n\nexport const execHelpTags = async (args: string): Promise<ReadonlyArray<string>> => {\n  const runtimeHelpDir = `${process.env.VIMRUNTIME}/doc/*`\n  const pluginHelpDir =\n    process.env.FZF_PREVIEW_PLUGIN_HELP_ROOT_DIR == null\n      ? \"\"\n      : `${process.env.FZF_PREVIEW_PLUGIN_HELP_ROOT_DIR}/**/doc/*`\n\n  const grepCommand = `rg --line-number --no-heading --color=never --sort=path ${args} ${runtimeHelpDir} ${pluginHelpDir}`\n  const lines = (await pluginCall(\"fzf_preview#remote#resource#grep#get\", [`${grepCommand}`])) as ReadonlyArray<string>\n\n  return lines\n}\n"
  },
  {
    "path": "src/connector/vim-lsp.ts",
    "content": "import { isEqual } from \"lodash\"\nimport type { Diagnostic as LspDiagnostic, Location as VimLspLocation, LocationLink } from \"vscode-languageserver-types\"\n\nimport { diagnosticItemToData, lspLocationToLocation } from \"@/connector/lsp\"\nimport { pluginCall } from \"@/plugin\"\nimport { getCurrentFilePath } from \"@/system/file\"\nimport { dropFileProtocol } from \"@/system/project\"\nimport type { Diagnostic, DiagnosticItem, Location } from \"@/type\"\n\ntype VimLspDiagnostic = {\n  [file: string]: {\n    [server: string]: {\n      params: {\n        diagnostics: ReadonlyArray<LspDiagnostic>\n      }\n    }\n  }\n}\n\nconst severity = [\"\", \"Error\", \"Warning\", \"Information\", \"Hint\"]\n\nconst getDiagnosticsItems = async () => {\n  const lspDiagnostic = (await pluginCall(\n    \"lsp#internal#diagnostics#state#_get_all_diagnostics_grouped_by_uri_and_server\"\n  )) as VimLspDiagnostic\n\n  const diagnosticItems: ReadonlyArray<DiagnosticItem | null> = Object.entries(lspDiagnostic).flatMap(\n    ([path, result]) => {\n      const diagnostics = Object.entries(result).flatMap(([_, v]) => v.params.diagnostics)\n\n      const file = decodeURIComponent(dropFileProtocol(path))\n      if (file == null) {\n        return null\n      }\n\n      return diagnostics.map<DiagnosticItem>((diagnostic) => ({\n        file,\n        lnum: diagnostic.range.start.line,\n        message: diagnostic.message,\n        severity: severity[diagnostic?.severity as number] ?? \"\",\n      }))\n    }\n  )\n\n  return diagnosticItems\n}\n\nexport const getDiagnostics = async (): Promise<ReadonlyArray<Diagnostic>> => {\n  const diagnosticItems = await getDiagnosticsItems()\n\n  const diagnostics = await Promise.all(\n    diagnosticItems.filter((v): v is DiagnosticItem => v != null).map(async (item) => await diagnosticItemToData(item))\n  )\n\n  return diagnostics.filter((diagnostic): diagnostic is Diagnostic => diagnostic != null)\n}\n\nexport const getCurrentDiagnostics = async (): Promise<ReadonlyArray<Diagnostic>> => {\n  const currentFile = await getCurrentFilePath()\n  const diagnosticItems = await getDiagnosticsItems()\n\n  const diagnostics = await Promise.all(\n    diagnosticItems\n      .filter((v): v is DiagnosticItem => v != null)\n      .map(async (item) => await diagnosticItemToData(item, { currentFile }))\n  )\n\n  return diagnostics.filter((diagnostic): diagnostic is Diagnostic => diagnostic != null)\n}\n\nexport const getReferences = async (): Promise<{\n  references: ReadonlyArray<Location>\n}> => {\n  const servers = (await pluginCall(\"fzf_preview#remote#resource#vim_lsp#servers\", [\n    \"references\",\n  ])) as ReadonlyArray<string>\n  await pluginCall(\"fzf_preview#remote#resource#vim_lsp#request_references\", [servers])\n\n  let referencesWithServer: {\n    [server: string]: ReadonlyArray<VimLspLocation>\n  } = {}\n\n  for (let i = 0; i < 100; i += 1) {\n    // eslint-disable-next-line no-await-in-loop\n    referencesWithServer = (await pluginCall(\"fzf_preview#remote#resource#vim_lsp#fetch_references\")) as {\n      [server: string]: ReadonlyArray<VimLspLocation>\n    }\n\n    if (isEqual([...servers].sort(), Object.keys(referencesWithServer).sort())) {\n      break\n    }\n\n    // eslint-disable-next-line no-await-in-loop, no-promise-executor-return\n    await new Promise<void>((resolve) => setTimeout(() => resolve(), 50))\n  }\n\n  return {\n    references: await lspLocationToLocation(\n      Object.entries(referencesWithServer).flatMap(([_, references]) =>\n        references.map((v) => ({ ...v, kind: \"location\" }))\n      )\n    ),\n  }\n}\n\nexport const getDefinition = async (): Promise<{\n  definitions: ReadonlyArray<Location>\n}> => {\n  const servers = (await pluginCall(\"fzf_preview#remote#resource#vim_lsp#servers\", [\n    \"definition\",\n  ])) as ReadonlyArray<string>\n  await pluginCall(\"fzf_preview#remote#resource#vim_lsp#request_definition\", [servers])\n\n  let definitionWithServer: {\n    [server: string]: ReadonlyArray<VimLspLocation>\n  } = {}\n\n  for (let i = 0; i < 100; i += 1) {\n    // eslint-disable-next-line no-await-in-loop\n    definitionWithServer = (await pluginCall(\"fzf_preview#remote#resource#vim_lsp#fetch_definition\")) as {\n      [server: string]: ReadonlyArray<VimLspLocation>\n    }\n\n    if (isEqual([...servers].sort(), Object.keys(definitionWithServer).sort())) {\n      break\n    }\n\n    // eslint-disable-next-line no-await-in-loop, no-promise-executor-return\n    await new Promise((resolve) => setTimeout(resolve, 50))\n  }\n\n  return {\n    definitions: await lspLocationToLocation(\n      Object.entries(definitionWithServer).flatMap(([_, definitions]) =>\n        definitions.map((v) => ({ ...v, kind: \"location\" }))\n      )\n    ),\n  }\n}\n\nexport const getTypeDefinition = async (): Promise<{\n  typeDefinitions: ReadonlyArray<Location>\n}> => {\n  const servers = (await pluginCall(\"fzf_preview#remote#resource#vim_lsp#servers\", [\n    \"type_definition\",\n  ])) as ReadonlyArray<string>\n  await pluginCall(\"fzf_preview#remote#resource#vim_lsp#request_type_definition\", [servers])\n\n  let typeDefinitionWithServer: {\n    [server: string]: ReadonlyArray<LocationLink>\n  } = {}\n\n  for (let i = 0; i < 100; i += 1) {\n    // eslint-disable-next-line no-await-in-loop\n    typeDefinitionWithServer = (await pluginCall(\"fzf_preview#remote#resource#vim_lsp#fetch_type_definition\")) as {\n      [server: string]: ReadonlyArray<LocationLink>\n    }\n\n    if (isEqual([...servers].sort(), Object.keys(typeDefinitionWithServer).sort())) {\n      break\n    }\n\n    // eslint-disable-next-line no-await-in-loop, no-promise-executor-return\n    await new Promise((resolve) => setTimeout(resolve, 50))\n  }\n\n  return {\n    typeDefinitions: await lspLocationToLocation(\n      Object.entries(typeDefinitionWithServer).flatMap(([_, typeDefinitions]) =>\n        typeDefinitions.map((v) => ({ ...v, kind: \"locationLink\" }))\n      )\n    ),\n  }\n}\n\nexport const getImplementation = async (): Promise<{\n  implementations: ReadonlyArray<Location>\n}> => {\n  const servers = (await pluginCall(\"fzf_preview#remote#resource#vim_lsp#servers\", [\n    \"implementation\",\n  ])) as ReadonlyArray<string>\n  await pluginCall(\"fzf_preview#remote#resource#vim_lsp#request_implementation\", [servers])\n\n  let implementationWithServer: {\n    [server: string]: ReadonlyArray<LocationLink>\n  } = {}\n\n  for (let i = 0; i < 100; i += 1) {\n    // eslint-disable-next-line no-await-in-loop\n    implementationWithServer = (await pluginCall(\"fzf_preview#remote#resource#vim_lsp#fetch_implementation\")) as {\n      [server: string]: ReadonlyArray<LocationLink>\n    }\n\n    if (isEqual([...servers].sort(), Object.keys(implementationWithServer).sort())) {\n      break\n    }\n\n    // eslint-disable-next-line no-await-in-loop, no-promise-executor-return\n    await new Promise((resolve) => setTimeout(resolve, 50))\n  }\n\n  return {\n    implementations: await lspLocationToLocation(\n      Object.entries(implementationWithServer).flatMap(([_, implementations]) =>\n        implementations.map((v) => ({ ...v, kind: \"locationLink\" }))\n      )\n    ),\n  }\n}\n"
  },
  {
    "path": "src/connector/vista.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { pluginCall } from \"@/plugin\"\n\nexport type VistaTag = ReadonlyDeep<{\n  lineNumber: number\n  kind: string\n  text: string\n  tagFile: string\n}>\n\nexport type VistaBufferTag = ReadonlyDeep<{\n  lineNumber: number\n  kind: string\n  text: string\n  line: string\n}>\n\nexport const getVistaCtags = async (): Promise<ReadonlyArray<VistaTag>> => {\n  const tags = (await pluginCall(\"fzf_preview#remote#resource#vista#ctags\")) as ReadonlyArray<VistaTag>\n\n  return tags\n}\n\nexport const getVistaBufferCtags = async (): Promise<ReadonlyArray<VistaBufferTag>> => {\n  const tags = (await pluginCall(\"fzf_preview#remote#resource#vista#buffer_ctags\")) as ReadonlyArray<VistaBufferTag>\n\n  return tags\n}\n"
  },
  {
    "path": "src/connector/yankround.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { pluginCall } from \"@/plugin\"\n\ntype YankHistory = ReadonlyDeep<{\n  line: number\n  text: string\n  option: string\n}>\n\nexport const getYankround = async (): Promise<ReadonlyArray<YankHistory>> =>\n  (await pluginCall(\"fzf_preview#remote#resource#yankround#get\")) as ReadonlyArray<YankHistory>\n"
  },
  {
    "path": "src/const/fzf-handler.ts",
    "content": "export const HANDLER_NAME = \"FzfPreviewHandleResource\"\n"
  },
  {
    "path": "src/const/fzf-option.ts",
    "content": "export const DEFINED_FZF_OPTION_TYPES_IN_PLUGIN = [\"--ansi\", \"--bind\", \"--expect\"] as const\nexport const FILE_RESOURCES = [\n  \"project\",\n  \"git\",\n  \"directory\",\n  \"buffer\",\n  \"project_old\",\n  \"project_mru\",\n  \"project_mrw\",\n  \"old\",\n  \"mru\",\n  \"mrw\",\n] as const\n\nexport const PREVIEW_WINDOW_LAYOUT_CHANGE_SIZE = 150\n"
  },
  {
    "path": "src/const/fzf-processes.ts",
    "content": "export const PROCESSES_NAME = [\n  \"open-file\",\n  \"open-file-with-tag-stack\",\n  \"open-buffer\",\n  \"open-bufnr\",\n  \"command-palette\",\n  \"git-action\",\n  \"git-status\",\n  \"git-status-actions\",\n  \"git-branch\",\n  \"git-branch-actions\",\n  \"git-log\",\n  \"git-log-actions\",\n  \"git-stash\",\n  \"git-stash-actions\",\n  \"git-reflog\",\n  \"git-reflog-actions\",\n  \"register\",\n  \"open-pr\",\n] as const\n"
  },
  {
    "path": "src/const/fzf-resource.ts",
    "content": "export const USE_DEV_ICONS_PATTERN_LIMIT = 3000\n"
  },
  {
    "path": "src/const/fzf-runner.ts",
    "content": "import { TEMPORALLY_DATA_FILE_PATH } from \"@/const/system\"\n\nexport const TAIL_RESOURCE_FILE_COMMAND = `tail -n +1 -f ${TEMPORALLY_DATA_FILE_PATH}`\n"
  },
  {
    "path": "src/const/git.ts",
    "content": "export const GIT_ACTIONS = [\n  \"status\",\n  \"branch\",\n  \"log\",\n  \"current-log\",\n  \"stash\",\n  \"reflog\",\n  \"commit\",\n  \"commit --amend\",\n  \"commit --amend --no-edit\",\n  \"push\",\n  \"push --force\",\n  \"fetch\",\n  \"pull\",\n  \"toggle --no-verify\",\n] as const\nexport const GIT_STATUS_ACTIONS = [\n  \"add\",\n  \"reset\",\n  \"patch\",\n  \"restore\",\n  \"chaperon\",\n  \"add --intent-to-add\",\n  \"reset --intent-to-add\",\n] as const\nexport const GIT_BRANCH_ACTIONS = [\n  \"diff\",\n  \"switch\",\n  \"reset\",\n  \"reset --hard\",\n  \"reset --soft\",\n  \"merge\",\n  \"merge --no-ff\",\n  \"rebase\",\n  \"rebase --interactive\",\n  \"delete\",\n  \"delete --force\",\n  \"rename\",\n  \"yank\",\n] as const\nexport const GIT_LOG_ACTIONS = [\n  \"show\",\n  \"diff\",\n  \"reset\",\n  \"reset-hard\",\n  \"reset-soft\",\n  \"switch\",\n  \"commit --squash\",\n  \"commit --fixup\",\n  \"rebase --interactive\",\n  \"yank\",\n] as const\nexport const GIT_STASH_ACTIONS = [\"show\", \"diff\", \"apply\", \"pop\", \"drop\", \"yank\"] as const\nexport const GIT_REFLOG_ACTIONS = [\"show\", \"diff\", \"reset\", \"reset-hard\", \"reset-soft\", \"switch\", \"yank\"] as const\n\nexport const GIT_BRANCH_COMMAND =\n  \"git for-each-ref refs/heads refs/remotes --color=always --format='%(color:green)[branch]%(color:reset)    %(color:reset)%(HEAD) %(color:magenta)%(refname:short)%(color:reset)    %(color:yellow)%(authordate:short)%(color:reset)    %(color:blue)[%(authorname)]%(color:reset)%09' 2> /dev/null\"\n\nconst GIT_BRANCH_PREVIEW_COMMAND_OPTION =\n  \"--decorate --pretty='format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an]' --date=iso --graph --color=always\"\nexport const GIT_BRANCH_PREVIEW_COMMAND = `[[ '{2}' != '*' ]] && git log {2} ${GIT_BRANCH_PREVIEW_COMMAND_OPTION} 2> /dev/null || git log {3} ${GIT_BRANCH_PREVIEW_COMMAND_OPTION} 2> /dev/null`\n\nexport const GIT_LOG_PREVIEW_COMMAND = \"git show {2} --color=always\"\nexport const GIT_STASH_PREVIEW_COMMAND = \"git show {2} --color=always 2> /dev/null\"\nexport const GIT_REFLOG_PREVIEW_COMMAND = \"git show {2} --color=always\"\n"
  },
  {
    "path": "src/const/module.ts",
    "content": "export const VIM_VARIABLE = \"vim_variable\"\nexport const EXECUTE_COMMAND = \"execute_command\"\nexport const RESUME = \"resume\"\nexport const SESSION = \"session\"\nexport const GIT_CONFIG = \"git_config\"\nexport const RECALL = \"recall\"\nexport const FILE_PATH = \"file_path\"\n"
  },
  {
    "path": "src/const/system.ts",
    "content": "export const BUFFER_TAGS_COMMAND = \"ctags -f - --sort=yes --excmd=number\"\n\n// Default: 1024 * 1024\nexport const MAX_BUFFER_SIZE = 1024 * 1024 * 1000\n\nexport const TEMPORALLY_DATA_FILE_PATH = \"/tmp/fzf-preview\"\n"
  },
  {
    "path": "src/fzf/command/execute-fast.ts",
    "content": "import fs from \"fs\"\n\nimport { convertForFzf } from \"@/connector/convert-for-fzf\"\nimport { setResourceCommandName } from \"@/connector/resume\"\nimport { HANDLER_NAME } from \"@/const/fzf-handler\"\nimport { TAIL_RESOURCE_FILE_COMMAND } from \"@/const/fzf-runner\"\nimport { TEMPORALLY_DATA_FILE_PATH } from \"@/const/system\"\nimport { getEnableDevIcons } from \"@/fzf/command/util\"\nimport { fzfOptionsToString } from \"@/fzf/option/convert\"\nimport { generateOptions } from \"@/fzf/option/generator\"\nimport { executeCommandModule } from \"@/module/execute-command\"\nimport { pluginCall } from \"@/plugin\"\nimport { resourceLineToFzfLine } from \"@/plugin/fzf-runner\"\nimport { dispatch } from \"@/store\"\nimport { getCurrentFilePath } from \"@/system/file\"\nimport type { ExecuteArgs } from \"@/type\"\n\nexport const executeExperimentalFast = async ({\n  sourceFunc,\n  sourceFuncArgs,\n  enableDevIconsCommandSetting,\n  commandName,\n  userProcesses,\n  fzfCommandDefaultOptions,\n  defaultProcesses,\n  addFzfOptions,\n  historyOption,\n  resumeQuery,\n  enableConvertForFzf,\n  addGitStatus,\n}: ExecuteArgs): Promise<void> => {\n  const fzfOptions = await generateOptions({\n    fzfCommandDefaultOptions,\n    dynamicOptions: undefined,\n    defaultProcesses,\n    userProcesses,\n    userOptions: addFzfOptions,\n    historyOption,\n    resumeQuery,\n  })\n\n  // eslint-disable-next-line @typescript-eslint/no-floating-promises\n  pluginCall(\"fzf_preview#remote#runner#fzf_run\", {\n    source: TAIL_RESOURCE_FILE_COMMAND,\n    handler: HANDLER_NAME,\n    options: fzfOptionsToString(fzfOptions),\n    environment: PLUGIN.ENV,\n  })\n\n  const resource = await sourceFunc(sourceFuncArgs)\n  const enableDevIcons = getEnableDevIcons(resource.lines, enableDevIconsCommandSetting)\n\n  // For execute and display\n  dispatch(\n    executeCommandModule.actions.setExecuteCommand({\n      commandName,\n      options: {\n        userProcesses,\n        enableDevIcons,\n        currentFilePath: await getCurrentFilePath(),\n      },\n    })\n  )\n\n  // For resume option\n  await setResourceCommandName(commandName)\n\n  const fd = fs.openSync(TEMPORALLY_DATA_FILE_PATH, \"a\")\n\n  const lines = await convertForFzf(resource.lines, {\n    enableConvertForFzf,\n    enableDevIcons,\n    addGitStatus,\n  })\n\n  for (const line of lines) {\n    fs.appendFileSync(fd, `${resourceLineToFzfLine(line)}\\n`)\n  }\n\n  fs.closeSync(fd)\n}\n"
  },
  {
    "path": "src/fzf/command/execute-normal.ts",
    "content": "import { convertForFzf } from \"@/connector/convert-for-fzf\"\nimport { setResourceCommandName } from \"@/connector/resume\"\nimport { HANDLER_NAME } from \"@/const/fzf-handler\"\nimport { getEnableDevIcons } from \"@/fzf/command/util\"\nimport { generateOptions } from \"@/fzf/option/generator\"\nimport { executeCommandModule } from \"@/module/execute-command\"\nimport { fzfRunner } from \"@/plugin/fzf-runner\"\nimport { dispatch } from \"@/store\"\nimport { getCurrentFilePath } from \"@/system/file\"\nimport type { ExecuteArgs } from \"@/type\"\n\nexport const executeNormal = async ({\n  sourceFunc,\n  sourceFuncArgs,\n  enableDevIconsCommandSetting,\n  commandName,\n  userProcesses,\n  fzfCommandDefaultOptions,\n  defaultProcesses,\n  addFzfOptions,\n  historyOption,\n  resumeQuery,\n  enableConvertForFzf,\n  addGitStatus,\n}: ExecuteArgs): Promise<void> => {\n  const resource = await sourceFunc(sourceFuncArgs)\n  const enableDevIcons = getEnableDevIcons(resource.lines, enableDevIconsCommandSetting)\n\n  // For execute and display\n  dispatch(\n    executeCommandModule.actions.setExecuteCommand({\n      commandName,\n      options: {\n        userProcesses,\n        enableDevIcons,\n        currentFilePath: await getCurrentFilePath(),\n      },\n    })\n  )\n\n  // For resume option\n  await setResourceCommandName(commandName)\n\n  const fzfOptions = await generateOptions({\n    fzfCommandDefaultOptions,\n    dynamicOptions: resource.options,\n    defaultProcesses,\n    userProcesses,\n    userOptions: addFzfOptions,\n    historyOption,\n    resumeQuery,\n  })\n\n  const resourceForFzf = await convertForFzf(resource.lines, {\n    enableConvertForFzf,\n    enableDevIcons,\n    addGitStatus,\n  })\n\n  await fzfRunner({\n    resourceLines: resourceForFzf,\n    handler: HANDLER_NAME,\n    options: fzfOptions,\n  })\n}\n"
  },
  {
    "path": "src/fzf/command/index.ts",
    "content": "import { parseAddFzfArg, parseGrepArgs, parseProcesses, parseResume } from \"@/args\"\nimport { parseExperimental } from \"@/args/experimental-parser\"\nimport { parseSession } from \"@/args/session-parser\"\nimport { TEMPORALLY_DATA_FILE_PATH } from \"@/const/system\"\nimport { executeExperimentalFast } from \"@/fzf/command/execute-fast\"\nimport { executeNormal } from \"@/fzf/command/execute-normal\"\nimport { processesDefinition } from \"@/fzf/process\"\nimport { recallModule } from \"@/module/recall\"\nimport { recallSelector } from \"@/module/selector/recall\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { sessionModule } from \"@/module/session\"\nimport { syncVimOptions, syncVimVariable } from \"@/plugin/sync-vim-variable\"\nimport { dispatch } from \"@/store\"\nimport { initializeDataTransferFile } from \"@/system/file\"\nimport type { FzfCommand } from \"@/type\"\n\nconst getDefaultProcesses = (defaultProcessesName: string) => {\n  const targetProcessesDefinition = processesDefinition.find((define) => define.name === defaultProcessesName)\n  if (targetProcessesDefinition == null) {\n    throw new Error(`Processes not found: \"${defaultProcessesName}\"`)\n  }\n\n  return targetProcessesDefinition.processes\n}\n\nconst getDefaultOptions = async (defaultFzfOptionFunc: FzfCommand[\"defaultFzfOptionFunc\"]) => {\n  const defaultOptions = defaultFzfOptionFunc()\n\n  return defaultOptions instanceof Promise ? await defaultOptions : defaultOptions\n}\n\nexport const executeCommand = async (\n  args: string,\n  {\n    commandName,\n    sourceFunc,\n    sourceFuncArgsParser,\n    defaultFzfOptionFunc,\n    defaultProcessesName,\n    enableConvertForFzf,\n    enableDevIcons: enableDevIconsCommandSetting,\n    beforeCommandHook,\n    addGitStatus,\n  }: FzfCommand\n): Promise<void> => {\n  await Promise.all([syncVimVariable(), syncVimOptions()])\n\n  initializeDataTransferFile(TEMPORALLY_DATA_FILE_PATH)\n\n  if (beforeCommandHook != null) {\n    beforeCommandHook(args)\n  }\n\n  // For ProjectGrepRecall\n  if (commandName === \"FzfPreviewProjectGrep\") {\n    dispatch(\n      recallModule.actions.setGrepArgs({\n        grepArgs: parseGrepArgs(args).args.join(\" \"),\n      })\n    )\n  }\n  if (commandName === \"FzfPreviewProjectGrepRecall\") {\n    // eslint-disable-next-line no-param-reassign\n    args = `${args} ${recallSelector(\"grepArgs\")}`\n    // eslint-disable-next-line no-param-reassign\n    commandName = \"FzfPreviewProjectGrep\"\n  }\n\n  const addFzfOptions = parseAddFzfArg(args)\n  const userProcesses = parseProcesses(defaultProcessesName, args)\n  const fzfCommandDefaultOptions = await getDefaultOptions(defaultFzfOptionFunc)\n  const defaultProcesses = getDefaultProcesses(defaultProcessesName)\n  const resumeQuery = parseResume(commandName, args)\n  const currentSession = parseSession(args)\n  const experimental = parseExperimental(args)\n\n  if (currentSession != null) {\n    dispatch(sessionModule.actions.setCurrentSession({ session: currentSession }))\n  }\n\n  const historyDir = globalVariableSelector(\"fzfPreviewHistoryDir\") as string | false\n  const historyOption = {\n    commandName,\n    historyDir,\n  }\n  const sourceFuncArgs = sourceFuncArgsParser(args)\n\n  const executeArgs = {\n    sourceFunc,\n    sourceFuncArgs,\n    enableDevIconsCommandSetting,\n    commandName,\n    userProcesses,\n    fzfCommandDefaultOptions,\n    defaultProcesses,\n    addFzfOptions,\n    historyOption,\n    resumeQuery,\n    enableConvertForFzf,\n    addGitStatus,\n  }\n\n  if (experimental.fast) {\n    await executeExperimentalFast(executeArgs)\n  } else {\n    await executeNormal(executeArgs)\n  }\n}\n"
  },
  {
    "path": "src/fzf/command/util.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { ResourceLines } from \"@/type\"\n\nexport const getEnableDevIcons = (resourceLines: ResourceLines, enableDevIconsCommandSetting: boolean): boolean => {\n  return (\n    enableDevIconsCommandSetting &&\n    globalVariableSelector(\"fzfPreviewUseDevIcons\") !== 0 &&\n    globalVariableSelector(\"fzfPreviewDevIconsLimit\") > resourceLines.length\n  )\n}\n"
  },
  {
    "path": "src/fzf/function/index.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { processesDefinition } from \"@/fzf/process\"\nimport { createProcessFunctionName } from \"@/fzf/util\"\nimport type { ProcessesName } from \"@/type\"\n\nexport const getDefaultProcesses = (processesName: string): ReadonlyDeep<{ [key: string]: string }> => {\n  const targetProcessesDefinition = processesDefinition.find((define) => define.name === processesName)\n  if (targetProcessesDefinition == null) {\n    throw new Error(`Processes not found: \"${processesName}\"`)\n  }\n\n  return targetProcessesDefinition.processes.reduce(\n    (acc: { [key: string]: string }, cur) => ({\n      ...acc,\n      [cur.key]: createProcessFunctionName(processesName as ProcessesName, cur.key),\n    }),\n    {}\n  )\n}\n"
  },
  {
    "path": "src/fzf/handler/index.ts",
    "content": "import { createProcessFunctionName } from \"@/fzf/util\"\nimport type { State as ExecuteCommandState } from \"@/module/execute-command\"\nimport { executeCommandSelector } from \"@/module/selector/execute-command\"\nimport { processesRunner } from \"@/plugin/process-runner\"\nimport { syncVimVariable } from \"@/plugin/sync-vim-variable\"\nimport type { CallbackLines, ExpectKeyAndSelectedLines, FzfCommand, SelectedLines } from \"@/type\"\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-var-requires, global-require, n/no-missing-require, no-nested-ternary  */\nconst commands: ReadonlyArray<FzfCommand> =\n  PLUGIN.ENV === \"remote\" || PLUGIN.ENV === \"rpc\"\n    ? (require(\"@/association/command\").commandDefinition as ReadonlyArray<FzfCommand>)\n    : PLUGIN.ENV === \"coc\"\n    ? (require(\"@/association/coc-command\").cocCommandDefinition as ReadonlyArray<FzfCommand>)\n    : []\n/* eslint-enable */\n\nconst runProcess = async (\n  lines: ExpectKeyAndSelectedLines,\n  { commandName, options: { userProcesses } }: ExecuteCommandState\n) => {\n  const expectKey = lines[0] === \"\" ? \"enter\" : lines[0]\n  const selectedLines = lines.slice(1) as SelectedLines\n\n  const { defaultProcessesName } = commands.find((command) => command.commandName === commandName) as FzfCommand\n\n  if (commandName != null) {\n    await processesRunner({\n      processesFunctionName: createProcessFunctionName(defaultProcessesName, expectKey),\n      expectKey,\n      lines: selectedLines,\n      userProcesses,\n    })\n  }\n}\n\nexport const callProcess = async ([lines]: [CallbackLines, ...ReadonlyArray<unknown>]): Promise<void> => {\n  await syncVimVariable()\n  const executeCommand = executeCommandSelector()\n  await runProcess(lines, executeCommand)\n}\n"
  },
  {
    "path": "src/fzf/option/convert.test.ts",
    "content": "import { fzfOptionsToString, joinBind } from \"@/fzf/option/convert\"\nimport type { FzfOptions } from \"@/type\"\n\nconst defaultBind = [\n  {\n    key: \"ctrl-d\",\n    action: \"preview-page-down\",\n  },\n  {\n    key: \"ctrl-u\",\n    action: \"preview-page-up\",\n  },\n  {\n    key: \"?\",\n    action: \"toggle-preview\",\n  },\n]\n\ndescribe(\"joinBind\", () => {\n  it(\"bind option is array\", () => {\n    expect(joinBind(defaultBind)).toBe(\"ctrl-d:preview-page-down,ctrl-u:preview-page-up,?:toggle-preview\")\n  })\n})\n\ndescribe(\"fzfOptionsToString\", () => {\n  let options: FzfOptions = {}\n\n  describe(\"setting defined options\", () => {\n    beforeEach(() => {\n      options = {\n        \"--ansi\": true,\n        \"--bind\": defaultBind,\n        \"--expect\": [\"ctrl-x\", \"ctrl-v\", \"ctrl-t\"],\n      }\n    })\n\n    it(\"default value\", () => {\n      expect(fzfOptionsToString(options)).toBe(\n        '--ansi --bind=ctrl-d:preview-page-down,ctrl-u:preview-page-up,?:toggle-preview --expect=\"ctrl-x,ctrl-v,ctrl-t\"'\n      )\n    })\n\n    it(\"delete ansi\", () => {\n      options = { ...options, \"--ansi\": undefined }\n      expect(fzfOptionsToString(options)).toBe(\n        '--bind=ctrl-d:preview-page-down,ctrl-u:preview-page-up,?:toggle-preview --expect=\"ctrl-x,ctrl-v,ctrl-t\"'\n      )\n    })\n\n    it(\"string bind\", () => {\n      options = { ...options, \"--bind\": '\"foo\"' }\n      expect(fzfOptionsToString(options)).toBe('--ansi --bind=\"foo\" --expect=\"ctrl-x,ctrl-v,ctrl-t\"')\n    })\n\n    it(\"string expect\", () => {\n      options = { ...options, \"--expect\": '\"foo\"' }\n      expect(fzfOptionsToString(options)).toBe(\n        '--ansi --bind=ctrl-d:preview-page-down,ctrl-u:preview-page-up,?:toggle-preview --expect=\"foo\"'\n      )\n    })\n  })\n\n  describe(\"setting undefined options\", () => {\n    it('--foo: undefined, --bar: \"bar\"', () => {\n      options = {\n        \"--foo\": undefined,\n        \"--bar\": \"bar\",\n      }\n      expect(fzfOptionsToString(options)).toBe(\"--foo --bar=bar\")\n    })\n\n    it('use double quote in value: --foobar: \"\"foo bar\"\"', () => {\n      options = {\n        \"--foobar\": '\"foo bar\"',\n      }\n      expect(fzfOptionsToString(options)).toBe('--foobar=\"foo bar\"')\n    })\n\n    // If not enclosed in double quotes, another args is used\n    it('not use double quote in value: --foobar: \"foo bar\"', () => {\n      options = {\n        \"--foobar\": \"foo bar\",\n      }\n      expect(fzfOptionsToString(options)).toBe(\"--foobar=foo bar\")\n    })\n  })\n})\n"
  },
  {
    "path": "src/fzf/option/convert.ts",
    "content": "import { DEFINED_FZF_OPTION_TYPES_IN_PLUGIN } from \"@/const/fzf-option\"\nimport type { FzfOptions } from \"@/type\"\n\nexport const joinBind = (\n  bind: ReadonlyArray<{\n    key: string\n    action: string\n  }>\n): string => {\n  return bind.map(({ key, action }) => `${key}:${action}`).join(\",\")\n}\n\n// eslint-disable-next-line complexity\nconst definedOptionsToArray = (options: FzfOptions) => {\n  const arrayOptions: Array<string> = []\n\n  if (options[\"--ansi\"] != null) {\n    arrayOptions.push(\"--ansi\")\n  }\n  if (options[\"--bind\"] != null && Array.isArray(options[\"--bind\"])) {\n    arrayOptions.push(`--bind=${joinBind(options[\"--bind\"])}`)\n  } else if (options[\"--bind\"] != null && typeof options[\"--bind\"] === \"string\") {\n    arrayOptions.push(`--bind=${options[\"--bind\"]}`)\n  }\n  if (options[\"--expect\"] != null && Array.isArray(options[\"--expect\"])) {\n    if (options[\"--expect\"].length > 0) {\n      arrayOptions.push(`--expect=\"${options[\"--expect\"].join(\",\")}\"`)\n    } else {\n      arrayOptions.push(`--expect=\"alt-enter\"`)\n    }\n  } else if (options[\"--expect\"] != null && typeof options[\"--expect\"] === \"string\") {\n    arrayOptions.push(`--expect=${options[\"--expect\"]}`)\n  }\n\n  return arrayOptions\n}\n\nconst optionsToArray = (options: FzfOptions) => {\n  const arrayOptions = definedOptionsToArray(options)\n\n  Object.entries(options)\n    .filter(([key]) => !(DEFINED_FZF_OPTION_TYPES_IN_PLUGIN as ReadonlyArray<string>).includes(key))\n    .forEach(([key, value]) => {\n      if (typeof value !== \"string\") {\n        arrayOptions.push(`${key}`)\n      } else {\n        arrayOptions.push(`${key}=${value}`)\n      }\n    })\n\n  return arrayOptions\n}\n\nexport const fzfOptionsToString = (options: FzfOptions): string => {\n  return optionsToArray(options).join(\" \")\n}\n"
  },
  {
    "path": "src/fzf/option/generator.test.ts",
    "content": "import { generateOptions } from \"@/fzf/option/generator\"\nimport { openFileProcesses as defaultProcesses } from \"@/fzf/process/open-file\"\nimport { globalVariableSelector, vimOptionsSelector } from \"@/module/selector/vim-variable\"\nimport { pluginGetVar } from \"@/plugin\"\nimport type { FzfOptions, Processes, ResourceData } from \"@/type\"\n\njest.mock(\"@/plugin\")\njest.mock(\"@/module/selector/vim-variable\")\n\ndescribe(\"generateOptions\", () => {\n  let fzfCommandDefaultOptions: FzfOptions = {}\n\n  beforeEach(() => {\n    ;(globalVariableSelector as jest.Mock).mockImplementation((variableName) =>\n      variableName === \"fzfPreviewDefaultFzfOptions\" ? { \"--reverse\": true } : undefined\n    )\n\n    fzfCommandDefaultOptions = {\n      \"--ansi\": true,\n      \"--bind\": [\n        {\n          key: \"ctrl-d\",\n          action: \"preview-page-down\",\n        },\n        {\n          key: \"ctrl-u\",\n          action: \"preview-page-up\",\n        },\n        {\n          key: \"?\",\n          action: \"toggle-preview\",\n        },\n      ],\n      \"--expect\": [\"ctrl-x\", \"ctrl-v\", \"ctrl-t\", \"ctrl-o\", \"ctrl-q\"],\n      \"--reverse\": true,\n      \"--with-nth\": '\"2..\"',\n      \"--no-separator\": true,\n    }\n  })\n\n  const otherDefaultProcesses: Processes = [\n    {\n      name: \"\",\n      key: \"enter\",\n      execute: (_: ReadonlyArray<ResourceData>) => {},\n    },\n    {\n      name: \"\",\n      key: \"ctrl-a\",\n      execute: (_: ReadonlyArray<ResourceData>) => {},\n    },\n    {\n      name: \"\",\n      key: \"ctrl-b\",\n      execute: (_: ReadonlyArray<ResourceData>) => {},\n    },\n    {\n      name: \"\",\n      key: \"ctrl-c\",\n      execute: (_: ReadonlyArray<ResourceData>) => {},\n    },\n  ]\n\n  const emptyHistoryOption = {\n    commandName: \"Foo\",\n    historyDir: false,\n  } as const\n\n  describe(\"dynamic options\", () => {\n    it(\"undefined\", async () => {\n      expect(\n        await generateOptions({\n          fzfCommandDefaultOptions,\n          dynamicOptions: undefined,\n          defaultProcesses,\n          userOptions: [],\n          historyOption: emptyHistoryOption,\n        })\n      ).toEqual(fzfCommandDefaultOptions)\n    })\n\n    it(\"for grep\", async () => {\n      const grepArgs = \"foo\"\n      expect(\n        await generateOptions({\n          fzfCommandDefaultOptions,\n          dynamicOptions: { \"--header\": `\"[Grep from] ${grepArgs}\"` },\n          defaultProcesses,\n          userOptions: [],\n          historyOption: emptyHistoryOption,\n        })\n      ).toEqual({\n        ...fzfCommandDefaultOptions,\n        \"--header\": `\"[Grep from] ${grepArgs}\"`,\n      })\n    })\n  })\n\n  describe(\"empty user processes\", () => {\n    it(\"open file process\", async () => {\n      expect(\n        await generateOptions({\n          fzfCommandDefaultOptions,\n          defaultProcesses,\n          userOptions: [],\n          historyOption: emptyHistoryOption,\n        })\n      ).toEqual(fzfCommandDefaultOptions)\n    })\n\n    it(\"other default processes\", async () => {\n      fzfCommandDefaultOptions = { ...fzfCommandDefaultOptions, \"--expect\": [\"ctrl-a\", \"ctrl-b\", \"ctrl-c\"] }\n      expect(\n        await generateOptions({\n          fzfCommandDefaultOptions,\n          defaultProcesses: otherDefaultProcesses,\n          userOptions: [],\n          historyOption: emptyHistoryOption,\n        })\n      ).toEqual(fzfCommandDefaultOptions)\n    })\n  })\n\n  describe(\"set user processes from global variable\", () => {\n    it(\"open file processes\", async () => {\n      ;(pluginGetVar as jest.Mock).mockReturnValue(\n        new Promise<Record<string, unknown>>((resolve) => {\n          resolve({\n            enter: null,\n            \"ctrl-d\": null,\n            \"ctrl-e\": null,\n            \"ctrl-f\": null,\n          })\n        })\n      )\n\n      fzfCommandDefaultOptions = { ...fzfCommandDefaultOptions, \"--expect\": [\"ctrl-d\", \"ctrl-e\", \"ctrl-f\"] }\n\n      expect(\n        await generateOptions({\n          fzfCommandDefaultOptions,\n          defaultProcesses,\n          userProcesses: { type: \"global_variable\", value: \"foo\" },\n          userOptions: [],\n          historyOption: emptyHistoryOption,\n        })\n      ).toEqual(fzfCommandDefaultOptions)\n    })\n\n    it(\"other processes (not open file processes)\", async () => {\n      ;(pluginGetVar as jest.Mock).mockReturnValue(\n        new Promise<Record<string, unknown>>((resolve) => {\n          resolve({\n            enter: null,\n            \"ctrl-d\": null,\n            \"ctrl-e\": null,\n            \"ctrl-f\": null,\n          })\n        })\n      )\n\n      fzfCommandDefaultOptions = { ...fzfCommandDefaultOptions, \"--expect\": [\"ctrl-d\", \"ctrl-e\", \"ctrl-f\"] }\n\n      expect(\n        await generateOptions({\n          fzfCommandDefaultOptions,\n          defaultProcesses: otherDefaultProcesses,\n          userProcesses: { type: \"global_variable\", value: \"foo\" },\n          userOptions: [],\n          historyOption: emptyHistoryOption,\n        })\n      ).toEqual(fzfCommandDefaultOptions)\n    })\n  })\n\n  describe(\"set user processes from custom processes variable\", () => {\n    beforeEach(() => {\n      ;(globalVariableSelector as jest.Mock).mockImplementation((variableName) => {\n        if (variableName === \"fzfPreviewDefaultFzfOptions\") {\n          return { \"--reverse\": true }\n        } else if (variableName === \"fzfPreviewCustomProcesses\") {\n          return {\n            \"open-file\": {\n              \"ctrl-h\": \"\",\n              \"ctrl-i\": \"\",\n              \"ctrl-j\": \"\",\n            },\n            register: {\n              \"ctrl-k\": \"\",\n              \"ctrl-l\": \"\",\n              \"ctrl-m\": \"\",\n            },\n          }\n        } else {\n          return undefined\n        }\n      })\n    })\n\n    it(\"open file processes\", async () => {\n      const customOpenProcessesExpectOptions = { \"--expect\": [\"ctrl-h\", \"ctrl-i\", \"ctrl-j\"] }\n\n      expect(\n        await generateOptions({\n          fzfCommandDefaultOptions,\n          defaultProcesses,\n          userProcesses: { type: \"custom_processes_variable\", value: \"open-file\" },\n          userOptions: [],\n          historyOption: emptyHistoryOption,\n        })\n      ).toEqual({ ...fzfCommandDefaultOptions, ...customOpenProcessesExpectOptions })\n    })\n\n    it(\"other processes (not open file processes)\", async () => {\n      const customOtherProcessesExpectOptions = { \"--expect\": [\"ctrl-k\", \"ctrl-l\", \"ctrl-m\"] }\n\n      expect(\n        await generateOptions({\n          fzfCommandDefaultOptions,\n          defaultProcesses,\n          userProcesses: { type: \"custom_processes_variable\", value: \"register\" },\n          userOptions: [],\n          historyOption: emptyHistoryOption,\n        })\n      ).toEqual({ ...fzfCommandDefaultOptions, ...customOtherProcessesExpectOptions })\n    })\n  })\n\n  it(\"set user not dictionary processes\", async () => {\n    ;(pluginGetVar as jest.Mock).mockImplementation(() => {\n      throw new Error(\"foo\")\n    })\n\n    await expect(\n      generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userProcesses: { type: \"global_variable\", value: \"foo\" },\n        userOptions: [],\n        historyOption: emptyHistoryOption,\n      })\n    ).rejects.toThrow(\"foo\")\n  })\n\n  it(\"set --preview-window options\", async () => {\n    ;(globalVariableSelector as jest.Mock).mockImplementation((variableName) => {\n      if (variableName === \"fzfPreviewDefaultFzfOptions\") {\n        return { \"--reverse\": true }\n      } else if (variableName === \"fzfPreviewFzfPreviewWindowOption\") {\n        return \"foo\"\n      } else {\n        return undefined\n      }\n    })\n\n    expect(\n      await generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userOptions: [],\n        historyOption: emptyHistoryOption,\n      })\n    ).toEqual({ ...fzfCommandDefaultOptions, \"--preview-window\": '\"foo\"' })\n  })\n\n  it(\"--preview-window options when columns less than layout change size\", async () => {\n    ;(vimOptionsSelector as jest.Mock).mockImplementation((optionName) => {\n      if (optionName === \"columns\") {\n        return 1\n      } else {\n        return undefined\n      }\n    })\n\n    expect(\n      await generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userOptions: [],\n        historyOption: emptyHistoryOption,\n      })\n    ).toEqual({ ...fzfCommandDefaultOptions, \"--preview-window\": '\"down:50%\"' })\n  })\n\n  it(\"set --color options\", async () => {\n    ;(globalVariableSelector as jest.Mock).mockImplementation((variableName) => {\n      if (variableName === \"fzfPreviewDefaultFzfOptions\") {\n        return { \"--reverse\": true }\n      } else if (variableName === \"fzfPreviewFzfColorOption\") {\n        return \"foo\"\n      } else {\n        return undefined\n      }\n    })\n\n    expect(\n      await generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userOptions: [],\n        historyOption: emptyHistoryOption,\n      })\n    ).toEqual({ ...fzfCommandDefaultOptions, \"--color\": '\"foo\"' })\n  })\n\n  it(\"empty user options\", async () => {\n    expect(\n      await generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userOptions: [],\n        historyOption: emptyHistoryOption,\n      })\n    ).toEqual(fzfCommandDefaultOptions)\n  })\n\n  it(\"added user options\", async () => {\n    const userOptions = [{ optionName: \"foo\" }, { optionName: \"bar\", value: \"bar\" }]\n    const convertedUserOptions = {\n      bar: \"bar\",\n    }\n\n    const generatedOptions = await generateOptions({\n      fzfCommandDefaultOptions,\n      defaultProcesses,\n      userOptions,\n      historyOption: emptyHistoryOption,\n    })\n    expect(generatedOptions).toEqual(expect.objectContaining(fzfCommandDefaultOptions))\n    expect(generatedOptions).toEqual({ ...fzfCommandDefaultOptions, ...convertedUserOptions })\n  })\n\n  describe(\"resume option\", () => {\n    it(\"resume query is undefined\", async () => {\n      const generatedOptions = await generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userOptions: [],\n        resumeQuery: undefined,\n        historyOption: emptyHistoryOption,\n      })\n\n      expect(generatedOptions).toEqual(expect.objectContaining(fzfCommandDefaultOptions))\n      expect(generatedOptions).toEqual(fzfCommandDefaultOptions)\n    })\n\n    it(\"resume query is exists\", async () => {\n      const generatedOptions = await generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userOptions: [],\n        resumeQuery: \"foo\",\n        historyOption: emptyHistoryOption,\n      })\n\n      const queryOption = { \"--query\": '\"foo\"' }\n\n      expect(generatedOptions).toEqual(expect.objectContaining(fzfCommandDefaultOptions))\n      expect(generatedOptions).toEqual({ ...fzfCommandDefaultOptions, ...queryOption })\n    })\n  })\n\n  describe(\"history option\", () => {\n    it(\"history is unused\", async () => {\n      const generatedOptions = await generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userOptions: [],\n        historyOption: emptyHistoryOption,\n      })\n\n      expect(generatedOptions).toEqual(expect.objectContaining(fzfCommandDefaultOptions))\n      expect(generatedOptions).toEqual(fzfCommandDefaultOptions)\n    })\n\n    it(\"resume query is exists\", async () => {\n      const historyOption = {\n        commandName: \"Foo\",\n        historyDir: \"bar\",\n      } as const\n\n      const generatedOptions = await generateOptions({\n        fzfCommandDefaultOptions,\n        defaultProcesses,\n        userOptions: [],\n        historyOption,\n      })\n\n      const expandedHistoryOption = { \"--history\": '\"bar/Foo\"' }\n\n      expect(generatedOptions).toEqual(expect.objectContaining(fzfCommandDefaultOptions))\n      expect(generatedOptions).toEqual({ ...fzfCommandDefaultOptions, ...expandedHistoryOption })\n    })\n  })\n})\n"
  },
  {
    "path": "src/fzf/option/generator.ts",
    "content": "import expandTilde from \"expand-tilde\"\nimport { isObject } from \"lodash\"\n\nimport { PREVIEW_WINDOW_LAYOUT_CHANGE_SIZE } from \"@/const/fzf-option\"\nimport { globalVariableSelector, vimOptionsSelector } from \"@/module/selector/vim-variable\"\nimport { pluginGetVar } from \"@/plugin\"\nimport type { AddFzfArg, CustomProcessesVimVariable, FzfOptions, Processes, ResumeQuery, UserProcesses } from \"@/type\"\n\nconst defaultBind = [\n  {\n    key: \"ctrl-d\",\n    action: \"preview-half-page-down\",\n  },\n  {\n    key: \"ctrl-u\",\n    action: \"preview-half-page-up\",\n  },\n  {\n    key: \"?\",\n    action: \"toggle-preview\",\n  },\n] as const\n\nconst defaultOptions: FzfOptions = {\n  \"--ansi\": true,\n  // alt-enter is workaround\n  \"--expect\": [\"alt-enter\"],\n  \"--bind\": defaultBind,\n  \"--with-nth\": '\"2..\"',\n  \"--no-separator\": true,\n} as const\n\nconst getUserDefaultOptions = (): FzfOptions => {\n  const userDefaultOptions = globalVariableSelector(\"fzfPreviewDefaultFzfOptions\")\n  if (!isObject(userDefaultOptions) || Array.isArray(userDefaultOptions)) {\n    throw new Error(\"g:fzf_preview_default_fzf_options must be dictionary variable.\")\n  }\n\n  return Object.fromEntries(\n    Object.entries(userDefaultOptions).map(([k, v]) => {\n      if (typeof v === \"string\") {\n        return [k, `\"${v}\"`]\n      }\n\n      return [k, v]\n    })\n  )\n}\n\nconst isCustomProcessesVimVariable = (\n  variable: unknown,\n  userProcesses: UserProcesses\n): variable is CustomProcessesVimVariable => {\n  if (userProcesses.type !== \"custom_processes_variable\") {\n    return false\n  }\n\n  return isObject(variable) && isObject((variable as CustomProcessesVimVariable)[userProcesses.value])\n}\n\nconst getExpectFromDefaultProcesses = (defaultProcesses: Processes): FzfOptions => {\n  return { \"--expect\": defaultProcesses.map(({ key }) => key).filter((key) => key !== \"enter\") }\n}\n\n// eslint-disable-next-line complexity\nconst getPreviewWindowOption = (fzfCommandDefaultOptions: FzfOptions): FzfOptions => {\n  const defaultPreviewWindowOption =\n    fzfCommandDefaultOptions[\"--preview-window\"] != null &&\n    typeof fzfCommandDefaultOptions[\"--preview-window\"] === \"string\"\n      ? `${fzfCommandDefaultOptions[\"--preview-window\"]}`\n      : null\n\n  const previewWindowOptionVimValue = globalVariableSelector(\"fzfPreviewFzfPreviewWindowOption\")\n\n  if (previewWindowOptionVimValue != null && previewWindowOptionVimValue !== \"\") {\n    if (defaultPreviewWindowOption != null) {\n      return {\n        \"--preview-window\": `\"${defaultPreviewWindowOption}:${previewWindowOptionVimValue as string}\"`,\n      }\n    } else {\n      return {\n        \"--preview-window\": `\"${previewWindowOptionVimValue as string}\"`,\n      }\n    }\n  }\n\n  const columns = vimOptionsSelector(\"columns\")\n  if (columns < PREVIEW_WINDOW_LAYOUT_CHANGE_SIZE) {\n    if (defaultPreviewWindowOption != null) {\n      return { \"--preview-window\": `\"${defaultPreviewWindowOption}:down:50%\"` }\n    } else {\n      return { \"--preview-window\": '\"down:50%\"' }\n    }\n  } else if (defaultPreviewWindowOption != null) {\n    return { \"--preview-window\": defaultPreviewWindowOption }\n  } else {\n    return {}\n  }\n}\n\nconst getPreviewKeyBindings = (): FzfOptions => {\n  const previewKeyBindings = globalVariableSelector(\"fzfPreviewPreviewKeyBindings\")\n\n  return previewKeyBindings == null || previewKeyBindings === \"\"\n    ? {}\n    : { \"--bind\": `\"${previewKeyBindings as string}\"` }\n}\n\nconst getColorOption = (): FzfOptions => {\n  const colorOptionVimValue = globalVariableSelector(\"fzfPreviewFzfColorOption\")\n\n  return colorOptionVimValue == null || colorOptionVimValue === \"\"\n    ? {}\n    : { \"--color\": `\"${colorOptionVimValue as string}\"` }\n}\n\nconst getExpectFromUserProcesses = async (userProcesses: UserProcesses | undefined): Promise<FzfOptions> => {\n  if (userProcesses == null) {\n    return {}\n  }\n\n  if (userProcesses.type === \"global_variable\") {\n    const userProcessesGlobalVariable = await pluginGetVar(userProcesses.value)\n\n    if (isObject(userProcessesGlobalVariable)) {\n      return {\n        \"--expect\": Object.entries(userProcessesGlobalVariable)\n          .map(([key]) => key)\n          .filter((key) => key !== \"enter\"),\n      }\n    }\n  }\n\n  if (userProcesses.type === \"custom_processes_variable\") {\n    const userProcessesCustomVariable = globalVariableSelector(\"fzfPreviewCustomProcesses\")\n\n    if (isCustomProcessesVimVariable(userProcessesCustomVariable, userProcesses)) {\n      return {\n        \"--expect\": Object.entries(userProcessesCustomVariable[userProcesses.value])\n          .map(([key]) => key)\n          .filter((key) => key !== \"enter\"),\n      }\n    }\n  }\n\n  throw new Error(\"--processes must be dictionary variable\")\n}\n\ntype OptionsArgs = {\n  fzfCommandDefaultOptions: FzfOptions\n  dynamicOptions?: FzfOptions\n  defaultProcesses: Processes\n  userProcesses?: UserProcesses\n  userOptions: ReadonlyArray<AddFzfArg>\n  historyOption: {\n    commandName: string\n    historyDir: string | false\n  }\n  resumeQuery?: ResumeQuery\n}\n\nexport const generateOptions = async ({\n  fzfCommandDefaultOptions,\n  dynamicOptions,\n  defaultProcesses,\n  userProcesses,\n  userOptions,\n  historyOption: { commandName, historyDir },\n  resumeQuery,\n}: OptionsArgs): Promise<FzfOptions> => {\n  const historyOption: FzfOptions =\n    typeof historyDir === \"string\" ? { \"--history\": `\"${expandTilde(historyDir)}/${commandName}\"` } : {}\n  const resumeQueryOption: FzfOptions = resumeQuery == null ? {} : { \"--query\": `\"${resumeQuery}\"` }\n\n  const fzfCommandOptions = {\n    ...defaultOptions,\n    ...getUserDefaultOptions(),\n    ...fzfCommandDefaultOptions,\n    ...dynamicOptions,\n    ...getExpectFromDefaultProcesses(defaultProcesses),\n    ...getPreviewWindowOption(fzfCommandDefaultOptions),\n    ...getPreviewKeyBindings(),\n    ...getColorOption(),\n    ...(await getExpectFromUserProcesses(userProcesses)),\n    ...historyOption,\n    ...resumeQueryOption,\n  }\n\n  userOptions.forEach((userOption) => {\n    fzfCommandOptions[userOption.optionName] = userOption.value\n  })\n\n  return fzfCommandOptions\n}\n"
  },
  {
    "path": "src/fzf/process/command-palette.ts",
    "content": "import { editCommandPaletteConsumer, execCommandPaletteConsumer } from \"@/fzf/process/consumer/command-palette\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createCommandPaletteProcess = createProcessCreator(\"command-palette\")\n\nexport const commandPaletteProcesses: Processes = [\n  createCommandPaletteProcess(\"enter\", execCommandPaletteConsumer),\n  createCommandPaletteProcess(\"ctrl-e\", editCommandPaletteConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/consumer/command-palette.ts",
    "content": "import { editVimCommand, execVimCommand } from \"@/connector/vim-command\"\nimport { createSingleLineConsumer } from \"@/fzf/process/consumer\"\n\nexport const execCommandPaletteConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"command-palette\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  await execVimCommand(data.name)\n})\n\nexport const editCommandPaletteConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"command-palette\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  await editVimCommand(data.name)\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-action.ts",
    "content": "import { gitCommit, gitFetch, gitPull, gitPush } from \"@/connector/git\"\nimport { chainFzfCommand, createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { gitConfigModule } from \"@/module/git-config\"\nimport { dispatch } from \"@/store\"\nimport { unreachable } from \"@/util/type\"\n\n// eslint-disable-next-line complexity\nexport const execGitActionConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"git-actions\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  switch (data.action) {\n    case \"status\": {\n      await chainFzfCommand(\"FzfPreviewGitStatus\")\n      break\n    }\n    case \"branch\": {\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"log\": {\n      await chainFzfCommand(\"FzfPreviewGitLogs\")\n      break\n    }\n    case \"current-log\": {\n      await chainFzfCommand(\"FzfPreviewGitCurrentLogs\")\n      break\n    }\n    case \"stash\": {\n      await chainFzfCommand(\"FzfPreviewGitStashes\")\n      break\n    }\n    case \"reflog\": {\n      await chainFzfCommand(\"FzfPreviewGitReflogs\")\n      break\n    }\n    case \"commit\": {\n      await gitCommit()\n      break\n    }\n    case \"commit --amend\": {\n      await gitCommit({ name: \"--amend\" })\n      break\n    }\n    case \"commit --amend --no-edit\": {\n      await gitCommit({ name: \"--amend --no-edit\" })\n      break\n    }\n    case \"push\": {\n      await gitPush()\n      break\n    }\n    case \"push --force\": {\n      await gitPush(\"--force\")\n      break\n    }\n    case \"fetch\": {\n      await gitFetch()\n      break\n    }\n    case \"pull\": {\n      await gitPull()\n      break\n    }\n    case \"toggle --no-verify\": {\n      dispatch(gitConfigModule.actions.toggleNoVerify())\n      await chainFzfCommand(\"FzfPreviewGitActions\")\n      break\n    }\n\n    case \"header\": {\n      break\n    }\n\n    default: {\n      unreachable(data)\n    }\n  }\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-branch-action.ts",
    "content": "import {\n  gitDeleteBranch,\n  gitDiff,\n  gitMerge,\n  gitRebase,\n  gitRebaseInteractive,\n  gitRenameBranch,\n  gitReset,\n  gitSwitch,\n  gitYank,\n} from \"@/connector/git\"\nimport { chainFzfCommand, createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { unreachable } from \"@/util/type\"\n\n// eslint-disable-next-line complexity\nexport const execGitBranchActionConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"git-branch-actions\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  const branches = data.branches.filter((branch) => branch !== \"\")\n  if (branches.length === 0) {\n    throw new Error(\"Branches must be more then one\")\n  }\n\n  switch (data.action) {\n    case \"switch\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"Branch must be one\")\n      }\n\n      await gitSwitch(data.branches[0])\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"reset\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"branches must be one\")\n      }\n\n      await gitReset(data.branches[0])\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"reset --soft\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"branches must be one\")\n      }\n\n      await gitReset(data.branches[0], \"--soft\")\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"reset --hard\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"branches must be one\")\n      }\n\n      await gitReset(data.branches[0], \"--hard\")\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"diff\": {\n      if (data.branches.length > 2) {\n        throw new Error(\"Branch must be one or two\")\n      }\n\n      await gitDiff(data.branches[0], data.branches[1])\n      break\n    }\n    case \"merge\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"Branch must be one\")\n      }\n\n      await gitMerge(data.branches[0])\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"merge --no-ff\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"Branch must be one\")\n      }\n\n      await gitMerge(data.branches[0], \"--no-ff\")\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"rebase\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"Branch must be one\")\n      }\n\n      await gitRebase(data.branches[0])\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"rebase --interactive\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"Branch must be one\")\n      }\n\n      await gitRebaseInteractive(data.branches[0])\n      break\n    }\n    case \"delete\": {\n      for (const branch of data.branches) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitDeleteBranch(branch)\n      }\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"delete --force\": {\n      for (const branch of data.branches) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitDeleteBranch(branch, { name: \"--force\" })\n      }\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"rename\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"Branch must be one\")\n      }\n\n      await gitRenameBranch(data.branches[0])\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n    case \"yank\": {\n      if (data.branches.length > 1) {\n        throw new Error(\"Branch must be one\")\n      }\n\n      await gitYank(data.branches[0])\n      await chainFzfCommand(\"FzfPreviewGitBranches\")\n      break\n    }\n\n    case \"header\": {\n      break\n    }\n\n    default: {\n      unreachable(data)\n    }\n  }\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-branch.ts",
    "content": "import { chainFzfCommand, createBulkLineConsumer } from \"@/fzf/process/consumer\"\nimport type { GitBranchData } from \"@/type\"\n\nexport const chainGitBranchActionsConsumer = createBulkLineConsumer(async (dataList) => {\n  const gitBranchData = dataList.filter((data): data is GitBranchData => data.type === \"git-branch\")\n  await chainFzfCommand(\"FzfPreviewGitBranchActions\", { gitBranches: gitBranchData })\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-log-action.ts",
    "content": "import { gitCommit, gitDiff, gitRebaseInteractive, gitReset, gitShow, gitSwitch, gitYank } from \"@/connector/git\"\nimport { chainFzfCommand, createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport type { FzfCommandName } from \"@/type\"\nimport { unreachable } from \"@/util/type\"\n\n// eslint-disable-next-line complexity\nexport const execGitLogActionConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"git-log-actions\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n  if (data.hashes.length === 0) {\n    throw new Error(\"Hashes must be more then one\")\n  }\n\n  const nextCommand: FzfCommandName = data.isCurrentFile ? \"FzfPreviewGitCurrentLogs\" : \"FzfPreviewGitLogs\"\n\n  switch (data.action) {\n    case \"show\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitShow(data.hashes[0])\n      break\n    }\n    case \"diff\": {\n      if (data.hashes.length > 2) {\n        throw new Error(\"Hashes must be one or two\")\n      }\n\n      await gitDiff(data.hashes[0], data.hashes[1])\n      break\n    }\n    case \"reset\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitReset(data.hashes[0])\n      await chainFzfCommand(nextCommand)\n      break\n    }\n    case \"reset-soft\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitReset(data.hashes[0], \"--soft\")\n      await chainFzfCommand(nextCommand)\n      break\n    }\n    case \"reset-hard\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitReset(data.hashes[0], \"--hard\")\n      await chainFzfCommand(nextCommand)\n      break\n    }\n    case \"switch\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitSwitch(data.hashes[0])\n      await chainFzfCommand(nextCommand)\n      break\n    }\n    case \"commit --squash\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitCommit({ name: \"--squash\", hash: data.hashes[0] })\n      break\n    }\n    case \"commit --fixup\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitCommit({ name: \"--fixup\", hash: data.hashes[0] })\n      await chainFzfCommand(nextCommand)\n      break\n    }\n    case \"rebase --interactive\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitRebaseInteractive(data.hashes[0])\n      break\n    }\n    case \"yank\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitYank(data.hashes[0])\n      await chainFzfCommand(nextCommand)\n      break\n    }\n\n    case \"header\": {\n      break\n    }\n\n    default: {\n      unreachable(data)\n    }\n  }\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-log.ts",
    "content": "import { gitShow } from \"@/connector/git\"\nimport { vimEchoMessage } from \"@/connector/util\"\nimport { chainFzfCommand, createBulkLineConsumer, createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport type { GitLogData } from \"@/type\"\n\nexport const gitShowConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"git-log\" && data.type !== \"git-reflog\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  await gitShow(data.hash)\n  await vimEchoMessage(`git show ${data.hash}`)\n})\n\nexport const chainGitLogActionsConsumer = createBulkLineConsumer(async (dataList) => {\n  const gitLogData = dataList.filter((data): data is GitLogData => data.type === \"git-log\")\n  await chainFzfCommand(\"FzfPreviewGitLogActions\", { gitLogs: gitLogData })\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-reflog-action.ts",
    "content": "import { gitDiff, gitReset, gitShow, gitSwitch, gitYank } from \"@/connector/git\"\nimport { chainFzfCommand, createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { unreachable } from \"@/util/type\"\n\n// eslint-disable-next-line complexity\nexport const execGitReflogActionConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"git-reflog-actions\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n  if (data.hashes.length === 0) {\n    throw new Error(\"Reflogs must be more then one\")\n  }\n\n  switch (data.action) {\n    case \"show\": {\n      if (data.hashes.length !== 1) {\n        throw new Error(\"Reflogs must be one\")\n      }\n\n      await gitShow(data.hashes[0])\n      break\n    }\n    case \"diff\": {\n      if (data.hashes.length !== 1 && data.hashes.length !== 2) {\n        throw new Error(\"Reflogs must be one or two\")\n      }\n\n      await gitDiff(data.hashes[0], data.hashes[1])\n      break\n    }\n    case \"reset\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitReset(data.hashes[0])\n      await chainFzfCommand(\"FzfPreviewGitReflogs\")\n      break\n    }\n    case \"reset-soft\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitReset(data.hashes[0], \"--soft\")\n      await chainFzfCommand(\"FzfPreviewGitReflogs\")\n      break\n    }\n    case \"reset-hard\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitReset(data.hashes[0], \"--hard\")\n      await chainFzfCommand(\"FzfPreviewGitReflogs\")\n      break\n    }\n    case \"switch\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Hashes must be one\")\n      }\n\n      await gitSwitch(data.hashes[0])\n      await chainFzfCommand(\"FzfPreviewGitReflogs\")\n      break\n    }\n    case \"yank\": {\n      if (data.hashes.length !== 1) {\n        throw new Error(\"Reflogs must be one\")\n      }\n\n      await gitYank(data.hashes[0])\n      await chainFzfCommand(\"FzfPreviewGitReflogs\")\n      break\n    }\n\n    case \"header\": {\n      break\n    }\n\n    default: {\n      unreachable(data)\n    }\n  }\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-reflog.ts",
    "content": "import { chainFzfCommand, createBulkLineConsumer } from \"@/fzf/process/consumer\"\nimport type { GitReflogData } from \"@/type\"\n\nexport const chainGitReflogActionsConsumer = createBulkLineConsumer(async (dataList) => {\n  const gitReflogData = dataList.filter((data): data is GitReflogData => data.type === \"git-reflog\")\n  await chainFzfCommand(\"FzfPreviewGitReflogActions\", { gitReflogs: gitReflogData })\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-stash-action.ts",
    "content": "import { gitDiff, gitShow, gitStashApply, gitStashDrop, gitStashPop, gitYank } from \"@/connector/git\"\nimport { chainFzfCommand, createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { unreachable } from \"@/util/type\"\n\n// eslint-disable-next-line complexity\nexport const execGitStashActionConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"git-stash-actions\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  const stashes = data.names.filter((stash) => stash !== \"\")\n  if (stashes.length === 0) {\n    throw new Error(\"Stashes must be more then one\")\n  }\n\n  switch (data.action) {\n    case \"show\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Stashes must be one\")\n      }\n\n      await gitShow(data.hashes[0])\n      break\n    }\n    case \"diff\": {\n      if (data.hashes.length > 2) {\n        throw new Error(\"Stashes must be one or two\")\n      }\n\n      await gitDiff(data.hashes[0], data.hashes[1])\n      break\n    }\n    case \"apply\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Stashes must be one\")\n      }\n\n      await gitStashApply(data.names[0])\n      await chainFzfCommand(\"FzfPreviewGitStashes\")\n      break\n    }\n    case \"pop\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Stashes must be one\")\n      }\n\n      await gitStashPop(data.names[0])\n      await chainFzfCommand(\"FzfPreviewGitStashes\")\n      break\n    }\n    case \"drop\": {\n      for (const name of data.names) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitStashDrop(name)\n      }\n      await chainFzfCommand(\"FzfPreviewGitStashes\")\n      break\n    }\n    case \"yank\": {\n      if (data.hashes.length > 1) {\n        throw new Error(\"Stashes must be one\")\n      }\n\n      await gitYank(data.hashes[0])\n      await chainFzfCommand(\"FzfPreviewGitStashes\")\n      break\n    }\n\n    case \"header\": {\n      break\n    }\n\n    default: {\n      unreachable(data)\n    }\n  }\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-stash.ts",
    "content": "import { gitShow, gitStashCreate } from \"@/connector/git\"\nimport { vimEchoMessage } from \"@/connector/util\"\nimport { chainFzfCommand, createBulkLineConsumer } from \"@/fzf/process/consumer\"\nimport type { GitStashData } from \"@/type\"\n\nexport const chainGitStashActionsConsumer = createBulkLineConsumer(async (dataList) => {\n  const gitStashData = dataList.filter((data): data is GitStashData => data.type === \"git-stash\")\n  await chainFzfCommand(\"FzfPreviewGitStashActions\", { gitStashes: gitStashData })\n})\n\nexport const gitStashDefaultConsumer = createBulkLineConsumer(async (dataList) => {\n  if (dataList.length > 1) {\n    throw new Error(\"The git stash show should not be multiple lines.\")\n  }\n\n  const data = dataList[0]\n\n  if (data.type !== \"git-stash\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  if (data.isCreate === false) {\n    await gitShow(data.hash)\n    await vimEchoMessage(`git show ${data.hash}`)\n  } else {\n    await gitStashCreate()\n    await chainFzfCommand(\"FzfPreviewGitStashes\")\n  }\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-status-action.ts",
    "content": "import {\n  gitAdd,\n  gitAddIntentToAdd,\n  gitChaperon,\n  gitPatch,\n  gitReset,\n  gitResetIntentToAdd,\n  gitRestore,\n} from \"@/connector/git\"\nimport { chainFzfCommand, createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { unreachable } from \"@/util/type\"\n\n// eslint-disable-next-line complexity\nexport const execGitStatusActionConsumer = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"git-status-actions\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n  if (data.files.length === 0) {\n    throw new Error(\"Files must be more then one\")\n  }\n\n  switch (data.action) {\n    case \"add\": {\n      for (const file of data.files) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitAdd(file)\n      }\n      await chainFzfCommand(\"FzfPreviewGitStatus\")\n      break\n    }\n    case \"reset\": {\n      for (const file of data.files) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitReset(file)\n      }\n      await chainFzfCommand(\"FzfPreviewGitStatus\")\n      break\n    }\n    case \"patch\": {\n      for (const file of data.files) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitPatch(file)\n      }\n      break\n    }\n    case \"restore\": {\n      for (const file of data.files) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitRestore(file)\n      }\n      await chainFzfCommand(\"FzfPreviewGitStatus\")\n      break\n    }\n    case \"chaperon\": {\n      for (const file of data.files) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitChaperon(file)\n      }\n      break\n    }\n\n    case \"add --intent-to-add\": {\n      for (const file of data.files) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitAddIntentToAdd(file)\n      }\n      await chainFzfCommand(\"FzfPreviewGitStatus\")\n      break\n    }\n\n    case \"reset --intent-to-add\": {\n      for (const file of data.files) {\n        // eslint-disable-next-line no-await-in-loop\n        await gitResetIntentToAdd(file)\n      }\n      await chainFzfCommand(\"FzfPreviewGitStatus\")\n      break\n    }\n\n    case \"header\": {\n      break\n    }\n\n    default: {\n      unreachable(data)\n    }\n  }\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git-status.ts",
    "content": "import { gitAdd, gitCommit, gitReset } from \"@/connector/git\"\nimport { vimEchoMessage } from \"@/connector/util\"\nimport { chainFzfCommand, createBulkLineConsumer } from \"@/fzf/process/consumer\"\nimport type { GitStatusData } from \"@/type\"\n\nexport const chainGitStatusActionsConsumer = createBulkLineConsumer(async (dataList) => {\n  const gitStatusDataList = dataList.filter((data): data is GitStatusData => data.type === \"git-status\")\n  await chainFzfCommand(\"FzfPreviewGitStatusActions\", { gitStatusDataList })\n})\n\nexport const gitAddConsumer = createBulkLineConsumer(async (dataList) => {\n  const gitDataList = dataList.filter((data): data is GitStatusData => data.type === \"git-status\")\n\n  for (const data of gitDataList) {\n    // eslint-disable-next-line no-await-in-loop\n    await gitAdd(data.file)\n  }\n\n  await vimEchoMessage(`git add ${gitDataList.map((data) => data.file).join(\" \")}`)\n  await chainFzfCommand(\"FzfPreviewGitStatus\")\n})\n\nexport const gitResetConsumer = createBulkLineConsumer(async (dataList) => {\n  const gitDataList = dataList.filter((data): data is GitStatusData => data.type === \"git-status\")\n\n  for (const data of gitDataList) {\n    // eslint-disable-next-line no-await-in-loop\n    await gitReset(data.file)\n  }\n\n  await vimEchoMessage(`git reset ${gitDataList.map((data) => data.file).join(\" \")}`)\n  await chainFzfCommand(\"FzfPreviewGitStatus\")\n})\n\nexport const gitCommitConsumer = createBulkLineConsumer(async (_) => {\n  await gitCommit()\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/git.ts",
    "content": "import { gitCreateBranch, gitSwitch } from \"@/connector/git\"\nimport { vimEchoMessage } from \"@/connector/util\"\nimport { chainFzfCommand, createBulkLineConsumer } from \"@/fzf/process/consumer\"\n\nexport const chainGitActionsConsumer = createBulkLineConsumer(async (_) => {\n  await chainFzfCommand(\"FzfPreviewGitActions\")\n})\n\nexport const chainGitStatusConsumer = createBulkLineConsumer(async (_) => {\n  await chainFzfCommand(\"FzfPreviewGitStatus\")\n})\n\nexport const chainGitBranchesConsumer = createBulkLineConsumer(async (_) => {\n  await chainFzfCommand(\"FzfPreviewGitBranches\")\n})\n\nexport const chainGitStashesConsumer = createBulkLineConsumer(async (_) => {\n  await chainFzfCommand(\"FzfPreviewGitStashes\")\n})\n\nexport const chainGitReflogsConsumer = createBulkLineConsumer(async (_) => {\n  await chainFzfCommand(\"FzfPreviewGitReflogs\")\n})\n\nexport const chainGitLogsConsumer = createBulkLineConsumer(async (dataList) => {\n  if (dataList[0].type === \"git-log-actions\" && dataList[0].isCurrentFile === true) {\n    await chainFzfCommand(\"FzfPreviewGitCurrentLogs\")\n  } else if (dataList[0].type === \"git-log-actions\" && dataList[0].isCurrentFile === false) {\n    await chainFzfCommand(\"FzfPreviewGitLogs\")\n  }\n})\n\nexport const gitSwitchConsumer = createBulkLineConsumer(async (dataList) => {\n  if (dataList.length > 1) {\n    throw new Error(\"The git switch should not be multiple lines.\")\n  }\n\n  const data = dataList[0]\n\n  switch (data.type) {\n    case \"git-branch\": {\n      if (data.isCreate === false) {\n        await gitSwitch(data.name)\n        await vimEchoMessage(`git switch ${data.name}`)\n      } else {\n        await gitCreateBranch()\n      }\n      break\n    }\n    case \"git-log\": {\n      await gitSwitch(data.hash)\n      await vimEchoMessage(`git switch ${data.hash}`)\n      break\n    }\n\n    default: {\n      throw new Error(`Unexpected data type: ${data.type}`)\n    }\n  }\n\n  await chainFzfCommand(\"FzfPreviewGitBranches\")\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/index.ts",
    "content": "import { v4 as uuidv4 } from \"uuid\"\n\nimport { execFzfCommand } from \"@/connector/fzf\"\nimport { sessionModule } from \"@/module/session\"\nimport { dispatch } from \"@/store\"\nimport type { CallbackLine, FzfCommandName, ResourceData, Session } from \"@/type\"\n\nexport const decodeLine = (callbackLine: CallbackLine): ResourceData => {\n  return JSON.parse(decodeURIComponent(callbackLine.trim().split(\" \")[0])) as ResourceData\n}\n\nexport const createSingleLineConsumer = (consume: (data: ResourceData) => Promise<void>) =>\n  ({\n    consume,\n    kind: \"single\",\n  } as const)\n\nexport const createBulkLineConsumer = (consume: (dataList: ReadonlyArray<ResourceData>) => Promise<void>) =>\n  ({\n    consume,\n    kind: \"bulk\",\n  } as const)\n\nexport const chainFzfCommand = async (fzfCommandName: FzfCommandName, session?: Session): Promise<void> => {\n  if (session == null) {\n    await execFzfCommand(fzfCommandName, { clearSession: true })\n  } else {\n    const sessionToken = uuidv4()\n    dispatch(sessionModule.actions.setSession({ session, sessionToken }))\n    await execFzfCommand(fzfCommandName, { sessionToken })\n  }\n}\n"
  },
  {
    "path": "src/fzf/process/consumer/open-buffer.ts",
    "content": "import { deleteBuffer } from \"@/connector/buffers\"\nimport { openFile } from \"@/connector/open-file\"\nimport { createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { OpenCommand, OpenFile, SingleLineConsumer } from \"@/type\"\n\nconst convertOpenCommand = (openCommand: OpenCommand): OpenCommand => {\n  if (openCommand === \"edit\" && globalVariableSelector(\"fzfPreviewBuffersJump\") !== 0) {\n    return \"drop\"\n  }\n\n  return openCommand\n}\n\nconst createOpenBufferConsumer = (openCommand: OpenCommand) =>\n  createSingleLineConsumer(async (data) => {\n    if (data.type !== \"buffer\") {\n      throw new Error(`Unexpected data type: ${data.type}`)\n    }\n\n    const openFileFormat: OpenFile = {\n      openCommand: convertOpenCommand(openCommand),\n      file: data.file,\n    }\n\n    await openFile(openFileFormat)\n  })\n\nexport const createDeleteBufferConsumer = (): SingleLineConsumer =>\n  createSingleLineConsumer(async (data) => {\n    if (data.type !== \"buffer\") {\n      throw new Error(`Unexpected data type: ${data.type}`)\n    }\n\n    await deleteBuffer(data.bufnr.toString())\n  })\n\nexport const editConsumer = createOpenBufferConsumer(\"edit\")\nexport const splitConsumer = createOpenBufferConsumer(\"split\")\nexport const vsplitConsumer = createOpenBufferConsumer(\"vsplit\")\nexport const tabeditConsumer = createOpenBufferConsumer(\"tabedit\")\nexport const dropConsumer = createOpenBufferConsumer(\"drop\")\nexport const deleteBufferConsumer = createDeleteBufferConsumer()\n"
  },
  {
    "path": "src/fzf/process/consumer/open-bufnr.ts",
    "content": "import { openBufnr } from \"@/connector/open-bufnr\"\nimport { createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { createDeleteBufferConsumer } from \"@/fzf/process/consumer/open-buffer\"\nimport type { OpenCommand } from \"@/type\"\n\nconst createOpenBufnrConsumer = (openCommand: OpenCommand) =>\n  createSingleLineConsumer(async (data) => {\n    if (data.type !== \"buffer\") {\n      throw new Error(`Unexpected data type: ${data.type}`)\n    }\n    await openBufnr(openCommand, data.bufnr.toString())\n  })\n\nexport const editBufnrConsumer = createOpenBufnrConsumer(\"edit\")\nexport const splitBufnrConsumer = createOpenBufnrConsumer(\"split\")\nexport const vsplitBufnrConsumer = createOpenBufnrConsumer(\"vsplit\")\nexport const tabeditBufnrConsumer = createOpenBufnrConsumer(\"tabedit\")\nexport const deleteBufnrConsumer = createDeleteBufferConsumer()\n"
  },
  {
    "path": "src/fzf/process/consumer/open-file.test.ts",
    "content": "import { exportQuickFix, openFile } from \"@/connector/open-file\"\nimport { editConsumer, exportQuickfixConsumer, splitConsumer } from \"@/fzf/process/consumer/open-file\"\nimport { executeCommandSelector } from \"@/module/selector/execute-command\"\nimport type { FileData, LineData } from \"@/type\"\n\njest.mock(\"@/connector/open-file\")\njest.mock(\"@/module/selector/execute-command\")\n\ndescribe(\"open file consumer\", () => {\n  describe(\"open command\", () => {\n    describe(\"with only filename\", () => {\n      it(\"edit open file consumer\", async () => {\n        const data: FileData = {\n          command: \"FzfPreviewProjectFiles\",\n          type: \"file\",\n          file: \"foo.txt\",\n        }\n        await editConsumer.consume(data)\n        expect(openFile).toHaveBeenCalledWith({ openCommand: \"edit\", file: \"foo.txt\" })\n      })\n\n      it(\"split open file consumer\", async () => {\n        const data: FileData = {\n          command: \"FzfPreviewProjectFiles\",\n          type: \"file\",\n          file: \"foo.txt\",\n        }\n        await splitConsumer.consume(data)\n        expect(openFile).toHaveBeenCalledWith({ openCommand: \"split\", file: \"foo.txt\" })\n      })\n    })\n\n    it(\"with filename and line number\", async () => {\n      const data: LineData = {\n        command: \"FzfPreviewProjectGrep\",\n        type: \"line\",\n        file: \"foo.txt\",\n        lineNumber: 10,\n        text: \"\",\n      }\n      await editConsumer.consume(data)\n      expect(openFile).toHaveBeenCalledWith({ openCommand: \"edit\", file: \"foo.txt\", lineNumber: 10 })\n    })\n\n    it(\"with filename, line number and text\", async () => {\n      const data: LineData = {\n        command: \"FzfPreviewProjectGrep\",\n        type: \"line\",\n        file: \"foo.txt\",\n        lineNumber: 10,\n        text: \"bar\",\n      }\n      await editConsumer.consume(data)\n      expect(openFile).toHaveBeenCalledWith({ openCommand: \"edit\", file: \"foo.txt\", lineNumber: 10 })\n    })\n  })\n\n  describe(\"export quickfix\", () => {\n    it(\"with only filename\", async () => {\n      ;(executeCommandSelector as jest.Mock).mockImplementation(() => ({ commandName: \"fooCommand\" }))\n      const dataList: ReadonlyArray<FileData> = [\n        {\n          command: \"FzfPreviewProjectFiles\",\n          type: \"file\",\n          file: \"foo.txt\",\n        },\n        {\n          command: \"FzfPreviewProjectFiles\",\n          type: \"file\",\n          file: \"bar.txt\",\n        },\n      ]\n      await exportQuickfixConsumer.consume(dataList)\n      expect(exportQuickFix).toHaveBeenCalledWith([{ filename: \"foo.txt\" }, { filename: \"bar.txt\" }], {\n        title: \"fooCommand\",\n      })\n    })\n\n    it(\"with filename, line number and text\", async () => {\n      ;(executeCommandSelector as jest.Mock).mockImplementation(() => ({ commandName: \"fooCommand\" }))\n      const dataList: ReadonlyArray<LineData> = [\n        {\n          command: \"FzfPreviewProjectGrep\",\n          type: \"line\",\n          file: \"foo.txt\",\n          text: \"\",\n          lineNumber: 10,\n        },\n        {\n          command: \"FzfPreviewProjectGrep\",\n          type: \"line\",\n          file: \"bar.txt\",\n          text: \"foobar\",\n          lineNumber: 20,\n        },\n      ]\n      await exportQuickfixConsumer.consume(dataList)\n      expect(exportQuickFix).toHaveBeenCalledWith(\n        [\n          { filename: \"foo.txt\", lnum: 10, text: \"\" },\n          { filename: \"bar.txt\", lnum: 20, text: \"foobar\" },\n        ],\n        { title: \"fooCommand\" }\n      )\n    })\n  })\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/open-file.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport { exportQuickFix, openFile } from \"@/connector/open-file\"\nimport { createBulkLineConsumer, createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { executeCommandSelector } from \"@/module/selector/execute-command\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { ExportQuickFix, OpenCommand } from \"@/type\"\n\nconst convertOpenCommand = (openCommand: OpenCommand): OpenCommand => {\n  if (openCommand === \"edit\" && globalVariableSelector(\"fzfPreviewBuffersJump\") !== 0) {\n    return \"drop\"\n  }\n\n  return openCommand\n}\n\nconst createOpenFileConsumer = (openCommand: OpenCommand, opt?: { setTagStack?: boolean }) =>\n  createSingleLineConsumer(async (data) => {\n    const command = convertOpenCommand(openCommand)\n\n    switch (data.type) {\n      case \"file\": {\n        await openFile({\n          openCommand: command,\n          file: data.file,\n        })\n        break\n      }\n      case \"buffer\": {\n        await openFile({\n          openCommand: command,\n          file: data.file,\n        })\n        break\n      }\n      case \"line\": {\n        await openFile({\n          openCommand: command,\n          file: data.file,\n          lineNumber: data.lineNumber,\n          setTagStack: opt?.setTagStack,\n        })\n        break\n      }\n      case \"git-status\": {\n        await openFile({\n          openCommand: command,\n          file: data.file,\n        })\n        break\n      }\n      default: {\n        throw new Error(`Unexpected data type: ${data.type}`)\n      }\n    }\n  })\n\nexport const editConsumer = createOpenFileConsumer(\"edit\")\nexport const editWithTagStackConsumer = createOpenFileConsumer(\"edit\", { setTagStack: true })\nexport const splitConsumer = createOpenFileConsumer(\"split\")\nexport const vsplitConsumer = createOpenFileConsumer(\"vsplit\")\nexport const tabeditConsumer = createOpenFileConsumer(\"tabedit\")\nexport const dropConsumer = createOpenFileConsumer(\"drop\")\n\nexport const exportQuickfixConsumer = createBulkLineConsumer(async (dataList) => {\n  const quickFixList: ReadonlyDeep<ReadonlyArray<ExportQuickFix>> = dataList.map((data) => {\n    switch (data.type) {\n      case \"file\": {\n        return {\n          filename: data.file,\n        }\n      }\n      case \"buffer\": {\n        return {\n          filename: data.file,\n        }\n      }\n      case \"line\": {\n        return {\n          filename: data.file,\n          lnum: data.lineNumber,\n          text: data.text,\n        }\n      }\n      case \"git-status\": {\n        return {\n          filename: data.file,\n        }\n      }\n      default: {\n        throw new Error(`Unexpected data type: ${data.type}`)\n      }\n    }\n  })\n\n  const title = executeCommandSelector().commandName as string\n  await exportQuickFix(quickFixList, { title })\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/open-pr.ts",
    "content": "import { createSingleLineConsumer } from \"@/fzf/process/consumer\"\nimport { execSyncCommand } from \"@/system/command\"\n\n// eslint-disable-next-line @typescript-eslint/require-await\nexport const openPr = createSingleLineConsumer(async (data) => {\n  if (data.type === \"git-pr\" && data.prNumber != null) {\n    execSyncCommand(`gh pr view --web ${data.prNumber}`)\n  } else {\n    throw new Error(\"Data has no PR\")\n  }\n})\n"
  },
  {
    "path": "src/fzf/process/consumer/register.ts",
    "content": "import { pasteRegister as pasteVimRegister,setRegister as setVimRegister } from \"@/connector/register\"\nimport { createSingleLineConsumer } from \"@/fzf/process/consumer\"\n\nexport const setRegister = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"register\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  await setVimRegister(data.text, data.option)\n})\n\nexport const pasteRegister = createSingleLineConsumer(async (data) => {\n  if (data.type !== \"register\") {\n    throw new Error(`Unexpected data type: ${data.type}`)\n  }\n\n  await pasteVimRegister(data.text, data.option)\n})\n"
  },
  {
    "path": "src/fzf/process/git-action.ts",
    "content": "import { execGitActionConsumer } from \"@/fzf/process/consumer/git-action\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitActionProcess = createProcessCreator(\"git-action\")\n\nexport const gitActionProcesses: Processes = [createGitActionProcess(\"enter\", execGitActionConsumer)]\n"
  },
  {
    "path": "src/fzf/process/git-branch-action.ts",
    "content": "import { chainGitBranchesConsumer } from \"@/fzf/process/consumer/git\"\nimport { execGitBranchActionConsumer } from \"@/fzf/process/consumer/git-branch-action\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitBranchActionProcess = createProcessCreator(\"git-branch-actions\")\n\nexport const gitBranchActionProcesses: Processes = [\n  createGitBranchActionProcess(\"enter\", execGitBranchActionConsumer),\n  createGitBranchActionProcess(\"<\", chainGitBranchesConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-branch.ts",
    "content": "import { chainGitActionsConsumer, chainGitStatusConsumer, gitSwitchConsumer } from \"@/fzf/process/consumer/git\"\nimport { chainGitBranchActionsConsumer } from \"@/fzf/process/consumer/git-branch\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitBranchProcess = createProcessCreator(\"git-branch\")\n\nexport const gitBranchProcesses: Processes = [\n  createGitBranchProcess(\"enter\", gitSwitchConsumer),\n  createGitBranchProcess(\"ctrl-s\", chainGitStatusConsumer),\n  createGitBranchProcess(\"<\", chainGitActionsConsumer),\n  createGitBranchProcess(\">\", chainGitBranchActionsConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-log-action.ts",
    "content": "import { chainGitLogsConsumer } from \"@/fzf/process/consumer/git\"\nimport { execGitLogActionConsumer } from \"@/fzf/process/consumer/git-log-action\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitLogActionProcess = createProcessCreator(\"git-log-actions\")\n\nexport const gitLogActionProcesses: Processes = [\n  createGitLogActionProcess(\"enter\", execGitLogActionConsumer),\n  createGitLogActionProcess(\"<\", chainGitLogsConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-log.ts",
    "content": "import { chainGitActionsConsumer, chainGitStatusConsumer } from \"@/fzf/process/consumer/git\"\nimport { chainGitLogActionsConsumer, gitShowConsumer } from \"@/fzf/process/consumer/git-log\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitLogProcess = createProcessCreator(\"git-log\")\n\nexport const gitLogProcesses: Processes = [\n  createGitLogProcess(\"enter\", gitShowConsumer),\n  createGitLogProcess(\"ctrl-s\", chainGitStatusConsumer),\n  createGitLogProcess(\"<\", chainGitActionsConsumer),\n  createGitLogProcess(\">\", chainGitLogActionsConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-reflog-action.ts",
    "content": "import { chainGitReflogsConsumer } from \"@/fzf/process/consumer/git\"\nimport { execGitReflogActionConsumer } from \"@/fzf/process/consumer/git-reflog-action\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitReflogActionProcess = createProcessCreator(\"git-reflog-actions\")\n\nexport const gitReflogActionProcesses: Processes = [\n  createGitReflogActionProcess(\"enter\", execGitReflogActionConsumer),\n  createGitReflogActionProcess(\"<\", chainGitReflogsConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-reflog.ts",
    "content": "import { chainGitActionsConsumer, chainGitStatusConsumer } from \"@/fzf/process/consumer/git\"\nimport { gitShowConsumer } from \"@/fzf/process/consumer/git-log\"\nimport { chainGitReflogActionsConsumer } from \"@/fzf/process/consumer/git-reflog\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitReflogProcess = createProcessCreator(\"git-reflog\")\n\nexport const gitReflogProcesses: Processes = [\n  createGitReflogProcess(\"enter\", gitShowConsumer),\n  createGitReflogProcess(\"ctrl-s\", chainGitStatusConsumer),\n  createGitReflogProcess(\"<\", chainGitActionsConsumer),\n  createGitReflogProcess(\">\", chainGitReflogActionsConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-stash-action.ts",
    "content": "import { chainGitStashesConsumer } from \"@/fzf/process/consumer/git\"\nimport { execGitStashActionConsumer } from \"@/fzf/process/consumer/git-stash-action\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitStashActionProcess = createProcessCreator(\"git-stash-actions\")\n\nexport const gitStashActionProcesses: Processes = [\n  createGitStashActionProcess(\"enter\", execGitStashActionConsumer),\n  createGitStashActionProcess(\"<\", chainGitStashesConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-stash.ts",
    "content": "import { chainGitActionsConsumer, chainGitStatusConsumer } from \"@/fzf/process/consumer/git\"\nimport { chainGitStashActionsConsumer, gitStashDefaultConsumer } from \"@/fzf/process/consumer/git-stash\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitStashProcess = createProcessCreator(\"git-stash\")\n\nexport const gitStashProcesses: Processes = [\n  createGitStashProcess(\"enter\", gitStashDefaultConsumer),\n  createGitStashProcess(\"ctrl-s\", chainGitStatusConsumer),\n  createGitStashProcess(\"<\", chainGitActionsConsumer),\n  createGitStashProcess(\">\", chainGitStashActionsConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-status-action.ts",
    "content": "import { chainGitStatusConsumer } from \"@/fzf/process/consumer/git\"\nimport { execGitStatusActionConsumer } from \"@/fzf/process/consumer/git-status-action\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitStatusActionProcess = createProcessCreator(\"git-status-actions\")\n\nexport const gitStatusActionProcesses: Processes = [\n  createGitStatusActionProcess(\"enter\", execGitStatusActionConsumer),\n  createGitStatusActionProcess(\"<\", chainGitStatusConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/git-status.ts",
    "content": "import { chainGitActionsConsumer } from \"@/fzf/process/consumer/git\"\nimport {\n  chainGitStatusActionsConsumer,\n  gitAddConsumer,\n  gitCommitConsumer,\n  gitResetConsumer,\n} from \"@/fzf/process/consumer/git-status\"\nimport {\n  dropConsumer,\n  editConsumer,\n  splitConsumer,\n  tabeditConsumer,\n  vsplitConsumer,\n} from \"@/fzf/process/consumer/open-file\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createGitStatusProcess = createProcessCreator(\"git-status\")\n\nexport const gitStatusProcesses: Processes = [\n  createGitStatusProcess(\"enter\", editConsumer),\n  createGitStatusProcess(\"ctrl-x\", splitConsumer),\n  createGitStatusProcess(\"ctrl-v\", vsplitConsumer),\n  createGitStatusProcess(\"ctrl-t\", tabeditConsumer),\n  createGitStatusProcess(\"ctrl-o\", dropConsumer),\n  createGitStatusProcess(\"ctrl-a\", gitAddConsumer),\n  createGitStatusProcess(\"ctrl-r\", gitResetConsumer),\n  createGitStatusProcess(\"ctrl-c\", gitCommitConsumer),\n  createGitStatusProcess(\"<\", chainGitActionsConsumer),\n  createGitStatusProcess(\">\", chainGitStatusActionsConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/index.ts",
    "content": "import { commandPaletteProcesses } from \"@/fzf/process/command-palette\"\nimport { decodeLine } from \"@/fzf/process/consumer\"\nimport { gitActionProcesses } from \"@/fzf/process/git-action\"\nimport { gitBranchProcesses } from \"@/fzf/process/git-branch\"\nimport { gitBranchActionProcesses } from \"@/fzf/process/git-branch-action\"\nimport { gitLogProcesses } from \"@/fzf/process/git-log\"\nimport { gitLogActionProcesses } from \"@/fzf/process/git-log-action\"\nimport { gitReflogProcesses } from \"@/fzf/process/git-reflog\"\nimport { gitReflogActionProcesses } from \"@/fzf/process/git-reflog-action\"\nimport { gitStashProcesses } from \"@/fzf/process/git-stash\"\nimport { gitStashActionProcesses } from \"@/fzf/process/git-stash-action\"\nimport { gitStatusProcesses } from \"@/fzf/process/git-status\"\nimport { gitStatusActionProcesses } from \"@/fzf/process/git-status-action\"\nimport { openBufferProcesses } from \"@/fzf/process/open-buffer\"\nimport { openBufnrProcesses } from \"@/fzf/process/open-bufnr\"\nimport { openFileProcesses, openFileWithTagStackProcesses } from \"@/fzf/process/open-file\"\nimport { openPrProcesses } from \"@/fzf/process/open-pr\"\nimport { registerProcesses } from \"@/fzf/process/register\"\nimport { syncVimVariable } from \"@/plugin/sync-vim-variable\"\nimport type { CallbackLines, Process, ProcessesDefinition } from \"@/type\"\n\nexport const processesDefinition: ProcessesDefinition = [\n  {\n    name: \"open-file\",\n    processes: openFileProcesses,\n  },\n  {\n    name: \"open-file-with-tag-stack\",\n    processes: openFileWithTagStackProcesses,\n  },\n  {\n    name: \"open-buffer\",\n    processes: openBufferProcesses,\n  },\n  {\n    name: \"open-bufnr\",\n    processes: openBufnrProcesses,\n  },\n  {\n    name: \"command-palette\",\n    processes: commandPaletteProcesses,\n  },\n  {\n    name: \"git-action\",\n    processes: gitActionProcesses,\n  },\n  {\n    name: \"git-status\",\n    processes: gitStatusProcesses,\n  },\n  {\n    name: \"git-status-actions\",\n    processes: gitStatusActionProcesses,\n  },\n  {\n    name: \"git-branch\",\n    processes: gitBranchProcesses,\n  },\n  {\n    name: \"git-branch-actions\",\n    processes: gitBranchActionProcesses,\n  },\n  {\n    name: \"git-log\",\n    processes: gitLogProcesses,\n  },\n  {\n    name: \"git-log-actions\",\n    processes: gitLogActionProcesses,\n  },\n  {\n    name: \"git-stash\",\n    processes: gitStashProcesses,\n  },\n  {\n    name: \"git-stash-actions\",\n    processes: gitStashActionProcesses,\n  },\n  {\n    name: \"git-reflog\",\n    processes: gitReflogProcesses,\n  },\n  {\n    name: \"git-reflog-actions\",\n    processes: gitReflogActionProcesses,\n  },\n  {\n    name: \"register\",\n    processes: registerProcesses,\n  },\n  {\n    name: \"open-pr\",\n    processes: openPrProcesses,\n  },\n]\n\nexport const executeProcess = async (lines: CallbackLines, process: Process): Promise<void> => {\n  await syncVimVariable()\n  await process.execute(lines.map((line) => decodeLine(line)))\n}\n"
  },
  {
    "path": "src/fzf/process/open-buffer.ts",
    "content": "import {\n  deleteBufferConsumer,\n  dropConsumer,\n  editConsumer,\n  splitConsumer,\n  tabeditConsumer,\n  vsplitConsumer,\n} from \"@/fzf/process/consumer/open-buffer\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createOpenBufferProcess = createProcessCreator(\"open-buffer\")\n\nexport const openBufferProcesses: Processes = [\n  createOpenBufferProcess(\"enter\", editConsumer),\n  createOpenBufferProcess(\"ctrl-x\", splitConsumer),\n  createOpenBufferProcess(\"ctrl-v\", vsplitConsumer),\n  createOpenBufferProcess(\"ctrl-t\", tabeditConsumer),\n  createOpenBufferProcess(\"ctrl-o\", dropConsumer),\n  createOpenBufferProcess(\"ctrl-q\", deleteBufferConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/open-bufnr.ts",
    "content": "import {\n  deleteBufnrConsumer,\n  editBufnrConsumer,\n  splitBufnrConsumer,\n  tabeditBufnrConsumer,\n  vsplitBufnrConsumer,\n} from \"@/fzf/process/consumer/open-bufnr\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createOpenBufnrProcess = createProcessCreator(\"open-bufnr\")\n\nexport const openBufnrProcesses: Processes = [\n  createOpenBufnrProcess(\"enter\", editBufnrConsumer),\n  createOpenBufnrProcess(\"ctrl-x\", splitBufnrConsumer),\n  createOpenBufnrProcess(\"ctrl-v\", vsplitBufnrConsumer),\n  createOpenBufnrProcess(\"ctrl-t\", tabeditBufnrConsumer),\n  createOpenBufnrProcess(\"ctrl-q\", deleteBufnrConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/open-file.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport {\n  dropConsumer,\n  editConsumer,\n  editWithTagStackConsumer,\n  exportQuickfixConsumer,\n  splitConsumer,\n  tabeditConsumer,\n  vsplitConsumer,\n} from \"@/fzf/process/consumer/open-file\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createOpenFileProcess = createProcessCreator(\"open-file\")\n\nexport const openFileProcesses: ReadonlyDeep<Processes> = [\n  createOpenFileProcess(\"enter\", editConsumer),\n  createOpenFileProcess(\"ctrl-x\", splitConsumer),\n  createOpenFileProcess(\"ctrl-v\", vsplitConsumer),\n  createOpenFileProcess(\"ctrl-t\", tabeditConsumer),\n  createOpenFileProcess(\"ctrl-o\", dropConsumer),\n  createOpenFileProcess(\"ctrl-q\", exportQuickfixConsumer),\n]\n\nconst createOpenFileWithTagStackProcess = createProcessCreator(\"open-file-with-tag-stack\")\n\nexport const openFileWithTagStackProcesses: ReadonlyDeep<Processes> = [\n  createOpenFileWithTagStackProcess(\"enter\", editWithTagStackConsumer),\n  createOpenFileWithTagStackProcess(\"ctrl-x\", splitConsumer),\n  createOpenFileWithTagStackProcess(\"ctrl-v\", vsplitConsumer),\n  createOpenFileWithTagStackProcess(\"ctrl-t\", tabeditConsumer),\n  createOpenFileWithTagStackProcess(\"ctrl-o\", dropConsumer),\n  createOpenFileWithTagStackProcess(\"ctrl-q\", exportQuickfixConsumer),\n]\n"
  },
  {
    "path": "src/fzf/process/open-pr.ts",
    "content": "import { openPr } from \"@/fzf/process/consumer/open-pr\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createOpenPrProcess = createProcessCreator(\"open-pr\")\n\nexport const openPrProcesses: Processes = [createOpenPrProcess(\"enter\", openPr)]\n"
  },
  {
    "path": "src/fzf/process/process.ts",
    "content": "import { createProcessFunctionName } from \"@/fzf/util\"\nimport type { CreateProcessCreator, ResourceData } from \"@/type\"\nimport { unreachable } from \"@/util/type\"\n\nexport const createProcessCreator: CreateProcessCreator = (processesName) => (expectKey, lineConsumer) => ({\n  name: createProcessFunctionName(processesName, expectKey),\n  key: expectKey,\n  execute: async (dataList: ReadonlyArray<ResourceData>) => {\n    switch (lineConsumer.kind) {\n      case \"single\": {\n        for (const data of dataList) {\n          // eslint-disable-next-line no-await-in-loop\n          await lineConsumer.consume(data)\n        }\n        break\n      }\n      case \"bulk\": {\n        await lineConsumer.consume(dataList)\n        break\n      }\n      default: {\n        unreachable(lineConsumer)\n      }\n    }\n  },\n})\n"
  },
  {
    "path": "src/fzf/process/register.ts",
    "content": "import { pasteRegister, setRegister } from \"@/fzf/process/consumer/register\"\nimport { createProcessCreator } from \"@/fzf/process/process\"\nimport type { Processes } from \"@/type\"\n\nconst createRegisterProcess = createProcessCreator(\"register\")\n\nexport const registerProcesses: Processes = [\n  createRegisterProcess(\"enter\", setRegister),\n  createRegisterProcess(\"ctrl-y\", pasteRegister),\n]\n"
  },
  {
    "path": "src/fzf/resource/all-buffers.ts",
    "content": "import { getAllBuffers } from \"@/connector/buffers\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"  \"\n\n// Colorize after align\n// If it contains ansi escape, it will not align well\nconst colorizeArrayedBuffer = (list: ReadonlyArray<string>): string => {\n  const [bufnr, fileName] = list\n\n  return [colorize(bufnr, \"blue\"), colorizeFile(fileName)].join(SPACER).trim()\n}\n\nexport const allBuffers = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const buffers = await getAllBuffers()\n\n  const displayLines = alignLists(buffers.map((buffer) => [`[${buffer.bufnr}]`, buffer.fileName])).map((list) =>\n    colorizeArrayedBuffer(list)\n  )\n\n  return {\n    type: \"json\",\n    lines: buffers.map((buffer, i) => ({\n      data: {\n        command: \"FzfPreviewAllBuffers\",\n        type: \"buffer\",\n        file: buffer.fileName,\n        bufnr: buffer.bufnr,\n      },\n      displayText: displayLines[i],\n    })),\n  }\n}\n\nexport const allBuffersDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"AllBuffers> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/blame-pr.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { execSyncCommand } from \"@/system/command\"\nimport { existsFileAsync, getCurrentFilePath } from \"@/system/file\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const blamePr = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await existsFileAsync(await getCurrentFilePath()))) {\n    return {\n      type: \"json\",\n      lines: [],\n    }\n  }\n\n  const file = await getCurrentFilePath()\n  const openPrCommand = globalVariableSelector(\"fzfPreviewBlamePrCommand\") as string\n  const { stdout, stderr, status } = execSyncCommand(`${openPrCommand} ${file}`)\n\n  if (stderr !== \"\" || status !== 0) {\n    throw new Error(`Failed open pr command: \"${openPrCommand}\"`)\n  }\n\n  const lines = stdout.split(\"\\n\").filter((line) => line !== \"\")\n  const resourceLines: ResourceLines = lines.map((line) => {\n    const result = /^PR\\s#(?<prNumber>\\d+)/.exec(line)\n    if (result?.groups != null) {\n      return {\n        data: {\n          command: \"FzfPreviewBlamePR\",\n          type: \"git-pr\",\n          prNumber: Number(result.groups.prNumber),\n        },\n        displayText: line,\n      }\n    }\n\n    return {\n      data: {\n        command: \"FzfPreviewBlamePR\",\n        type: \"git-pr\",\n      },\n      displayText: line,\n    }\n  })\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nexport const blamePrDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Blame PR> \"',\n  \"--multi\": true,\n  \"--preview\": '\"gh pr view {3}\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/bookmarks.ts",
    "content": "import { getBookmarks } from \"@/connector/bookmarks\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const bookmarks = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const resourceLines: ResourceLines = (await getBookmarks()).map(({ file, line, text, comment }) => {\n    return {\n      data: {\n        command: \"FzfPreviewBookmarks\",\n        type: \"line\",\n        file,\n        text,\n        lineNumber: Number(line),\n      },\n      displayText: `${colorizeFile(file)}:${colorize(line, \"green\")}: ${text}:${comment}`,\n    }\n  })\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const bookmarksDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Bookmarks> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/buffer-lines.ts",
    "content": "import { getBuffers } from \"@/connector/buffers\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { readFile } from \"@/system/file\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const bufferLines = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const buffers = await getBuffers()\n\n  const lines = buffers.reduce((acc: ResourceLines, cur) => {\n    const fileLines = readFile(cur.fileName)\n      .split(\"\\n\")\n      .map((line, lineIndex) => ({\n        lineNumber: lineIndex + 1,\n        text: line,\n      }))\n      .slice(0, -1)\n\n    const resourceLines: ResourceLines = fileLines.map((line) => ({\n      data: {\n        command: \"FzfPreviewBufferLines\",\n        type: \"line\",\n        file: cur.fileName,\n        text: line.text,\n        lineNumber: line.lineNumber,\n      },\n      displayText: `${colorizeFile(cur.fileName)}:${colorize(line.lineNumber.toString(), \"green\")}:${line.text}`,\n    }))\n\n    return [...acc, ...resourceLines]\n  }, [])\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const bufferLinesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"BufferLines> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/buffer-tags.ts",
    "content": "import { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { existsFileAsync, getCurrentFilePath } from \"@/system/file\"\nimport { getBufferTags } from \"@/system/tags\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"  \"\n\nexport const bufferTags = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await existsFileAsync(await getCurrentFilePath()))) {\n    return {\n      type: \"json\",\n      lines: [],\n    }\n  }\n\n  const file = await getCurrentFilePath()\n  const parsedTags = getBufferTags(file)\n    .map((line) => /^(?<tagName>[^\\t]+)\\t(?<tagFile>\\S+)\\t(?<lineNumber>\\d+);\"\\t(?<tagField>.+)/.exec(line))\n    .filter((match): match is RegExpExecArray => match != null && \"groups\" in match)\n    .map((match) => {\n      return match.groups as {\n        tagName: string\n        tagFile: string\n        lineNumber: string\n        tagField: string\n      }\n    })\n    .sort((a, b) => Number(a.lineNumber) - Number(b.lineNumber))\n\n  const currentFile = await getCurrentFilePath()\n  const textList = alignLists(\n    parsedTags.map(({ lineNumber, tagName, tagField }) => [lineNumber, tagName, tagField])\n  ).map((tagArray) => tagArray.join(SPACER).trim())\n\n  return {\n    type: \"json\",\n    lines: parsedTags.map((tag, i) => ({\n      data: {\n        command: \"FzfPreviewBufferTags\",\n        type: \"line\",\n        file: currentFile,\n        text: textList[i],\n        lineNumber: Number(tag.lineNumber),\n      },\n      displayText: textList[i],\n    })),\n  }\n}\n\nconst previewCommand = async () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} ${await getCurrentFilePath()}:{2..}\"`\n}\n\nexport const bufferTagsDefaultOptions = async (): Promise<FzfCommandDefinitionDefaultOption> => ({\n  \"--prompt\": '\"BufferTags> \"',\n  \"--multi\": true,\n  \"--preview\": await previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/buffer-vista.ts",
    "content": "import type { VistaBufferTag } from \"@/connector/vista\"\nimport { getVistaBufferCtags } from \"@/connector/vista\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { getCurrentFilePath } from \"@/system/file\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"  \"\n\nconst vistaBufferTagToArray = ({ lineNumber, kind, text, line }: VistaBufferTag) => [\n  lineNumber.toString(),\n  `[${kind}]`,\n  text,\n  line,\n]\n\nexport const vistaBufferCtags = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const tags = await getVistaBufferCtags()\n  const displayTextList = alignLists(\n    [...tags].sort((a, b) => a.lineNumber - b.lineNumber).map((tag) => vistaBufferTagToArray(tag))\n  ).map((tag) => tag.join(SPACER).trim())\n\n  const currentFile = await getCurrentFilePath()\n  const resourceLines: ResourceLines = tags.map((tag, i) => ({\n    data: {\n      command: \"FzfPreviewVistaBufferCtags\",\n      type: \"line\",\n      file: currentFile,\n      lineNumber: tag.lineNumber,\n      text: displayTextList[i],\n    },\n    displayText: `${displayTextList[i]}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = async () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} '${await getCurrentFilePath()}:{2}'\"`\n}\n\nexport const vistaBufferCtagsDefaultOptions = async (): Promise<FzfCommandDefinitionDefaultOption> => ({\n  \"--prompt\": '\"VistaBufferCtags> \"',\n  \"--multi\": true,\n  \"--preview\": await previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/buffers.ts",
    "content": "import { getAlternateBuffer, getCurrentBuffer, getOtherBuffers } from \"@/connector/buffers\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport { existsFileAsync, getCurrentPath } from \"@/system/file\"\nimport { readMruFile } from \"@/system/mr\"\nimport { filterProjectEnabledFile } from \"@/system/project\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs, VimBuffer } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\nimport { asyncFilter } from \"@/util/array\"\n\nconst bufferToArray = (buffer: VimBuffer) => {\n  if (buffer.isCurrent === true) {\n    return [`[${buffer.bufnr}] `, \"%\", `${buffer.isModified ? \" [+] \" : \"\"}`, ` ${buffer.fileName}`]\n  }\n\n  return [\n    `[${buffer.bufnr}] `,\n    `${buffer.isAlternate ? \"#\" : \"\"}`,\n    `${buffer.isModified ? \" [+] \" : \"\"}`,\n    ` ${buffer.fileName}`,\n  ]\n}\n\n// Colorize after align\n// If it contains ansi escape, it will not align well\nconst colorizeArrayedBuffer = (list: ReadonlyArray<string>): string => {\n  const [bufnr, symbol, modified, fileName] = list\n  if (symbol.includes(\"%\")) {\n    return list.join(\"\").trim()\n  } else {\n    return [colorize(bufnr, \"blue\"), symbol, colorize(modified, \"red\"), colorizeFile(fileName)].join(\"\").trim()\n  }\n}\n\nconst existsBuffer = async (buffer: VimBuffer): Promise<boolean> => {\n  return await existsFileAsync(buffer.fileName)\n}\n\nconst getSimpleBuffers = async (options?: { ignoreCurrentBuffer: boolean }) => {\n  const currentBuffer = await getCurrentBuffer()\n  const alternateBuffer = await getAlternateBuffer()\n  const otherBuffers = await getOtherBuffers()\n\n  if (options?.ignoreCurrentBuffer != null) {\n    return [alternateBuffer, ...otherBuffers]\n  }\n\n  return [currentBuffer, alternateBuffer, ...otherBuffers]\n}\n\nconst getGitProjectBuffers = async (options?: { ignoreCurrentBuffer: boolean }) => {\n  const currentBuffer = await getCurrentBuffer()\n  const alternateBuffer = await getAlternateBuffer()\n  const otherBuffers = await getOtherBuffers()\n  const currentPath = await getCurrentPath()\n\n  const mruFiles = await filterProjectEnabledFile(readMruFile(), currentPath)\n  const sortedBuffers = mruFiles\n    .map<VimBuffer | undefined>((file) => otherBuffers.find((buffer) => buffer.fileName === file))\n    .filter((buffer): buffer is VimBuffer => buffer != null)\n\n  if (options?.ignoreCurrentBuffer != null) {\n    return await asyncFilter(Array.from(new Set([alternateBuffer, ...sortedBuffers, ...otherBuffers])), (buffer) =>\n      existsBuffer(buffer)\n    )\n  }\n\n  return await asyncFilter(\n    Array.from(new Set([currentBuffer, alternateBuffer, ...sortedBuffers, ...otherBuffers])),\n    (buffer) => existsBuffer(buffer)\n  )\n}\n\nconst createBuffers = (bufferList: ReadonlyArray<VimBuffer>, displayLines: ReadonlyArray<string>): Resource => ({\n  type: \"json\",\n  lines: bufferList.map((buffer, i) => ({\n    data: {\n      command: \"FzfPreviewBuffers\",\n      type: \"buffer\",\n      file: buffer.fileName,\n      bufnr: buffer.bufnr,\n    },\n    displayText: displayLines[i],\n  })),\n})\n\nexport const buffers = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const bufferList = await getGitProjectBuffers()\n  const displayLines = alignLists(bufferList.map((buffer) => bufferToArray(buffer))).map((list) =>\n    colorizeArrayedBuffer(list)\n  )\n\n  return {\n    ...createBuffers(bufferList, displayLines),\n    ...{ options: { \"--header-lines\": (await existsBuffer(await getCurrentBuffer())) ? \"1\" : \"0\" } },\n  }\n}\n\nexport const fileFormatBuffers = async (_args: SourceFuncArgs): Promise<Resource> => {\n  // TODO: sort with mru\n  if (!(await isGitDirectory())) {\n    const bufferList = await getSimpleBuffers({ ignoreCurrentBuffer: true })\n    const displayLines = bufferList.map((buffer) => buffer.fileName)\n\n    return createBuffers(bufferList, displayLines)\n  }\n\n  const bufferList = await getGitProjectBuffers({ ignoreCurrentBuffer: true })\n  const displayLines = bufferList.map((buffer) => buffer.fileName)\n\n  return createBuffers(bufferList, displayLines)\n}\n\nexport const buffersDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Buffers> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/changes.ts",
    "content": "import { getChanges } from \"@/connector/changes\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { getCurrentFilePath } from \"@/system/file\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"  \"\n\nexport const changes = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const changeList = (await getChanges()).map((change) => {\n    const result = /^(?<lineNumber>\\d+)\\s(?<text>.*)/.exec(change)\n\n    if (result?.groups == null) {\n      throw new Error(`Changes line is invalid: \"${change}\"`)\n    }\n    const { lineNumber, text } = result.groups\n\n    return { lineNumber: Number(lineNumber), text }\n  })\n\n  const currentFile = await getCurrentFilePath()\n  const displayTextList = alignLists(changeList.map(({ lineNumber, text }) => [lineNumber.toString(), text])).map(\n    (change) => change.join(SPACER).trim()\n  )\n\n  const resourceLines: ResourceLines = changeList.map(({ lineNumber, text }, i) => {\n    return {\n      data: {\n        command: \"FzfPreviewChanges\",\n        type: \"line\",\n        file: currentFile,\n        text,\n        lineNumber,\n      },\n      displayText: displayTextList[i],\n    }\n  })\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = async () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} ${await getCurrentFilePath()}:{2..}\"`\n}\n\nexport const changesDefaultOptions = async (): Promise<FzfCommandDefinitionDefaultOption> => ({\n  \"--prompt\": '\"Changes> \"',\n  \"--multi\": true,\n  \"--preview\": await previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/coc-current-diagnostics.ts",
    "content": "import { getCurrentDiagnostics } from \"@/connector/coc\"\nimport { diagnosticToResourceLine } from \"@/fzf/resource/coc/coc-diagnostics\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const cocCurrentDiagnostics = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const diagnostics = await getCurrentDiagnostics()\n  const resourceLines: ResourceLines = diagnostics.map((diagnostic) => diagnosticToResourceLine(diagnostic))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const cocCurrentDiagnosticsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"CurrentDiagnostics> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/coc-definitions.ts",
    "content": "import { getDefinition } from \"@/connector/coc\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const cocDefinitions = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { definitions, symbol } = await getDefinition()\n  const resourceLines: ResourceLines = definitions.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewCocDefinition\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n    options: { \"--header\": `\"[Symbol] ${symbol}\"` },\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const cocDefinitionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Definitions> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/coc-diagnostics.ts",
    "content": "import { getDiagnostics } from \"@/connector/coc\"\nimport { diagnosticToDisplayText } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type {\n  Diagnostic,\n  FzfCommandDefinitionDefaultOption,\n  Resource,\n  ResourceLine,\n  ResourceLines,\n  SourceFuncArgs,\n} from \"@/type\"\n\nexport const diagnosticToResourceLine = (diagnostic: Diagnostic): ResourceLine => {\n  const { file, lineNumber, message } = diagnostic\n\n  return {\n    data: {\n      command: \"FzfPreviewCocDiagnostics\",\n      type: \"line\",\n      file,\n      lineNumber,\n      text: message,\n    },\n    displayText: diagnosticToDisplayText(diagnostic),\n  }\n}\n\nexport const cocDiagnostics = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const diagnostics = await getDiagnostics()\n  const resourceLines: ResourceLines = diagnostics.map((diagnostic) => diagnosticToResourceLine(diagnostic))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const cocDiagnosticsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Diagnostics> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/coc-implementations.ts",
    "content": "import { getImplementation } from \"@/connector/coc\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const cocImplementations = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { implementations, symbol } = await getImplementation()\n  const resourceLines: ResourceLines = implementations.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewCocImplementations\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n    options: { \"--header\": `\"[Symbol] ${symbol}\"` },\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const cocImplementationsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Implementations> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/coc-outline.ts",
    "content": "import { getOutline } from \"@/connector/coc\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst colorizeOutline = (list: ReadonlyArray<string>): string => {\n  const [file, lineNumber, kind, text] = list\n\n  return `${colorizeFile(file)}:${colorize(lineNumber, \"green\")} ${colorize(kind, \"red\")}${text}`\n}\n\nexport const cocOutline = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const outline = await getOutline()\n  const displayLines = alignLists(\n    outline.map(({ kind, label, file, lineNumber }) => [\n      `${file}`,\n      `${lineNumber.toString()}:`,\n      kind != null ? `[${kind}]` : \"\",\n      ` ${label.split(\"\\t\")[0]}`,\n    ])\n  ).map((line) => colorizeOutline(line))\n\n  const resourceLines: ResourceLines = outline.map(({ file, lineNumber, text }, i) => ({\n    data: {\n      command: \"FzfPreviewCocOutline\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: displayLines[i],\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const cocOutlineDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Outline> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n  \"--nth\": '\"4..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/coc-references.ts",
    "content": "import { getReferences } from \"@/connector/coc\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const cocReferences = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { references, symbol } = await getReferences()\n  const resourceLines: ResourceLines = references.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewCocReferences\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n    options: { \"--header\": `\"[Symbol] ${symbol}\"` },\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const cocReferencesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"References> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/coc-tsserver-source-definition.ts",
    "content": "import { getTsServerSourceDefinition } from \"@/connector/coc\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const cocTsServerSourceDefinition = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { sourceDefinitions, symbol } = await getTsServerSourceDefinition()\n\n  const resourceLines: ResourceLines = sourceDefinitions.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewCocTsServerSourceDefinition\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n    options: { \"--header\": `\"[Symbol] ${symbol}\"` },\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const cocTsServerSourceDefinitionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"SourceDefinitions> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/coc-type-definitions.ts",
    "content": "import { getTypeDefinition } from \"@/connector/coc\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const cocTypeDefinitions = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { typeDefinitions, symbol } = await getTypeDefinition()\n  const resourceLines: ResourceLines = typeDefinitions.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewCocTypeDefinition\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n    options: { \"--header\": `\"[Symbol] ${symbol}\"` },\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const cocTypeDefinitionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"TypeDefinitions> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/coc/index.ts",
    "content": "export * from \"@/fzf/resource/coc/coc-current-diagnostics\"\nexport * from \"@/fzf/resource/coc/coc-diagnostics\"\nexport * from \"@/fzf/resource/coc/coc-implementations\"\nexport * from \"@/fzf/resource/coc/coc-references\"\nexport * from \"@/fzf/resource/coc/coc-type-definitions\"\n"
  },
  {
    "path": "src/fzf/resource/command-palette.ts",
    "content": "import { getVimCommandHistory, getVimCommands } from \"@/connector/vim-command\"\nimport { colorize } from \"@/fzf/syntax/colorize\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\nimport { uniqWith } from \"@/util/uniq-with\"\n\nexport const commandPalette = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const commands = await getVimCommands()\n  const history = await getVimCommandHistory()\n\n  return {\n    type: \"json\",\n    lines: uniqWith([...history, ...commands], (a, b) => a.name === b.name).map((command) => ({\n      data: {\n        command: \"FzfPreviewCommandPalette\",\n        type: \"command-palette\",\n        name: command.name,\n      },\n      displayText:\n        command.number == null\n          ? `${colorize(\"Command\", \"cyan\")}: ${command.name}`\n          : `${colorize(\"History\", \"magenta\")} ${command.number}: ${command.name}`,\n    })),\n  }\n}\n\nexport const commandPaletteDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"CommandPalette> \"',\n  \"--header\": '\"C-e: Edit\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/ctags.ts",
    "content": "import { getCtags } from \"@/connector/tags\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\n\nexport const ctags = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const tagList = await getCtags()\n\n  return {\n    type: \"json\",\n    lines: tagList.map((tag) => ({\n      data: {\n        command: \"FzfPreviewCtags\",\n        type: \"line\",\n        file: tag.file,\n        text: `${tag.line} ${tag.name} ${tag.type} ${tag.file}`,\n        lineNumber: Number(tag.line),\n      },\n      displayText: `${tag.line} ${tag.name} ${tag.type} ${tag.file}`,\n    })),\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} '{-1}:{2}'\"`\n}\n\nexport const ctagsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Ctags> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"2..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/directory-files.ts",
    "content": "import { execDirectoryFiles } from \"@/connector/directory-files\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport type { FzfCommandDefinitionDefaultOption, FzfCommandDynamicOption, Resource, SourceFuncArgs } from \"@/type\"\n\nexport const directoryFiles = async ({ args }: SourceFuncArgs): Promise<Resource> => {\n  const arg = args[0] != null ? args[0] : \"\"\n  const lines = (await execDirectoryFiles(arg)).filter((file) => file !== \"\" && !file.includes(\" \"))\n  const options: FzfCommandDynamicOption | undefined = arg ? { \"--header\": `\"[Directory] ${arg}\"` } : undefined\n\n  return {\n    type: \"json\",\n    lines: lines.map((line) => ({\n      data: {\n        command: \"FzfPreviewDirectoryFiles\",\n        type: \"file\",\n        file: line,\n      },\n      displayText: colorizeFile(line),\n    })),\n    options,\n  }\n}\n\nexport const directoryFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"DirectoryFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/files-from-resources.ts",
    "content": "import type { FILE_RESOURCES } from \"@/const/fzf-option\"\nimport { fileFormatBuffers } from \"@/fzf/resource/buffers\"\nimport { directoryFiles } from \"@/fzf/resource/directory-files\"\nimport { gitFiles } from \"@/fzf/resource/git-files\"\nimport { mruFiles } from \"@/fzf/resource/mru\"\nimport { mrwFiles } from \"@/fzf/resource/mrw\"\nimport { oldFiles } from \"@/fzf/resource/oldfiles\"\nimport { projectFiles } from \"@/fzf/resource/project-files\"\nimport { projectMruFiles } from \"@/fzf/resource/project-mru\"\nimport { projectMrwFiles } from \"@/fzf/resource/project-mrw\"\nimport { projectOldFiles } from \"@/fzf/resource/project-oldfiles\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport type { FileData, FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { uniqWith } from \"@/util/uniq-with\"\n\ntype ResourceFunctions = {\n  [key in typeof FILE_RESOURCES[number]]: (args: SourceFuncArgs) => Promise<Resource>\n}\n\nconst resourceFunctions: ResourceFunctions = {\n  project: projectFiles,\n  git: gitFiles,\n  directory: directoryFiles,\n  buffer: fileFormatBuffers,\n  project_old: projectOldFiles,\n  project_mru: projectMruFiles,\n  project_mrw: projectMrwFiles,\n  old: oldFiles,\n  mru: mruFiles,\n  mrw: mrwFiles,\n}\n\nexport const filesFromResources = async (args: SourceFuncArgs): Promise<Resource> => {\n  const emptySourceFuncArgs = { args: [] }\n  let lines: ResourceLines = []\n\n  for (const resource of args.args) {\n    // eslint-disable-next-line no-await-in-loop\n    const filesFromResource = await resourceFunctions[resource as typeof FILE_RESOURCES[number]](emptySourceFuncArgs)\n    lines = [...lines, ...filesFromResource.lines]\n  }\n\n  const uniqLines = uniqWith(lines as Array<typeof lines[number]>, (line1, line2) => {\n    if (\n      (line1.data.type === \"file\" || line1.data.type === \"buffer\") &&\n      (line2.data.type === \"file\" || line2.data.type === \"buffer\")\n    ) {\n      return line1.data.file === line2.data.file\n    }\n\n    return true\n  })\n\n  return {\n    type: \"json\",\n    lines: uniqLines.map((line) => ({\n      data: {\n        command: \"FzfPreviewFromResources\",\n        type: \"file\",\n        file: (line.data as FileData).file,\n      },\n      displayText: colorizeFile((line.data as FileData).file),\n    })),\n    options: { \"--header\": `\"[Resources] ${args.args.join(\" \")}\"` },\n  }\n}\n\nexport const filesFromResourcesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"ResourceFrom> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/git-actions.ts",
    "content": "import { isGitDirectory } from \"@/connector/util\"\nimport { GIT_ACTIONS } from \"@/const/git\"\nimport { gitConfigSelector } from \"@/module/selector/git-config\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { getCurrentFilePath } from \"@/system/file\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\n\nconst createDisplayText = async (action: typeof GIT_ACTIONS[number]) => {\n  const noVerify = gitConfigSelector(\"noVerify\")\n\n  if (action === \"current-log\") {\n    return `${action}:${await getCurrentFilePath()}`\n  } else if (/^commit|^push/.exec(action) && noVerify) {\n    return `${action} --no-verify`\n  } else {\n    return action\n  }\n}\n\nexport const gitActions = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const displayTextList = await Promise.all(\n    GIT_ACTIONS.map(async (action) => {\n      return await createDisplayText(action)\n    })\n  )\n\n  return {\n    type: \"json\",\n    lines: GIT_ACTIONS.map((action, i) => ({\n      data: {\n        command: \"FzfPreviewGitActions\",\n        type: \"git-actions\",\n        action,\n      },\n      displayText: displayTextList[i],\n    })),\n  }\n}\n\nexport const gitActionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GitActions> \"',\n  \"--preview\": `\"${globalVariableSelector(\"fzfPreviewScriptDir\") as string}/git_actions_preview {2}\"`,\n  \"--preview-window\": '\"down:50%\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/git-branch-actions.ts",
    "content": "import { isGitDirectory } from \"@/connector/util\"\nimport { GIT_BRANCH_ACTIONS } from \"@/const/git\"\nimport { currentSessionSelector } from \"@/module/selector/session\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLine, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const gitBranchActions = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const currentSession = currentSessionSelector()\n  if (currentSession == null) {\n    throw new Error(\"Not exists current session\")\n  } else if (currentSession.gitBranches == null) {\n    throw new Error(\"Branch is not exists in current session\")\n  }\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const branches = currentSession.gitBranches\n  const headers: ResourceLines = [\n    {\n      data: {\n        command: \"FzfPreviewGitBranchActions\",\n        type: \"git-branch-actions\",\n        action: \"header\",\n        branches: [],\n      },\n      displayText: \"<: Back to git branch\",\n    },\n    {\n      data: {\n        command: \"FzfPreviewGitBranchActions\",\n        type: \"git-branch-actions\",\n        action: \"header\",\n        branches: [],\n      },\n      displayText: `Selected branch: ${branches.map((branch) => branch.name).join(\" \")}`,\n    },\n  ]\n\n  const lines = [\n    ...headers,\n    ...GIT_BRANCH_ACTIONS.map<ResourceLine>((action) => ({\n      data: {\n        command: \"FzfPreviewGitBranchActions\",\n        type: \"git-branch-actions\",\n        action,\n        branches: branches.map((branch) => branch.name),\n      },\n      displayText: action,\n    })),\n  ]\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nexport const gitBranchActionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GitBranchActions> \"',\n  \"--header-lines\": \"2\",\n})\n"
  },
  {
    "path": "src/fzf/resource/git-branches.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execGitBranch } from \"@/connector/git\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { GIT_BRANCH_PREVIEW_COMMAND } from \"@/const/git\"\nimport { colorize } from \"@/fzf/syntax/colorize\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLine, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"    \"\n\nexport const gitBranches = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const branches = await execGitBranch()\n  const displayLines = alignLists(branches.map(({ name, date, author }) => [name, date, author])).map((list) =>\n    list.join(SPACER).trim()\n  )\n\n  const extraActions: ResourceLines = [\n    {\n      data: {\n        command: \"FzfPreviewGitBranches\",\n        type: \"git-branch\",\n        name: \"\",\n        date: \"\",\n        author: \"\",\n        isCreate: true,\n      },\n      displayText: colorize(\"\\xA0\\xA0Create branch\", \"green\"),\n    },\n  ]\n\n  const lines = [\n    ...branches.map<ResourceLine>(({ name, date, author }, i) => ({\n      data: {\n        command: \"FzfPreviewGitBranches\",\n        type: \"git-branch\",\n        name: stripAnsi(name).replace(\"* \", \"\").trim(),\n        date: stripAnsi(date).trim(),\n        author: stripAnsi(author).trim(),\n        isCreate: false,\n      },\n      displayText: displayLines[i],\n    })),\n    ...extraActions,\n  ]\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nexport const gitBranchesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--multi\": true,\n  \"--header\": '\"Enter: switch, C-s: git status, <: Back actions, >: Select action\"',\n  \"--prompt\": '\"GitBranch> \"',\n  \"--preview\": `\"${GIT_BRANCH_PREVIEW_COMMAND}\"`,\n  \"--preview-window\": '\"down:50%\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/git-files.ts",
    "content": "import { execGitFiles } from \"@/connector/git\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\n\nexport const gitFiles = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const lines = (await execGitFiles()).filter((file) => file !== \"\" && !file.includes(\" \"))\n\n  return {\n    type: \"json\",\n    lines: lines.map((line) => ({\n      data: {\n        command: \"FzfPreviewGitFiles\",\n        type: \"file\",\n        file: line,\n      },\n      displayText: colorizeFile(line),\n    })),\n  }\n}\n\nexport const gitFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GitFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/git-log-actions.ts",
    "content": "import { isGitDirectory } from \"@/connector/util\"\nimport { GIT_LOG_ACTIONS } from \"@/const/git\"\nimport { currentSessionSelector } from \"@/module/selector/session\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLine, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const gitLogActions = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const currentSession = currentSessionSelector()\n  if (currentSession == null) {\n    throw new Error(\"Not exists current session\")\n  } else if (currentSession.gitLogs == null) {\n    throw new Error(\"Logs is not exists in current session\")\n  }\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const logs = currentSession.gitLogs\n  const headers: ResourceLines = [\n    {\n      data: {\n        command: \"FzfPreviewGitLogActions\",\n        type: \"git-log-actions\",\n        action: \"header\",\n        hashes: [],\n        isCurrentFile: false,\n      },\n      displayText: \"<: Back to git log\",\n    },\n    {\n      data: {\n        command: \"FzfPreviewGitLogActions\",\n        type: \"git-log-actions\",\n        action: \"header\",\n        hashes: [],\n        isCurrentFile: false,\n      },\n      displayText: `Selected log: ${logs.map((log) => log.hash).join(\" \")}`,\n    },\n  ]\n\n  const lines = [\n    ...headers,\n    ...GIT_LOG_ACTIONS.map<ResourceLine>((action) => ({\n      data: {\n        command: \"FzfPreviewGitLogActions\",\n        type: \"git-log-actions\",\n        action,\n        hashes: logs.map((log) => log.hash),\n        isCurrentFile: logs[0].isCurrentFile,\n      },\n      displayText: action,\n    })),\n  ]\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nexport const gitLogActionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GitLogActions> \"',\n  \"--header-lines\": \"2\",\n})\n"
  },
  {
    "path": "src/fzf/resource/git-logs.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execGitLog } from \"@/connector/git\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { GIT_LOG_PREVIEW_COMMAND } from \"@/const/git\"\nimport type { FzfCommandDefinitionDefaultOption, GitLog, Resource, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"    \"\n\nconst createResource = (logs: ReadonlyArray<GitLog>, isCurrentFile: boolean): Resource => {\n  const displayLines = alignLists(logs.map(({ hash, date, author, comment }) => [hash, date, author, comment])).map(\n    (list) => list.join(SPACER).trim()\n  )\n\n  return {\n    type: \"json\",\n    lines: logs.map(({ hash, date, author, comment }, i) => ({\n      data: {\n        command: \"FzfPreviewGitLogs\",\n        type: \"git-log\",\n        hash: stripAnsi(hash).trim(),\n        date: stripAnsi(date).trim(),\n        author: stripAnsi(author).trim(),\n        comment: stripAnsi(comment).trim(),\n        isCurrentFile,\n      },\n      displayText: displayLines[i],\n    })),\n  }\n}\n\nexport const gitLogs = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const logs = await execGitLog()\n\n  return createResource(logs, false)\n}\n\nexport const gitCurrentLogs = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const logs = await execGitLog({ currentFile: true })\n\n  return createResource(logs, true)\n}\n\nexport const gitLogsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--multi\": true,\n  \"--header\": '\"Enter: git show, C-s: git status, <: Back actions, >: Select action\"',\n  \"--prompt\": '\"GitLog> \"',\n  \"--preview\": `\"${GIT_LOG_PREVIEW_COMMAND}\"`,\n  \"--preview-window\": '\"down:50%\"',\n})\n\nexport const gitCurrentLogsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--multi\": true,\n  \"--header\": '\"Enter: git show, C-s: git status, <: Back actions, >: Select action\"',\n  \"--prompt\": '\"GitCurrentLog> \"',\n  \"--preview\": `\"${GIT_LOG_PREVIEW_COMMAND}\"`,\n  \"--preview-window\": '\"down:50%\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/git-reflog-actions.ts",
    "content": "import { isGitDirectory } from \"@/connector/util\"\nimport { GIT_REFLOG_ACTIONS } from \"@/const/git\"\nimport { currentSessionSelector } from \"@/module/selector/session\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLine, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const gitReflogActions = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const currentSession = currentSessionSelector()\n  if (currentSession == null) {\n    throw new Error(\"Not exists current session\")\n  } else if (currentSession.gitReflogs == null) {\n    throw new Error(\"Reflogs is not exists in current session\")\n  }\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const reflogs = currentSession.gitReflogs\n  const headers: ResourceLines = [\n    {\n      data: {\n        command: \"FzfPreviewGitReflogActions\",\n        type: \"git-reflog-actions\",\n        action: \"header\",\n        names: [],\n        hashes: [],\n      },\n      displayText: \"<: Back to git reflog\",\n    },\n    {\n      data: {\n        command: \"FzfPreviewGitReflogActions\",\n        type: \"git-reflog-actions\",\n        action: \"header\",\n        names: [],\n        hashes: [],\n      },\n      displayText: `Selected reflog: ${reflogs.map((reflog) => reflog.name).join(\" \")}`,\n    },\n  ]\n\n  const lines = [\n    ...headers,\n    ...GIT_REFLOG_ACTIONS.map<ResourceLine>((action) => ({\n      data: {\n        command: \"FzfPreviewGitReflogActions\",\n        type: \"git-reflog-actions\",\n        action,\n        names: reflogs.map((reflog) => reflog.name),\n        hashes: reflogs.map((reflog) => reflog.hash),\n      },\n      displayText: action,\n    })),\n  ]\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nexport const gitReflogActionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GitReflogActions> \"',\n  \"--header-lines\": \"2\",\n})\n"
  },
  {
    "path": "src/fzf/resource/git-reflogs.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execGitReflog } from \"@/connector/git\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { GIT_REFLOG_PREVIEW_COMMAND } from \"@/const/git\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"    \"\n\nexport const gitReflogs = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const reflogs = await execGitReflog()\n  const displayLines = alignLists(\n    reflogs.map(({ name, hash, date, author, comment }) => [name, hash, date, author, comment])\n  ).map((list) => list.join(SPACER).trim())\n\n  return {\n    type: \"json\",\n    lines: reflogs.map(({ name, hash, date, author, comment }, i) => ({\n      data: {\n        command: \"FzfPreviewGitReflogs\",\n        type: \"git-reflog\",\n        name: stripAnsi(name).trim(),\n        hash: stripAnsi(hash).trim(),\n        date: stripAnsi(date).trim(),\n        author: stripAnsi(author).trim(),\n        comment: stripAnsi(comment).trim(),\n      },\n      displayText: displayLines[i],\n    })),\n  }\n}\n\nexport const gitReflogsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--multi\": true,\n  \"--header\": '\"Enter: git show, C-s: git status, <: Back actions, >: Select action\"',\n  \"--prompt\": '\"GitReflog> \"',\n  \"--preview\": `\"${GIT_REFLOG_PREVIEW_COMMAND}\"`,\n  \"--preview-window\": '\"down:50%\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/git-stash-actions.ts",
    "content": "import { isGitDirectory } from \"@/connector/util\"\nimport { GIT_STASH_ACTIONS } from \"@/const/git\"\nimport { currentSessionSelector } from \"@/module/selector/session\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLine, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const gitStashActions = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const currentSession = currentSessionSelector()\n  if (currentSession == null) {\n    throw new Error(\"Not exists current session\")\n  } else if (currentSession.gitStashes == null) {\n    throw new Error(\"Stashes is not exists in current session\")\n  }\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const stashes = currentSession.gitStashes\n  const headers: ResourceLines = [\n    {\n      data: {\n        command: \"FzfPreviewGitStashActions\",\n        type: \"git-stash-actions\",\n        action: \"header\",\n        names: [],\n        hashes: [],\n      },\n      displayText: \"<: Back to git stash\",\n    },\n    {\n      data: {\n        command: \"FzfPreviewGitStashActions\",\n        type: \"git-stash-actions\",\n        action: \"header\",\n        names: [],\n        hashes: [],\n      },\n      displayText: `Selected stash: ${stashes.map((stash) => stash.name).join(\" \")}`,\n    },\n  ]\n\n  const lines = [\n    ...headers,\n    ...GIT_STASH_ACTIONS.map<ResourceLine>((action) => ({\n      data: {\n        command: \"FzfPreviewGitStashActions\",\n        type: \"git-stash-actions\",\n        action,\n        names: stashes.map((stash) => stash.name),\n        hashes: stashes.map((stash) => stash.hash),\n      },\n      displayText: action,\n    })),\n  ]\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nexport const gitStashActionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GitStashActions> \"',\n  \"--header-lines\": \"2\",\n})\n"
  },
  {
    "path": "src/fzf/resource/git-stashes.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execGitStash } from \"@/connector/git\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { GIT_STASH_PREVIEW_COMMAND } from \"@/const/git\"\nimport { colorize } from \"@/fzf/syntax/colorize\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLine, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"    \"\n\nexport const gitStashes = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const stashes = await execGitStash()\n  const displayLines = alignLists(\n    stashes.map(({ name, hash, date, author, comment }) => [name, hash, date, author, comment])\n  ).map((list) => list.join(SPACER).trim())\n\n  const extraActions: ResourceLines = [\n    {\n      data: {\n        command: \"FzfPreviewGitStashes\",\n        type: \"git-stash\",\n        name: \"\",\n        hash: \"\",\n        date: \"\",\n        author: \"\",\n        comment: \"\",\n        isCreate: true,\n      },\n      displayText: colorize(\"Create stash\", \"green\"),\n    },\n  ]\n\n  const lines = [\n    ...stashes.map<ResourceLine>(({ name, hash, date, author, comment }, i) => ({\n      data: {\n        command: \"FzfPreviewGitStashes\",\n        type: \"git-stash\",\n        name: stripAnsi(name).trim(),\n        hash: stripAnsi(hash).trim(),\n        date: stripAnsi(date).trim(),\n        author: stripAnsi(author).trim(),\n        comment: stripAnsi(comment).trim(),\n        isCreate: false,\n      },\n      displayText: displayLines[i],\n    })),\n    ...extraActions,\n  ]\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nexport const gitStashesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--multi\": true,\n  \"--header\": '\"Enter: git show, C-s: git status, <: Back actions, >: Select action\"',\n  \"--prompt\": '\"GitStash> \"',\n  \"--preview\": `\"${GIT_STASH_PREVIEW_COMMAND}\"`,\n  \"--preview-window\": '\"down:50%\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/git-status-actions.ts",
    "content": "import { isGitDirectory } from \"@/connector/util\"\nimport { GIT_STATUS_ACTIONS } from \"@/const/git\"\nimport { currentSessionSelector } from \"@/module/selector/session\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLine, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const gitStatusActions = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const currentSession = currentSessionSelector()\n  if (currentSession == null) {\n    throw new Error(\"Not exists current session\")\n  } else if (currentSession.gitStatusDataList == null) {\n    throw new Error(\"Selected git status file is not exists in current session\")\n  }\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const statusDataList = currentSession.gitStatusDataList\n  const headers: ResourceLines = [\n    {\n      data: {\n        command: \"FzfPreviewGitStatusActions\",\n        type: \"git-status-actions\",\n        action: \"header\",\n        files: [],\n      },\n      displayText: \"<: Back to git status\",\n    },\n    {\n      data: {\n        command: \"FzfPreviewGitStatusActions\",\n        type: \"git-status-actions\",\n        action: \"header\",\n        files: [],\n      },\n      displayText: `Selected file: ${statusDataList.map((data) => data.file).join(\" \")}`,\n    },\n  ]\n\n  const lines = [\n    ...headers,\n    ...GIT_STATUS_ACTIONS.map<ResourceLine>((action) => ({\n      data: {\n        command: \"FzfPreviewGitStatusActions\",\n        type: \"git-status-actions\",\n        action,\n        files: statusDataList.map((data) => data.file),\n      },\n      displayText: action,\n    })),\n  ]\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nexport const gitStatusActionsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GitStatusActions> \"',\n  \"--header-lines\": \"2\",\n})\n"
  },
  {
    "path": "src/fzf/resource/git-status.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execGitStatus } from \"@/connector/git\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLine, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const gitStatus = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const statuses = await execGitStatus()\n  const headers: ResourceLines = [\n    {\n      data: {\n        command: \"FzfPreviewGitStatus\",\n        type: \"git-status\",\n        action: \"header\",\n        file: \"\",\n        status: \"\",\n      },\n      displayText: \"C-a: git add, C-r: git reset, C-c: git commit\",\n    },\n    {\n      data: {\n        command: \"FzfPreviewGitStatus\",\n        type: \"git-status\",\n        action: \"header\",\n        file: \"\",\n        status: \"\",\n      },\n      displayText: \"<: Back actions, >: Select action\",\n    },\n  ]\n\n  const lines = [\n    ...headers,\n    ...statuses.map<ResourceLine>(({ file, status }) => {\n      return {\n        data: {\n          command: \"FzfPreviewGitStatus\",\n          type: \"git-status\",\n          file,\n          status: stripAnsi(status),\n        },\n        displayText: `${status.replace(/^\\s/, \"\\xA0\")} ${colorizeFile(file)}`,\n      }\n    }),\n  ]\n\n  return {\n    type: \"json\",\n    lines,\n  }\n}\n\nexport const gitStatusDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GitStatus> \"',\n  \"--multi\": true,\n  \"--preview\": `'${globalVariableSelector(\"fzfPreviewGitStatusPreviewCommand\") as string}'`,\n  \"--keep-right\": true,\n  \"--header-lines\": \"2\",\n})\n"
  },
  {
    "path": "src/fzf/resource/grep.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execGrep } from \"@/connector/grep\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\n\nexport const projectGrep = async (args: SourceFuncArgs): Promise<Resource> => {\n  const grepArgs = args.args.join(\" \")\n  const lines = await execGrep(grepArgs)\n\n  return {\n    type: \"json\",\n    lines: lines.map((line) => {\n      const [file, lineNumber, ...rest] = line.split(\":\")\n\n      return {\n        data: {\n          command: \"FzfPreviewProjectGrep\",\n          type: \"line\",\n          file: stripAnsi(file),\n          lineNumber: Number(stripAnsi(lineNumber)),\n          text: stripAnsi(rest.join(\":\")),\n        },\n        displayText: `${colorizeFile(file)}:${colorize(lineNumber, \"green\")}: ${rest.join(\":\")}`,\n      }\n    }),\n    options: { \"--header\": `'[Grep from] ${grepArgs}'` },\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const projectGrepDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"ProjectGrep> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/index.ts",
    "content": "export * from \"@/fzf/resource/all-buffers\"\nexport * from \"@/fzf/resource/blame-pr\"\nexport * from \"@/fzf/resource/bookmarks\"\nexport * from \"@/fzf/resource/buffer-lines\"\nexport * from \"@/fzf/resource/buffer-tags\"\nexport * from \"@/fzf/resource/buffer-vista\"\nexport * from \"@/fzf/resource/buffers\"\nexport * from \"@/fzf/resource/changes\"\nexport * from \"@/fzf/resource/command-palette\"\nexport * from \"@/fzf/resource/ctags\"\nexport * from \"@/fzf/resource/directory-files\"\nexport * from \"@/fzf/resource/files-from-resources\"\nexport * from \"@/fzf/resource/git-actions\"\nexport * from \"@/fzf/resource/git-branch-actions\"\nexport * from \"@/fzf/resource/git-branches\"\nexport * from \"@/fzf/resource/git-files\"\nexport * from \"@/fzf/resource/git-log-actions\"\nexport * from \"@/fzf/resource/git-logs\"\nexport * from \"@/fzf/resource/git-reflog-actions\"\nexport * from \"@/fzf/resource/git-reflogs\"\nexport * from \"@/fzf/resource/git-stash-actions\"\nexport * from \"@/fzf/resource/git-stashes\"\nexport * from \"@/fzf/resource/git-status\"\nexport * from \"@/fzf/resource/git-status-actions\"\nexport * from \"@/fzf/resource/grep\"\nexport * from \"@/fzf/resource/jumps\"\nexport * from \"@/fzf/resource/lines\"\nexport * from \"@/fzf/resource/locationlist\"\nexport * from \"@/fzf/resource/marks\"\nexport * from \"@/fzf/resource/memolist\"\nexport * from \"@/fzf/resource/memolist-grep\"\nexport * from \"@/fzf/resource/mru\"\nexport * from \"@/fzf/resource/mrw\"\nexport * from \"@/fzf/resource/oldfiles\"\nexport * from \"@/fzf/resource/project-files\"\nexport * from \"@/fzf/resource/project-mru\"\nexport * from \"@/fzf/resource/project-mrw\"\nexport * from \"@/fzf/resource/project-oldfiles\"\nexport * from \"@/fzf/resource/quickfix\"\nexport * from \"@/fzf/resource/vista\"\nexport * from \"@/fzf/resource/yankround\"\n"
  },
  {
    "path": "src/fzf/resource/jumps.ts",
    "content": "import { getJumps } from \"@/connector/jumps\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const jumps = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const resourceLines: ResourceLines = (await getJumps()).map(({ file, line, text }) => {\n    return {\n      data: {\n        command: \"FzfPreviewJumps\",\n        type: \"line\",\n        file,\n        text,\n        lineNumber: Number(line),\n      },\n      displayText: `${colorizeFile(file)}:${colorize(line, \"green\")}:${text}`,\n    }\n  })\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const jumpsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Jumps> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/lines.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execLines } from \"@/connector/lines\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { existsFileAsync, getCurrentFilePath } from \"@/system/file\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\n\nexport const lines = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const currentFile = await getCurrentFilePath()\n  if (!(await existsFileAsync(currentFile))) {\n    return {\n      type: \"json\",\n      lines: [],\n    }\n  }\n\n  const lineList = await execLines(currentFile)\n\n  return {\n    type: \"json\",\n    lines: lineList.map((line) => {\n      const result = /^\\s*(?<lineNumber>\\d+)\\s(?<text>.*)/.exec(stripAnsi(line))\n      if (result?.groups == null) {\n        throw new Error(`Unexpected line format: ${line}`)\n      }\n\n      return {\n        data: {\n          command: \"FzfPreviewLines\",\n          type: \"line\",\n          file: currentFile,\n          text: result.groups.text,\n          lineNumber: Number(result.groups.lineNumber),\n        },\n        displayText: line,\n      }\n    }),\n  }\n}\n\nconst previewCommand = async () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} ${await getCurrentFilePath()}:{2}\"`\n}\n\nexport const linesDefaultOptions = async (): Promise<FzfCommandDefinitionDefaultOption> => ({\n  \"--prompt\": '\"Lines> \"',\n  \"--multi\": true,\n  \"--preview\": await previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/locationlist.ts",
    "content": "import { getLocationList } from \"@/connector/quickfix-and-locationlist\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { parseQuickFixAndLocationListLine } from \"@/fzf/util\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const locationList = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const resourceLines: ResourceLines = (await getLocationList()).map((line) => {\n    const { fileName, lineNumber, text } = parseQuickFixAndLocationListLine(line)\n\n    return {\n      data: {\n        command: \"FzfPreviewLocationList\",\n        type: \"line\",\n        file: fileName,\n        text,\n        lineNumber,\n      },\n      displayText: `${colorizeFile(fileName)}:${colorize(lineNumber.toString(), \"green\")}:${text}`,\n    }\n  })\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const locationListDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"LocationList> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/marks.ts",
    "content": "import { getMarks } from \"@/connector/marks\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const marks = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const resourceLines: ResourceLines = (await getMarks()).map(({ file, line, text }) => ({\n    data: {\n      command: \"FzfPreviewMarks\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber: Number(line),\n    },\n    displayText: `${colorizeFile(file)}:${colorize(line, \"green\")}:${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const marksDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Marks> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/memolist-grep.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execMemoListGrep } from \"@/connector/memolist\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\n\nexport const memoListGrep = async (args: SourceFuncArgs): Promise<Resource> => {\n  const grepArgs = args.args.join(\" \")\n  const lines = await execMemoListGrep(grepArgs)\n\n  return {\n    type: \"json\",\n    lines: lines.map((line) => {\n      const [file, lineNumber, ...rest] = line.split(\":\")\n\n      return {\n        data: {\n          command: \"FzfPreviewProjectGrep\",\n          type: \"line\",\n          file: stripAnsi(file),\n          lineNumber: Number(stripAnsi(lineNumber)),\n          text: stripAnsi(rest.join(\":\")),\n        },\n        displayText: `${colorizeFile(file)}:${colorize(lineNumber, \"green\")}: ${rest.join(\":\")}`,\n      }\n    }),\n    options: { \"--header\": `'[Grep from] ${grepArgs}'` },\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const memoListGrepDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"MemoListGrep> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/memolist.ts",
    "content": "import { execMemoListFiles } from \"@/connector/memolist\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport type { FzfCommandDefinitionDefaultOption, Resource } from \"@/type\"\n\nexport const memoList = async (): Promise<Resource> => {\n  const lines = await execMemoListFiles()\n\n  return {\n    type: \"json\",\n    lines: lines.map((line) => ({\n      data: {\n        command: \"FzfPreviewMemoList\",\n        type: \"file\",\n        file: line,\n      },\n      displayText: colorizeFile(line),\n    })),\n  }\n}\n\nexport const memoListDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"MemoList> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/mru.ts",
    "content": "import { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport { existsFileAsync } from \"@/system/file\"\nimport { readMruFile } from \"@/system/mr\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { asyncFilter } from \"@/util/array\"\n\nexport const mruFiles = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const files = readMruFile()\n  const existsFiles = await asyncFilter(files, (file) => existsFileAsync(file))\n\n  const resourceLines: ResourceLines = existsFiles.map((file) => ({\n    data: {\n      command: \"FzfPreviewMruFiles\",\n      type: \"file\",\n      file,\n    },\n    displayText: colorizeFile(file),\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nexport const mruFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"MruFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/mrw.ts",
    "content": "import { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport { existsFileAsync } from \"@/system/file\"\nimport { readMrwFile } from \"@/system/mr\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { asyncFilter } from \"@/util/array\"\n\nexport const mrwFiles = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const files = readMrwFile()\n  const existsFiles = await asyncFilter(files, (file) => existsFileAsync(file))\n\n  const resourceLines: ResourceLines = existsFiles.map((file) => ({\n    data: {\n      command: \"FzfPreviewMrwFiles\",\n      type: \"file\",\n      file,\n    },\n    displayText: colorizeFile(file),\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nexport const mrwFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"MrwFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/nvim-lsp-current-diagnostics.ts",
    "content": "import { getCurrentDiagnostics } from \"@/connector/nvim-lsp\"\nimport { diagnosticToDisplayText } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type {\n  Diagnostic,\n  FzfCommandDefinitionDefaultOption,\n  Resource,\n  ResourceLine,\n  ResourceLines,\n  SourceFuncArgs,\n} from \"@/type\"\n\nexport const diagnosticToResourceLine = (diagnostic: Diagnostic): ResourceLine => {\n  const { file, lineNumber, message } = diagnostic\n\n  return {\n    data: {\n      command: \"FzfPreviewNvimLspCurrentDiagnostics\",\n      type: \"line\",\n      file,\n      lineNumber,\n      text: message,\n    },\n    displayText: diagnosticToDisplayText(diagnostic),\n  }\n}\n\nexport const nvimLspCurrentDiagnostics = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { diagnostics } = await getCurrentDiagnostics()\n  const resourceLines: ResourceLines = diagnostics.map((diagnostic) => diagnosticToResourceLine(diagnostic))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const nvimLspCurrentDiagnosticsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"CurrentDiagnostics> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/nvim-lsp-definition.ts",
    "content": "import { getDefinition } from \"@/connector/nvim-lsp\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const nvimLspDefinition = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { definition } = await getDefinition()\n  const resourceLines: ResourceLines = definition.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewNvimLspDefinition\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const nvimLspDefinitionDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Definition> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/nvim-lsp-diagnostics.ts",
    "content": "import { getDiagnostics } from \"@/connector/nvim-lsp\"\nimport { diagnosticToDisplayText } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type {\n  Diagnostic,\n  FzfCommandDefinitionDefaultOption,\n  Resource,\n  ResourceLine,\n  ResourceLines,\n  SourceFuncArgs,\n} from \"@/type\"\n\nexport const diagnosticToResourceLine = (diagnostic: Diagnostic): ResourceLine => {\n  const { file, lineNumber, message } = diagnostic\n\n  return {\n    data: {\n      command: \"FzfPreviewNvimLspDiagnostics\",\n      type: \"line\",\n      file,\n      lineNumber,\n      text: message,\n    },\n    displayText: diagnosticToDisplayText(diagnostic),\n  }\n}\n\nexport const nvimLspDiagnostics = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { diagnostics } = await getDiagnostics()\n  const resourceLines: ResourceLines = diagnostics.map((diagnostic) => diagnosticToResourceLine(diagnostic))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const nvimLspDiagnosticsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Diagnostics> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/nvim-lsp-implementation.ts",
    "content": "import { getImplementation } from \"@/connector/nvim-lsp\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const nvimLspImplementation = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { implementations } = await getImplementation()\n  const resourceLines: ResourceLines = implementations.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewNvimLspImplementation\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const nvimLspImplementationDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Implementation> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/nvim-lsp-references.ts",
    "content": "import { getReferences } from \"@/connector/nvim-lsp\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const nvimLspReferences = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { references } = await getReferences()\n  const resourceLines: ResourceLines = references.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewNvimLspReferences\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const nvimLspReferencesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"References> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/nvim-lsp-type-definition.ts",
    "content": "import { getTypeDefinition } from \"@/connector/nvim-lsp\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const nvimLspTypeDefinition = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { typeDefinition } = await getTypeDefinition()\n  const resourceLines: ResourceLines = typeDefinition.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewNvimLspTypeDefinition\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const nvimLspTypeDefinitionDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"TypeDefinition> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/oldfiles.ts",
    "content": "import { getOldFiles } from \"@/connector/old-files\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport { existsFileAsync } from \"@/system/file\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { asyncFilter } from \"@/util/array\"\n\nexport const oldFiles = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const files = await getOldFiles()\n  const existsFiles = await asyncFilter(files, (file) => existsFileAsync(file))\n\n  const resourceLines: ResourceLines = existsFiles.map((file) => ({\n    data: {\n      command: \"FzfPreviewOldFiles\",\n      type: \"file\",\n      file,\n    },\n    displayText: colorizeFile(file),\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nexport const oldFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"OldFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/project-files.ts",
    "content": "import { execProjectFiles } from \"@/connector/project-files\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\n\nexport const projectFiles = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const lines = (await execProjectFiles()).filter((file) => file !== \"\" && !file.includes(\" \"))\n\n  return {\n    type: \"json\",\n    lines: lines.map((line) => ({\n      data: {\n        command: \"FzfPreviewProjectFiles\",\n        type: \"file\",\n        file: line,\n      },\n      displayText: colorizeFile(line),\n    })),\n  }\n}\n\nexport const projectFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"ProjectFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/project-mru.ts",
    "content": "import { isGitDirectory } from \"@/connector/util\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport { getCurrentFilePath, getCurrentPath } from \"@/system/file\"\nimport { readMruFile } from \"@/system/mr\"\nimport { filterProjectEnabledFile } from \"@/system/project\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const projectMruFiles = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const currentFile = await getCurrentFilePath()\n  const currentPath = await getCurrentPath()\n\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const files = await filterProjectEnabledFile(\n    readMruFile().filter((file) => file !== currentFile),\n    currentPath\n  )\n  const resourceLines: ResourceLines = files.map((file) => ({\n    data: {\n      command: \"FzfPreviewProjectMruFiles\",\n      type: \"file\",\n      file,\n    },\n    displayText: colorizeFile(file),\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nexport const projectMruFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"ProjectMruFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/project-mrw.ts",
    "content": "import { isGitDirectory } from \"@/connector/util\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport { getCurrentFilePath, getCurrentPath } from \"@/system/file\"\nimport { readMrwFile } from \"@/system/mr\"\nimport { filterProjectEnabledFile } from \"@/system/project\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const projectMrwFiles = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const currentFile = await getCurrentFilePath()\n  const currentPath = await getCurrentPath()\n  const files = await filterProjectEnabledFile(\n    readMrwFile().filter((file) => file !== currentFile),\n    currentPath\n  )\n  const resourceLines: ResourceLines = files.map((file) => ({\n    data: {\n      command: \"FzfPreviewProjectMrwFiles\",\n      type: \"file\",\n      file,\n    },\n    displayText: colorizeFile(file),\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nexport const projectMrwFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"ProjectMrwFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/project-oldfiles.ts",
    "content": "import { getOldFiles } from \"@/connector/old-files\"\nimport { isGitDirectory } from \"@/connector/util\"\nimport { colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { filePreviewCommand } from \"@/fzf/util\"\nimport { getCurrentPath } from \"@/system/file\"\nimport { filterProjectEnabledFile } from \"@/system/project\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const projectOldFiles = async (_args: SourceFuncArgs): Promise<Resource> => {\n  if (!(await isGitDirectory())) {\n    throw new Error(\"The current directory is not a git project\")\n  }\n\n  const currentPath = await getCurrentPath()\n  const files = await filterProjectEnabledFile(await getOldFiles(), currentPath)\n  const resourceLines: ResourceLines = files.map((file) => ({\n    data: {\n      command: \"FzfPreviewProjectOldFiles\",\n      type: \"file\",\n      file,\n    },\n    displayText: colorizeFile(file),\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nexport const projectOldFilesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"ProjectOldFiles> \"',\n  \"--multi\": true,\n  \"--preview\": filePreviewCommand(),\n  \"--keep-right\": true,\n})\n"
  },
  {
    "path": "src/fzf/resource/quickfix.ts",
    "content": "import { getQuickFix } from \"@/connector/quickfix-and-locationlist\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { parseQuickFixAndLocationListLine } from \"@/fzf/util\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const quickFix = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const resourceLines: ResourceLines = (await getQuickFix()).map((line) => {\n    const { fileName, lineNumber, text } = parseQuickFixAndLocationListLine(line)\n\n    return {\n      data: {\n        command: \"FzfPreviewQuickFix\",\n        type: \"line\",\n        file: fileName,\n        text,\n        lineNumber,\n      },\n      displayText: `${colorizeFile(fileName)}:${colorize(lineNumber.toString(), \"green\")}:${text}`,\n    }\n  })\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const quickFixDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"QuickFix> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/todo-comments.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execSearchTodoComments } from \"@/connector/todo-comments\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource } from \"@/type\"\n\nexport const todoComments = async (): Promise<Resource> => {\n  const lines = await execSearchTodoComments()\n\n  return {\n    type: \"json\",\n    lines: lines.map((line) => {\n      const [file, lineNumber, ...rest] = line.split(\":\")\n\n      return {\n        data: {\n          command: \"FzfPreviewTodoComments\",\n          type: \"line\",\n          file: stripAnsi(file),\n          lineNumber: Number(stripAnsi(lineNumber)),\n          text: stripAnsi(rest.join(\":\")),\n        },\n        displayText: `${colorizeFile(file)}:${colorize(lineNumber, \"green\")}: ${rest.join(\":\")}`,\n      }\n    }),\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const todoCommentsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"TodoComments> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/vim-help.ts",
    "content": "import stripAnsi from \"strip-ansi\"\n\nimport { execHelpTags } from \"@/connector/vim-help\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { collapseHome } from \"@/system/file\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, SourceFuncArgs } from \"@/type\"\n\nexport const grepHelp = async (args: SourceFuncArgs): Promise<Resource> => {\n  const helpTagsArgs = args.args.length > 0 ? args.args.join(\" \") : \".\"\n  const lines = await execHelpTags(helpTagsArgs)\n\n  return {\n    type: \"json\",\n    lines: lines.map((line) => {\n      const [file, lineNumber, ...rest] = line.split(\":\")\n\n      return {\n        data: {\n          command: \"FzfPreviewGrepHelp\",\n          type: \"line\",\n          file: stripAnsi(file),\n          lineNumber: Number(stripAnsi(lineNumber)),\n          text: stripAnsi(rest.join(\":\")),\n        },\n        displayText: `${colorizeFile(collapseHome(file.split(\"/\").slice(-1).join(\"/\")))}:${colorize(\n          lineNumber,\n          \"green\"\n        )}: ${rest.join(\":\")}`,\n      }\n    }),\n    options: { \"--header\": `'[Search from] ${helpTagsArgs}'` },\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const grepHelpDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"GrepHelp> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/vim-lsp-current-diagnostics.ts",
    "content": "import { getCurrentDiagnostics } from \"@/connector/vim-lsp\"\nimport { diagnosticToResourceLine } from \"@/fzf/resource/vim-lsp-diagnostics\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const vimLspCurrentDiagnostics = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const diagnostics = await getCurrentDiagnostics()\n  const resourceLines: ResourceLines = diagnostics.map((diagnostic) => diagnosticToResourceLine(diagnostic))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const vimLspCurrentDiagnosticsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"CurrentDiagnostics> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/vim-lsp-definition.ts",
    "content": "import { getDefinition } from \"@/connector/vim-lsp\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const vimLspDefinition = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { definitions } = await getDefinition()\n  const resourceLines: ResourceLines = definitions.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewVimLspDefinition\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const vimLspDefinitionDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Definition> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/vim-lsp-diagnostics.ts",
    "content": "import { getDiagnostics } from \"@/connector/vim-lsp\"\nimport { diagnosticToDisplayText } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type {\n  Diagnostic,\n  FzfCommandDefinitionDefaultOption,\n  Resource,\n  ResourceLine,\n  ResourceLines,\n  SourceFuncArgs,\n} from \"@/type\"\n\nexport const diagnosticToResourceLine = (diagnostic: Diagnostic): ResourceLine => {\n  const { file, lineNumber, message } = diagnostic\n\n  return {\n    data: {\n      command: \"FzfPreviewVimLspDiagnostics\",\n      type: \"line\",\n      file,\n      lineNumber,\n      text: message,\n    },\n    displayText: diagnosticToDisplayText(diagnostic),\n  }\n}\n\nexport const vimLspDiagnostics = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const diagnostics = await getDiagnostics()\n  const resourceLines: ResourceLines = diagnostics.map((diagnostic) => diagnosticToResourceLine(diagnostic))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const vimLspDiagnosticsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Diagnostics> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/vim-lsp-implementation.ts",
    "content": "import { getImplementation } from \"@/connector/vim-lsp\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const vimLspImplementation = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { implementations } = await getImplementation()\n  const resourceLines: ResourceLines = implementations.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewVimLspImplementation\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const vimLspImplementationDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Implementation> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/vim-lsp-references.ts",
    "content": "import { getReferences } from \"@/connector/vim-lsp\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const vimLspReferences = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { references } = await getReferences()\n  const resourceLines: ResourceLines = references.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewVimLspReferences\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const vimLspReferencesDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"References> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/vim-lsp-type-definition.ts",
    "content": "import { getTypeDefinition } from \"@/connector/vim-lsp\"\nimport { colorize, colorizeFile } from \"@/fzf/syntax/colorize\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const vimLspTypeDefinition = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const { typeDefinitions } = await getTypeDefinition()\n  const resourceLines: ResourceLines = typeDefinitions.map(({ file, lineNumber, text }) => ({\n    data: {\n      command: \"FzfPreviewVimLspTypeDefinition\",\n      type: \"line\",\n      file,\n      text,\n      lineNumber,\n    },\n    displayText: `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} {3..}\"`\n}\n\nexport const vimLspTypeDefinitionDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"TypeDefinition> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"3..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/vista.ts",
    "content": "import type { VistaTag } from \"@/connector/vista\"\nimport { getVistaCtags } from \"@/connector/vista\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\nimport { alignLists } from \"@/util/align\"\n\nconst SPACER = \"  \"\n\nconst vistaTagToArray = ({ lineNumber, kind, text }: VistaTag) => [lineNumber.toString(), `[${kind}]`, text]\n\nexport const vistaCtags = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const tags = await getVistaCtags()\n  const displayTextList = alignLists(tags.map((tag) => vistaTagToArray(tag))).map((tag) => tag.join(SPACER).trim())\n  const resourceLines: ResourceLines = tags.map((tag, i) => ({\n    data: {\n      command: \"FzfPreviewVistaCtags\",\n      type: \"line\",\n      file: tag.tagFile,\n      lineNumber: tag.lineNumber,\n      text: displayTextList[i],\n    },\n    displayText: `${displayTextList[i]}${SPACER}${tag.tagFile}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const grepPreviewCommand = globalVariableSelector(\"fzfPreviewGrepPreviewCmd\") as string\n\n  return `\"${grepPreviewCommand} '{-1}:{2}'\"`\n}\n\nexport const vistaCtagsDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"VistaCtags> \"',\n  \"--multi\": true,\n  \"--preview\": previewCommand(),\n  \"--preview-window\": '\"+{2}-10\"',\n  \"--with-nth\": '\"2..\"',\n})\n"
  },
  {
    "path": "src/fzf/resource/yankround.ts",
    "content": "import { getYankround } from \"@/connector/yankround\"\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { FzfCommandDefinitionDefaultOption, Resource, ResourceLines, SourceFuncArgs } from \"@/type\"\n\nexport const yankround = async (_args: SourceFuncArgs): Promise<Resource> => {\n  const yankHistories = await getYankround()\n  const resourceLines: ResourceLines = yankHistories.map(({ line, option, text }) => ({\n    data: {\n      command: \"FzfPreviewYankround\",\n      type: \"register\",\n      lineNumber: line,\n      option,\n      text,\n    },\n    displayText: `${line} ${option} ${text}`,\n  }))\n\n  return {\n    type: \"json\",\n    lines: resourceLines,\n  }\n}\n\nconst previewCommand = () => {\n  const yankroundPreviewCommand = globalVariableSelector(\"fzfPreviewYankroundPreviewCommand\") as string\n  const historyFile = `${globalVariableSelector(\"yankroundDir\") as string}/history`\n\n  return `\"${yankroundPreviewCommand} ${historyFile} {2}\"`\n}\n\nexport const yankroundDefaultOptions = (): FzfCommandDefinitionDefaultOption => ({\n  \"--prompt\": '\"Yankround> \"',\n  \"--preview\": previewCommand(),\n  \"--no-sort\": true,\n  \"--with-nth\": \"4..\",\n  \"--header\": '\"C-y: Paste\"',\n})\n"
  },
  {
    "path": "src/fzf/syntax/colorize.ts",
    "content": "import chalk from \"chalk\"\n\nimport type { Color, Diagnostic } from \"@/type\"\n\nchalk.level = 3\n\ntype Options = {\n  bold?: boolean\n}\n\nexport const colorize = (str: string, color: Color, options?: Options): string => {\n  const line = chalk[color](str)\n  if (options == null) {\n    return line\n  } else if (options.bold === true) {\n    return chalk[color](chalk.bold(line))\n  } else {\n    return line\n  }\n}\n\nexport const colorizeFile = (filePath: string): string => {\n  const splittedFilePath = filePath.split(\"/\")\n  if (splittedFilePath.length === 1) {\n    return filePath\n  } else {\n    const file = splittedFilePath.slice(-1).toString()\n    const directory = splittedFilePath.slice(0, -1).join(\"/\")\n\n    return `${colorize(`${directory}/`, \"cyan\")}${file}`\n  }\n}\n\n// The colorize based on coc-fzf\n// REF: https://github.com/antoinemadec/coc-fzf\n// MIT: Copyright (c) 2020 Antoine\nexport const diagnosticToDisplayText = ({ file, lineNumber, severity, message }: Diagnostic): string => {\n  const severityColor = {\n    Error: \"red\",\n    Warning: \"yellow\",\n    Information: \"blue\",\n    Hint: \"cyan\",\n    \"\": \"white\",\n  } as const\n\n  return `${colorizeFile(file)}:${colorize(lineNumber.toString(), \"green\")}:  ${colorize(\n    severity,\n    severityColor[severity] as Color\n  )} ${message}`\n}\n\nconst iconToColor: { [icon: string]: Color } = {\n  \"\": \"green\",\n  \"\": \"magenta\",\n  \"\": \"yellow\",\n  \"\": \"blue\",\n  \"\": \"yellow\",\n  \"\": \"yellow\",\n  \"\": \"yellow\",\n  \"\": \"blue\",\n  \"\": \"red\",\n  \"\": \"magenta\",\n  \"\": \"yellow\",\n  \"\": \"white\",\n  \"\": \"cyan\",\n  \"\": \"green\",\n  \"\": \"blue\",\n  \"\": \"blue\",\n  \"\": \"white\",\n  \"\": \"yellow\",\n  \"\": \"magenta\",\n  \"\": \"magenta\",\n  \"\": \"magenta\",\n  λ: \"yellow\",\n  \"\": \"white\",\n  \"\": \"blue\",\n  \"\": \"green\",\n  \"\": \"green\",\n  \"\": \"red\",\n  \"\": \"yellow\",\n  \"\": \"white\",\n  \"\": \"yellow\",\n  \"\": \"magenta\",\n  \"\": \"blue\",\n  \"\": \"yellow\",\n  \"\": \"blue\",\n  \"\": \"yellow\",\n  \"\": \"red\",\n  \"\": \"magenta\",\n  \"\": \"magenta\",\n  \"\": \"green\",\n  \"\": \"yellow\",\n  \"\": \"blue\",\n  \"\": \"blue\",\n  \"\": \"magenta\",\n  \"\": \"white\",\n}\n\nexport const colorizeDevIcon = (icon: string): string => {\n  const color = iconToColor[icon] ?? null\n\n  return color != null ? chalk[color](icon) : icon\n}\n"
  },
  {
    "path": "src/fzf/util.ts",
    "content": "import camelCase from \"camelcase\"\nimport type { ReadonlyDeep } from \"type-fest\"\n\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport type { ProcessesName } from \"@/type\"\n\nexport const createProcessFunctionName = (processesName: ProcessesName, expectKey: string): string =>\n  camelCase(`fzf-preview-${processesName}-${expectKey}`, { pascalCase: true })\n\nexport const filePreviewCommand = (): string => {\n  const previewCommand = globalVariableSelector(\"fzfPreviewCommand\") as string\n  const binaryPreviewCommand = globalVariableSelector(\"fzfBinaryPreviewCommand\") as string\n  const ifBinaryCommand = globalVariableSelector(\"fzfPreviewIfBinaryCommand\") as string\n\n  return `'${ifBinaryCommand} && ${binaryPreviewCommand} || ${previewCommand}'`\n}\n\nconst createGitLogAndStashOption = (prefix: string) => {\n  return `--decorate --color=always --date=iso  --format='%C(green)[${prefix}]%Creset    %C(magenta)%h%Creset    %C(yellow)%ad %x09%Creset    [%C(blue)%an%Creset]    %x09%C(auto)%s'`\n}\n\nexport const gitStashDecorateCommand = `git stash list ${createGitLogAndStashOption(\"stash\")}`\nexport const gitStashNameCommand = `git stash list --decorate --color=always --format='%C(cyan)%gd%Creset'`\n\nexport const gitReflogDecorateCommand = `git reflog ${createGitLogAndStashOption(\"reflog\")}`\nexport const gitReflogNameCommand = `git reflog --decorate --color=always --format='%C(cyan)%gd%Creset'`\n\nexport const createGitLogCommand = (file?: string): string => {\n  const targetFile = file != null ? `-- ${file}` : \"\"\n\n  return `git log ${createGitLogAndStashOption(\"commit\")} ${targetFile}`\n}\n\ntype ParsedQuickFix = ReadonlyDeep<{\n  fileName: string\n  lineNumber: number\n  text: string\n}>\n\nexport const parseQuickFixAndLocationListLine = (line: string): ParsedQuickFix => {\n  const result = /^(?<fileName>[^|]*)\\|((?<lineNumber>\\d+)( col (\\d+))?[^|]*)?\\|(?<text>.*)/.exec(line)\n\n  if (result?.groups == null) {\n    throw new Error(`line is not quickfix format: \"${line}\"`)\n  }\n\n  const { fileName, lineNumber, text } = result.groups\n\n  return { fileName, lineNumber: Number(lineNumber), text }\n}\n"
  },
  {
    "path": "src/module/execute-command.ts",
    "content": "import type { PayloadAction } from \"@reduxjs/toolkit\"\nimport { createSlice } from \"@reduxjs/toolkit\"\nimport type { VimValue } from \"neovim/lib/types/VimValue\"\n\nimport { EXECUTE_COMMAND } from \"@/const/module\"\nimport type { FzfPreviewCommandList, UserProcesses } from \"@/type\"\n\nexport type State = {\n  commandName?: FzfPreviewCommandList\n  options: {\n    userProcesses?: UserProcesses\n    enableDevIcons: VimValue\n    currentFilePath: string\n  }\n}\n\nconst initialState: State = {\n  commandName: undefined,\n  options: {\n    enableDevIcons: false,\n    currentFilePath: \"\",\n  },\n}\n\nexport const executeCommandModule = createSlice({\n  name: EXECUTE_COMMAND,\n  initialState,\n  reducers: {\n    restore: (state, { payload }: PayloadAction<State | undefined>) => {\n      if (payload) {\n        return { ...state, ...payload }\n      }\n\n      return state\n    },\n    setExecuteCommand: (\n      state,\n      { payload }: PayloadAction<{ commandName: FzfPreviewCommandList; options: State[\"options\"] }>\n    ) => {\n      const { commandName, options } = payload\n      state.commandName = commandName\n      state.options = options\n    },\n  },\n})\n"
  },
  {
    "path": "src/module/file-path.ts",
    "content": "import type { PayloadAction } from \"@reduxjs/toolkit\"\nimport { createSlice } from \"@reduxjs/toolkit\"\n\nimport { FILE_PATH } from \"@/const/module\"\n\nexport type State = {\n  [filePath in string]: {\n    relativePath?: string\n  }\n}\n\nconst initialState: State = {}\n\nexport const filePathModule = createSlice({\n  name: FILE_PATH,\n  initialState,\n  reducers: {\n    registerRelativePath: (state, { payload }: PayloadAction<{ absolutePath: string; relativePath: string }>) => {\n      state[payload.absolutePath] = { relativePath: payload.relativePath }\n    },\n  },\n})\n"
  },
  {
    "path": "src/module/git-config.ts",
    "content": "import type { PayloadAction } from \"@reduxjs/toolkit\"\nimport { createSlice } from \"@reduxjs/toolkit\"\n\nimport { GIT_CONFIG } from \"@/const/module\"\n\nexport type State = {\n  noVerify: boolean\n}\n\nconst initialState: State = {\n  noVerify: false,\n}\n\nexport const gitConfigModule = createSlice({\n  name: GIT_CONFIG,\n  initialState,\n  reducers: {\n    restore: (state, { payload }: PayloadAction<State | undefined>) => {\n      if (payload != null) {\n        state.noVerify = payload.noVerify\n      }\n    },\n    toggleNoVerify: (state) => {\n      state.noVerify = !state.noVerify\n    },\n  },\n})\n"
  },
  {
    "path": "src/module/recall.ts",
    "content": "import type { PayloadAction } from \"@reduxjs/toolkit\"\nimport { createSlice } from \"@reduxjs/toolkit\"\n\nimport { RECALL } from \"@/const/module\"\n\nexport type State = {\n  grepArgs: string\n}\n\nconst initialState: State = {\n  grepArgs: \".\",\n}\n\nexport const recallModule = createSlice({\n  name: RECALL,\n  initialState,\n  reducers: {\n    restore: (state, { payload }: PayloadAction<State | undefined>) => {\n      if (payload) {\n        return { ...state, ...payload }\n      }\n\n      return state\n    },\n    setGrepArgs: (state, { payload }: PayloadAction<{ grepArgs: string }>) => {\n      const { grepArgs } = payload\n      state.grepArgs = grepArgs\n    },\n  },\n})\n"
  },
  {
    "path": "src/module/resume.ts",
    "content": "import type { PayloadAction } from \"@reduxjs/toolkit\"\nimport { createSlice } from \"@reduxjs/toolkit\"\n\nimport { RESUME } from \"@/const/module\"\nimport type { FzfCommandName } from \"@/type\"\n\ntype State = {\n  [commandName in FzfCommandName]?: string\n}\n\nconst initialState: State = {}\n\nexport const resumeModule = createSlice({\n  name: RESUME,\n  initialState,\n  reducers: {\n    restore: (state, { payload }: PayloadAction<State | undefined>) => {\n      if (payload) {\n        return { ...state, ...payload }\n      }\n\n      return state\n    },\n    setQuery: (state, { payload }: PayloadAction<{ commandName: FzfCommandName; query: string }>) => {\n      const { commandName, query } = payload\n      state[commandName] = query\n    },\n  },\n})\n"
  },
  {
    "path": "src/module/selector/execute-command.ts",
    "content": "import type { State } from \"@/module/execute-command\"\nimport { store } from \"@/store\"\n\nexport const executeCommandSelector = (): State => store.getState().executeCommand\n"
  },
  {
    "path": "src/module/selector/file-path.ts",
    "content": "import type { State } from \"@/module/file-path\"\nimport { store } from \"@/store\"\n\nexport const filePathSelector = (filePath: string): State[string] | undefined => store.getState().filePath[filePath]\n"
  },
  {
    "path": "src/module/selector/git-config.ts",
    "content": "import type { State } from \"@/module/git-config\"\nimport { store } from \"@/store\"\n\nexport const gitConfigSelector = (name: keyof State): State[typeof name] => store.getState().gitConfig[name]\n"
  },
  {
    "path": "src/module/selector/recall.ts",
    "content": "import type { State } from \"@/module/recall\"\nimport { store } from \"@/store\"\n\nexport const recallSelector = (key: keyof State): State[keyof State] => store.getState().recall[key]\n"
  },
  {
    "path": "src/module/selector/resume.ts",
    "content": "import { store } from \"@/store\"\nimport type { FzfCommandName } from \"@/type\"\n\nexport const resumeSelector = (commandName: FzfCommandName): string | undefined => store.getState().resume[commandName]\n"
  },
  {
    "path": "src/module/selector/session.ts",
    "content": "import { store } from \"@/store\"\nimport type { Session, SessionToken } from \"@/type\"\n\nexport const sessionSelector = (sessionToken: SessionToken): Session | null =>\n  store.getState().session.sessions[sessionToken] ?? null\n\nexport const currentSessionSelector = (): Session | null => store.getState().session.currentSession ?? null\n"
  },
  {
    "path": "src/module/selector/vim-variable.ts",
    "content": "import type { VimValue } from \"neovim/lib/types/VimValue\"\n\nimport { store } from \"@/store\"\nimport type { GlobalVariableName, VimOptionName } from \"@/type\"\n\nexport const globalVariableSelector = (name: GlobalVariableName): VimValue => store.getState().vimVariable.global[name]\nexport const vimOptionsSelector = (name: VimOptionName): VimValue => store.getState().vimVariable.options[name]\n"
  },
  {
    "path": "src/module/session.ts",
    "content": "import type { PayloadAction } from \"@reduxjs/toolkit\"\nimport { createSlice } from \"@reduxjs/toolkit\"\nimport { castDraft, createDraft } from \"immer\"\n\nimport { SESSION } from \"@/const/module\"\nimport type { Session, SessionToken } from \"@/type\"\n\ntype State = {\n  currentSession?: Session\n  sessions: {\n    [key in SessionToken]: Session\n  }\n}\n\nconst initialState: State = {\n  sessions: {},\n}\n\nexport const sessionModule = createSlice({\n  name: SESSION,\n  initialState,\n  reducers: {\n    restore: (state, { payload }: PayloadAction<State | undefined>) => {\n      if (payload != null) {\n        // NOTE: Not run createDraft on the payload, the state will not work properly on other actions.\n        //       or not use createDraft and `state = payload` (not want use it)\n        const { sessions, currentSession } = createDraft(payload)\n        state.sessions = sessions\n        state.currentSession = currentSession\n      }\n    },\n    setSession: (state, { payload }: PayloadAction<{ sessionToken: SessionToken; session: Session }>) => {\n      state.sessions[payload.sessionToken] = castDraft(payload.session)\n      state.currentSession = undefined\n    },\n    setCurrentSession: (state, { payload }: PayloadAction<{ session: Session }>) => {\n      state.currentSession = castDraft(payload.session)\n    },\n    clearCurrentSession: (state, _: PayloadAction<undefined>) => {\n      state.currentSession = undefined\n    },\n  },\n})\n"
  },
  {
    "path": "src/module/vim-variable.ts",
    "content": "import type { PayloadAction } from \"@reduxjs/toolkit\"\nimport { createSlice } from \"@reduxjs/toolkit\"\nimport { mapKeys, mapValues } from \"lodash\"\nimport type { VimValue } from \"neovim/lib/types/VimValue\"\n\nimport type { vimOptions } from \"@/association/vim-variable\"\nimport { VIM_VARIABLE } from \"@/const/module\"\nimport type { GlobalVariableName } from \"@/type\"\n\ntype State = {\n  global: {\n    [key in GlobalVariableName]: VimValue\n  }\n  options: {\n    [key in typeof vimOptions[number]]: VimValue\n  }\n}\n\ntype GlobalVariable = {\n  name: keyof State[\"global\"]\n  value: VimValue\n}\n\ntype VimOption = {\n  name: keyof State[\"options\"]\n  value: VimValue\n}\n\nconst initialState: State = {\n  global: {\n    fzfPreviewDefaultFzfOptions: {},\n    fzfPreviewUseDevIcons: false,\n    fzfPreviewDevIconPrefixStringLength: 0,\n    fzfPreviewDevIconsLimit: 5000,\n    webDevIconsUnicodeDecorateFileNodesDefaultSymbol: \" \",\n    webDevIconsUnicodeDecorateFileNodesExtensionSymbols: {},\n    webDevIconsUnicodeDecorateFileNodesExactSymbols: {},\n    webDevIconsUnicodeDecorateFileNodesPatternSymbols: {},\n    fzfPreviewCommand: \"\",\n    fzfBinaryPreviewCommand: \"\",\n    fzfPreviewIfBinaryCommand: \"\",\n    fzfPreviewFilelistCommand: \"\",\n    fzfPreviewGitFilesCommand: \"\",\n    fzfPreviewDirectoryFilesCommand: \"\",\n    fzfPreviewGitStatusCommand: \"\",\n    fzfPreviewGitStatusPreviewCommand: \"\",\n    fzfPreviewGrepCmd: \"\",\n    fzfPreviewScriptDir: \"\",\n    fzfPreviewCacheDirectory: \"\",\n    fzfPreviewLinesCommand: \"\",\n    fzfPreviewGrepPreviewCmd: \"\",\n    fzfPreviewCustomProcesses: {},\n    fzfPreviewFzfPreviewWindowOption: \"\",\n    fzfPreviewPreviewKeyBindings: \"\",\n    fzfPreviewFzfColorOption: \"\",\n    fzfPreviewHistoryDir: false,\n    fzfPreviewBuffersJump: 0,\n    yankroundDir: \"\",\n    fzfPreviewYankroundPreviewCommand: \"\",\n    fzfPreviewBlamePrCommand: \"\",\n  },\n  options: {\n    columns: 0,\n  },\n}\n\ntype CustomProcesses = {\n  [key: string]: string\n}\n\nexport const vimVariableModule = createSlice({\n  name: VIM_VARIABLE,\n  initialState,\n  reducers: {\n    restore: (state, { payload }: PayloadAction<State | undefined>) => {\n      if (payload) {\n        return { ...state, ...payload }\n      }\n\n      return state\n    },\n    setGlobalVariable: (state, { payload }: PayloadAction<GlobalVariable>) => {\n      const { name, value } = payload\n\n      switch (name) {\n        case \"fzfPreviewCustomProcesses\": {\n          if (typeof value === \"object\" && !Array.isArray(value)) {\n            const customProcessesDictionary = mapValues(\n              value as { [key: string]: CustomProcesses },\n              (processes: CustomProcesses) =>\n                mapKeys(processes, (_, expectKey) => (expectKey === \"\" ? \"enter\" : expectKey))\n            )\n\n            state.global.fzfPreviewCustomProcesses = customProcessesDictionary\n          } else {\n            throw new Error(\"fzf_preview_custom_processes must be Dictionary variable\")\n          }\n          break\n        }\n\n        default: {\n          state.global[name] = value\n        }\n      }\n    },\n    setOption: (state, { payload }: PayloadAction<VimOption>) => {\n      const { name, value } = payload\n      state.options[name] = value\n    },\n  },\n})\n"
  },
  {
    "path": "src/plugin/fzf-runner.ts",
    "content": "import { fzfOptionsToString } from \"@/fzf/option/convert\"\nimport { pluginCall } from \"@/plugin\"\nimport type { FzfOptions, ResourceLine, ResourceLines } from \"@/type\"\n\nconst PREFIX_SPACE = \"   \"\n\ntype Parameter = {\n  resourceLines: ResourceLines\n  handler: string\n  options: FzfOptions\n}\n\nexport const resourceLineToFzfLine = (resourceLine: ResourceLine): string => {\n  return `${PREFIX_SPACE}${encodeURIComponent(JSON.stringify(resourceLine.data))} ${resourceLine.displayText}`\n}\n\nexport const fzfRunner = async ({ resourceLines, handler, options }: Parameter): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#runner#fzf_run\", {\n    source: resourceLines.map((line) => resourceLineToFzfLine(line)),\n    handler,\n    options: fzfOptionsToString(options),\n    environment: PLUGIN.ENV,\n  })\n}\n"
  },
  {
    "path": "src/plugin/index.ts",
    "content": "import type { Neovim } from \"coc.nvim\"\nimport type { NvimPlugin } from \"neovim\"\nimport type { CommandOptions, NvimFunctionOptions } from \"neovim/lib/host/NvimPlugin\"\nimport type { VimValue } from \"neovim/lib/types/VimValue\"\nimport type { MessageConnection } from \"vscode-jsonrpc\"\n\n// @ts-ignore\nlet remotePlugin: NvimPlugin = null\n// @ts-ignore\nlet cocClient: Neovim = null\n// @ts-ignore\nlet rpcClient: MessageConnection = null\n\nexport const setRemotePlugin = (initialPlugin: NvimPlugin): void => {\n  remotePlugin = initialPlugin\n}\n\nexport const setCocClient = (initialCocClient: Neovim): void => {\n  cocClient = initialCocClient\n}\n\nexport const setRpcClient = (initialRpcClient: MessageConnection): void => {\n  rpcClient = initialRpcClient\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const remotePluginRegisterCommand = (name: string, fn: Function, options?: CommandOptions): void =>\n  remotePlugin.registerCommand(name, fn, options)\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const remotePluginRegisterFunction = (name: string, fn: Function, options?: NvimFunctionOptions): void =>\n  remotePlugin.registerFunction(name, fn, options)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const pluginCommand = (command: string): Promise<any> => {\n  if (remotePlugin != null) {\n    return remotePlugin.nvim.command(command)\n  } else if (cocClient != null) {\n    return cocClient.command(command)\n  } else if (rpcClient != null) {\n    return rpcClient.sendRequest(\"execCommand\", { command })\n  }\n\n  throw new Error(\"Unexpected remote plugin, coc client and rpc client is not exists\")\n}\n\nconst convertRpcArgs = (args?: VimValue | ReadonlyArray<VimValue>) => {\n  if (args == null) {\n    return []\n  } else if (Array.isArray(args)) {\n    return args\n  } else {\n    return [args]\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const pluginCall = (fname: string, args?: VimValue | ReadonlyArray<VimValue>): Promise<any> | null => {\n  if (remotePlugin != null) {\n    return remotePlugin.nvim.call(fname, args)\n  } else if (cocClient != null) {\n    return cocClient.call(fname, args)\n  } else if (rpcClient != null) {\n    return rpcClient.sendRequest(\"execCall\", { fname, args: convertRpcArgs(args) })\n  }\n\n  throw new Error(\"Unexpected remote plugin, coc client and rpc client is not exists\")\n}\n\nexport const pluginGetVar = (name: string): Promise<VimValue | null> => {\n  if (remotePlugin != null) {\n    return remotePlugin.nvim.getVar(name)\n  } else if (cocClient != null) {\n    return cocClient.getVar(name)\n  } else if (rpcClient != null) {\n    return rpcClient.sendRequest(\"getVar\", { name })\n  }\n\n  throw new Error(\"Unexpected remote plugin, coc client and rpc client is not exists\")\n}\n\nexport const pluginGetVvar = (name: string): Promise<VimValue> => {\n  if (remotePlugin != null) {\n    return remotePlugin.nvim.getVvar(name)\n  } else if (cocClient != null) {\n    return cocClient.getVvar(name)\n  } else if (rpcClient != null) {\n    return rpcClient.sendRequest(\"getVvar\", name)\n  }\n\n  throw new Error(\"Unexpected remote plugin, coc client and rpc client is not exists\")\n}\n"
  },
  {
    "path": "src/plugin/process-runner.ts",
    "content": "import { pluginCall } from \"@/plugin\"\nimport type { CallbackLines, UserProcesses } from \"@/type\"\n\ntype Args = {\n  processesFunctionName: string\n  expectKey: string\n  lines: CallbackLines\n  userProcesses?: UserProcesses\n}\n\nconst getProcessesName = (userProcesses?: UserProcesses) => {\n  if (userProcesses?.type === \"global_variable\") {\n    return userProcesses.value\n  } else if (userProcesses?.type === \"custom_processes_variable\") {\n    return `fzf_preview_custom_processes[\"${userProcesses.value}\"]`\n  }\n\n  return undefined\n}\n\nexport const processesRunner = async ({\n  processesFunctionName,\n  expectKey,\n  lines,\n  userProcesses,\n}: Args): Promise<void> => {\n  await pluginCall(\"fzf_preview#remote#handler_to_process#call_funcref_or_fallback_default_process\", [\n    PLUGIN.ENV,\n    processesFunctionName,\n    expectKey,\n    lines,\n    getProcessesName(userProcesses),\n  ])\n}\n"
  },
  {
    "path": "src/plugin/sync-vim-variable.ts",
    "content": "import { vimVariableModule } from \"@/module/vim-variable\"\nimport { pluginCall } from \"@/plugin\"\nimport { dispatch } from \"@/store\"\nimport type { GlobalVariableName, GlobalVariables } from \"@/type\"\n\nexport const syncVimVariable = async (): Promise<void> => {\n  const { actions } = vimVariableModule\n  const variables = await (pluginCall(\"fzf_preview#remote#variable#get_global_variables\") as Promise<GlobalVariables>)\n\n  Object.entries(variables).forEach(([name, value]) => {\n    dispatch(actions.setGlobalVariable({ name: name as GlobalVariableName, value }))\n  })\n}\n\nexport const syncVimOptions = async (): Promise<void> => {\n  const columns = (await pluginCall(\"fzf_preview#remote#util#get_columns\")) as number\n  dispatch(vimVariableModule.actions.setOption({ name: \"columns\", value: columns }))\n}\n"
  },
  {
    "path": "src/register/coc/index.ts",
    "content": "import type { commands, Disposable, ExtensionContext } from \"coc.nvim\"\nimport { workspace } from \"coc.nvim\"\nimport { flatMap, mapValues } from \"lodash\"\n\nimport { cocCommandDefinition } from \"@/association/coc-command\"\nimport { dispatchResumeQuery } from \"@/connector/resume\"\nimport { HANDLER_NAME } from \"@/const/fzf-handler\"\nimport { executeCommand } from \"@/fzf/command\"\nimport { getDefaultProcesses } from \"@/fzf/function\"\nimport { callProcess } from \"@/fzf/handler\"\nimport { executeProcess, processesDefinition } from \"@/fzf/process\"\nimport { pluginCommand, setCocClient } from \"@/plugin\"\nimport type { CallbackLines } from \"@/type\"\n\nconst removeFzfPreviewPrefix = (name: string) => {\n  const result = /^FzfPreview(?<name>\\S+)/.exec(name)\n\n  if (result?.groups != null) {\n    return result.groups.name\n  }\n\n  return name\n}\n\nexport const setRuntimePath = async (context: ExtensionContext): Promise<void> => {\n  const rtp = (await workspace.nvim.getOption(\"runtimepath\")) as string\n  const paths = rtp.split(\",\")\n  if (!paths.includes(context.extensionPath)) {\n    await workspace.nvim.command(`execute 'noautocmd set runtimepath^='.fnameescape('${context.extensionPath}')`)\n  }\n  await workspace.nvim.command(\"runtime plugin/fzf_preview.vim\")\n}\n\nexport const initializeExtension = async (): Promise<void> => {\n  setCocClient(workspace.nvim)\n  await pluginCommand(\"let g:fzf_preview_has_coc = v:true\")\n}\n\nexport const registerCommands = (commandManager: typeof commands): ReadonlyArray<Disposable> =>\n  cocCommandDefinition.map((fzfCommand) =>\n    commandManager.registerCommand(\n      `fzf-preview.${removeFzfPreviewPrefix(fzfCommand.commandName)}`,\n      async (...params: ReadonlyArray<string>) => {\n        const args = params.join(\" \")\n        await executeCommand(args, fzfCommand)\n      }\n    )\n  )\n\nexport const registerProcesses = (commandManager: typeof commands): ReadonlyArray<Disposable> =>\n  flatMap(processesDefinition, ({ processes }) =>\n    processes.map((process) =>\n      commandManager.registerCommand(\n        `fzf-preview-callback.${removeFzfPreviewPrefix(process.name)}`,\n        async ([lines]: [CallbackLines, ...ReadonlyArray<unknown>]) => {\n          await executeProcess(lines, process)\n        }\n      )\n    )\n  )\n\nexport const registerFunctions = (commandManager: typeof commands): ReadonlyArray<Disposable> => [\n  commandManager.registerCommand(`fzf-preview.${removeFzfPreviewPrefix(HANDLER_NAME)}`, callProcess),\n  commandManager.registerCommand(\"fzf-preview.GetDefaultProcesses\", ([processesName]: ReadonlyArray<string>) =>\n    mapValues(getDefaultProcesses(processesName), (name) => name)\n  ),\n  commandManager.registerCommand(\"fzf-preview-function.DispatchResumeQuery\", dispatchResumeQuery),\n]\n"
  },
  {
    "path": "src/register/remote/index.ts",
    "content": "import { commandDefinition } from \"@/association/command\"\nimport { dispatchResumeQuery } from \"@/connector/resume\"\nimport { HANDLER_NAME } from \"@/const/fzf-handler\"\nimport { executeCommand } from \"@/fzf/command\"\nimport { getDefaultProcesses } from \"@/fzf/function\"\nimport { callProcess } from \"@/fzf/handler\"\nimport { executeProcess, processesDefinition } from \"@/fzf/process\"\nimport { remotePluginRegisterCommand, remotePluginRegisterFunction } from \"@/plugin\"\nimport type { CallbackLines } from \"@/type\"\n\nexport const registerRemoteCommands = (): void => {\n  commandDefinition.forEach((fzfCommand) => {\n    remotePluginRegisterCommand(\n      fzfCommand.commandName,\n      async (params: ReadonlyArray<string>) => {\n        const args = params[0] != null ? params[0] : \"\"\n        await executeCommand(args, fzfCommand)\n      },\n      fzfCommand.vimCommandOptions\n    )\n  })\n}\n\nexport const registerProcesses = (): void => {\n  processesDefinition.forEach(({ processes }) => {\n    processes.forEach((process) => {\n      remotePluginRegisterFunction(\n        process.name,\n        async ([lines]: [CallbackLines, ...ReadonlyArray<unknown>]) => {\n          await executeProcess(lines, process)\n        },\n        { sync: false }\n      )\n    })\n  })\n}\n\nexport const registerFunction = (): void => {\n  remotePluginRegisterFunction(HANDLER_NAME, callProcess, { sync: true })\n\n  remotePluginRegisterFunction(\n    \"FzfPreviewGetDefaultProcesses\",\n    ([processesName]: ReadonlyArray<string>) => getDefaultProcesses(processesName),\n    { sync: true }\n  )\n\n  remotePluginRegisterFunction(\"FzfPreviewDispatchResumeQuery\", dispatchResumeQuery, { sync: false })\n}\n"
  },
  {
    "path": "src/remote.ts",
    "content": "/* eslint-disable import/no-import-module-exports */\nimport type { NvimPlugin } from \"neovim\"\n\nimport { setRemotePlugin } from \"@/plugin\"\nimport { registerFunction, registerProcesses, registerRemoteCommands } from \"@/register/remote\"\n/* eslint-enable */\n\nmodule.exports = (plugin: NvimPlugin) => {\n  setRemotePlugin(plugin)\n\n  registerRemoteCommands()\n  registerProcesses()\n  registerFunction()\n\n  plugin.registerCommand(\n    \"FzfPreviewRemoteEnvironment\",\n    async (_args: ReadonlyArray<string>) => {\n      await plugin.nvim.command(\"echo 'fzf-preview is remote plugin'\")\n    },\n    { nargs: \"*\" }\n  )\n}\n"
  },
  {
    "path": "src/rpc.ts",
    "content": "import * as rpc from \"vscode-jsonrpc\"\n\nimport { commandDefinition } from \"@/association/command\"\nimport { dispatchResumeQuery } from \"@/connector/resume\"\nimport { executeCommand } from \"@/fzf/command\"\nimport { getDefaultProcesses } from \"@/fzf/function\"\nimport { callProcess } from \"@/fzf/handler\"\nimport { executeProcess, processesDefinition } from \"@/fzf/process\"\nimport { setRpcClient } from \"@/plugin\"\nimport type {\n  DispatchResumeQueryParams,\n  RpcCallProcessParams,\n  RpcExecCommandParams,\n  RpcExecProcessCallbackParams,\n} from \"@/type\"\n\nconst connection = rpc.createMessageConnection(\n  // @ts-ignore\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n  new rpc.StreamMessageReader(process.stdin),\n  // @ts-ignore\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n  new rpc.StreamMessageWriter(process.stdout)\n)\n\nconst getDefaultProcessesRequest = new rpc.RequestType<void, { [key: string]: { [key: string]: string } }, void>(\n  \"getDefaultProcesses\"\n)\nconnection.onRequest(getDefaultProcessesRequest, () => {\n  const openFile = getDefaultProcesses(\"open-file\")\n  const openFileWithTagStack = getDefaultProcesses(\"open-file-with-tag-stack\")\n  const openBuffer = getDefaultProcesses(\"open-buffer\")\n  const openBufnr = getDefaultProcesses(\"open-bufnr\")\n  const gitStatus = getDefaultProcesses(\"git-status\")\n\n  return {\n    \"open-file\": openFile,\n    \"open-file-with-tag-stack\": openFileWithTagStack,\n    \"open-buffer\": openBuffer,\n    \"open-bufnr\": openBufnr,\n    \"git-status\": gitStatus,\n  }\n})\n\nconst execCommandRequest = new rpc.RequestType<RpcExecCommandParams, void, void>(\"execCommand\")\nconnection.onRequest(execCommandRequest, async ({ commandName, args }) => {\n  for (const fzfCommand of commandDefinition) {\n    if (commandName === fzfCommand.commandName) {\n      // eslint-disable-next-line no-await-in-loop\n      await executeCommand(args != null ? args : \"\", fzfCommand)\n\n      return\n    }\n  }\n})\n\nconst callProcessRequest = new rpc.RequestType<RpcCallProcessParams, void, void>(\"callProcess\")\nconnection.onRequest(callProcessRequest, async ({ lines }) => {\n  await callProcess([lines])\n})\n\nconst execProcessCallbackRequest = new rpc.RequestType<RpcExecProcessCallbackParams, void, void>(\"execProcessCallback\")\nconnection.onRequest(execProcessCallbackRequest, async ({ processName, lines }) => {\n  for (const { processes } of processesDefinition) {\n    for (const process of processes) {\n      if (processName === process.name) {\n        // eslint-disable-next-line no-await-in-loop\n        await executeProcess(lines, process)\n\n        return\n      }\n    }\n  }\n})\n\nconst dispatchResumeQueryRequest = new rpc.RequestType<DispatchResumeQueryParams, void, void>(\"dispatchResumeQuery\")\nconnection.onRequest(dispatchResumeQueryRequest, ({ commandName, query }) => {\n  dispatchResumeQuery([commandName, query])\n})\n\nsetRpcClient(connection)\nconnection.listen()\n"
  },
  {
    "path": "src/store/index.ts",
    "content": "import { configureStore, getDefaultMiddleware } from \"@reduxjs/toolkit\"\n\nimport { executeCommandModule } from \"@/module/execute-command\"\nimport { filePathModule } from \"@/module/file-path\"\nimport { gitConfigModule } from \"@/module/git-config\"\nimport { recallModule } from \"@/module/recall\"\nimport { resumeModule } from \"@/module/resume\"\nimport { sessionModule } from \"@/module/session\"\nimport { vimVariableModule } from \"@/module/vim-variable\"\n\nconst setupStore = () => {\n  const store = configureStore({\n    reducer: {\n      vimVariable: vimVariableModule.reducer,\n      executeCommand: executeCommandModule.reducer,\n      resume: resumeModule.reducer,\n      session: sessionModule.reducer,\n      gitConfig: gitConfigModule.reducer,\n      recall: recallModule.reducer,\n      filePath: filePathModule.reducer,\n    },\n    middleware: getDefaultMiddleware(),\n  })\n\n  return store\n}\n\nexport const store = setupStore()\nexport const { dispatch } = store\n"
  },
  {
    "path": "src/system/command.ts",
    "content": "import type { SpawnSyncReturns } from \"child_process\"\nimport { exec, execSync } from \"child_process\"\nimport { promisify } from \"util\"\n\nimport { MAX_BUFFER_SIZE } from \"@/const/system\"\nimport type { CommandResult } from \"@/type\"\n\nexport const execAsyncCommand = async (command: string): Promise<CommandResult> => {\n  const promiseExec = promisify(exec)\n  const { stdout, stderr } = await promiseExec(command, { encoding: \"utf-8\", maxBuffer: MAX_BUFFER_SIZE })\n\n  if (stderr === \"\") {\n    return {\n      stdout,\n      stderr,\n      status: 0,\n    }\n  }\n\n  return {\n    stdout,\n    stderr,\n    status: null,\n  }\n}\n\nexport const execSyncCommand = (command: string): CommandResult => {\n  try {\n    const stdout = execSync(command, { encoding: \"utf-8\", maxBuffer: MAX_BUFFER_SIZE })\n\n    return {\n      stdout,\n      stderr: \"\",\n      status: 0,\n    }\n  } catch (error) {\n    const { stdout, stderr, status } = error as SpawnSyncReturns<string>\n\n    return {\n      stdout,\n      stderr,\n      status,\n    }\n  }\n}\n"
  },
  {
    "path": "src/system/file.ts",
    "content": "import fs from \"fs\"\nimport path from \"path\"\n\nimport { TEMPORALLY_DATA_FILE_PATH } from \"@/const/system\"\nimport { pluginCall } from \"@/plugin\"\n\nexport const expandHome = (filePath: string): string => {\n  if (filePath.startsWith(\"~\")) {\n    return path.join(process.env.HOME as string, filePath.slice(1))\n  }\n\n  return filePath\n}\n\nexport const collapseHome = (filePath: string): string => {\n  return filePath.replace(process.env.HOME as string, \"~\")\n}\n\nexport const existsFileAsync = async (filePath: string): Promise<boolean> => {\n  const result = (await pluginCall(\"filereadable\", [filePath])) as number\n  if (result === 0) {\n    return false\n  } else {\n    return true\n  }\n}\n\n// TODO: Use Vim script\nexport const existsDirectory = (dirPath: string): boolean => {\n  try {\n    const stats = fs.statSync(dirPath)\n\n    return stats.isDirectory()\n  } catch (_error) {\n    return false\n  }\n}\n\nexport const readFile = (filePath: string): string => {\n  return fs.readFileSync(filePath, { encoding: \"utf-8\" })\n}\n\nexport const readFileLine = (filePath: string, lineNumber: number): string => {\n  return readFile(filePath).split(\"\\n\")[lineNumber - 1]\n}\n\nexport const getCurrentFilePath = async (): Promise<string> => {\n  const file = (await pluginCall(\"expand\", \"%\")) as string\n\n  return file\n}\n\nexport const getCurrentPath = async (): Promise<string> => {\n  const pwd = (await pluginCall(\"getcwd\")) as string\n\n  return pwd\n}\n\nexport const initializeDataTransferFile = (filePath: string): void => {\n  if (fs.existsSync(filePath)) {\n    fs.unlinkSync(filePath)\n  }\n  fs.closeSync(fs.openSync(TEMPORALLY_DATA_FILE_PATH, \"w\"))\n}\n"
  },
  {
    "path": "src/system/mr.ts",
    "content": "import fs from \"fs\"\n\nimport { globalVariableSelector } from \"@/module/selector/vim-variable\"\nimport { existsDirectory, expandHome } from \"@/system/file\"\n\nconst cacheDirectory = () => {\n  const cacheDir = globalVariableSelector(\"fzfPreviewCacheDirectory\")\n\n  if (typeof cacheDir !== \"string\" || cacheDir === \"\") {\n    throw new Error(\"g:fzf_preview_cache_directory must be string\")\n  }\n\n  return cacheDir\n}\n\nconst readFileOrCreateDirectory = (cacheFile: string) => {\n  const cacheDirectoryPath = expandHome(cacheDirectory())\n  if (!existsDirectory(cacheDirectoryPath)) {\n    fs.mkdirSync(cacheDirectoryPath, { recursive: true })\n  }\n\n  try {\n    return fs.readFileSync(cacheFile, { encoding: \"utf-8\" }).split(\"\\n\")\n  } catch (_error) {\n    return []\n  }\n}\n\nconst mruFilePath = () => `${cacheDirectory()}/mru`\nconst mrwFilePath = () => `${cacheDirectory()}/mrw`\n\nconst readFile = (filePath: string) => {\n  const files = readFileOrCreateDirectory(filePath)\n\n  return files\n}\n\nexport const readMruFile = (): ReadonlyArray<string> => {\n  const files = readFile(mruFilePath())\n\n  return files\n}\nexport const readMrwFile = (): ReadonlyArray<string> => {\n  const files = readFile(mrwFilePath())\n\n  return files\n}\n"
  },
  {
    "path": "src/system/project.ts",
    "content": "import { execProjectFiles } from \"@/connector/project-files\"\nimport { filePathModule } from \"@/module/file-path\"\nimport { filePathSelector } from \"@/module/selector/file-path\"\nimport { dispatch } from \"@/store\"\n\nexport const dropFileProtocol = (uri: string): string => {\n  const result = /file:\\/\\/(?<path>\\S+)/.exec(uri)\n\n  if (result?.groups != null) {\n    return result.groups.path\n  }\n\n  return uri\n}\n\nexport const filePathToRelativeFilePath = (file: string, currentPath: string): string | null => {\n  const cachedPath: ReturnType<typeof filePathSelector> | undefined = filePathSelector(file)\n\n  if (cachedPath?.relativePath != null) {\n    return cachedPath.relativePath\n  }\n\n  const regex = new RegExp(`^${currentPath}/(?<fileName>.+)`)\n  const regExpExecArray = regex.exec(file)\n\n  if (regExpExecArray?.groups == null) {\n    return null\n  }\n\n  const relativePath = regExpExecArray.groups.fileName\n  dispatch(filePathModule.actions.registerRelativePath({ absolutePath: file, relativePath }))\n\n  return relativePath\n}\n\nexport const filterProjectEnabledFile = async (\n  files: ReadonlyArray<string>,\n  currentPath: string\n): Promise<ReadonlyArray<string>> => {\n  const projectFiles = await execProjectFiles()\n  const existsFiles = files\n    .map((file) => filePathToRelativeFilePath(file, currentPath))\n    .filter((file): file is string => projectFiles.some((projectFile) => file != null && projectFile === file))\n\n  return existsFiles\n}\n"
  },
  {
    "path": "src/system/tags.ts",
    "content": "import { BUFFER_TAGS_COMMAND } from \"@/const/system\"\nimport { execSyncCommand } from \"@/system/command\"\n\nexport const getBufferTags = (filePath: string): ReadonlyArray<string> => {\n  const { stdout, stderr, status } = execSyncCommand(`${BUFFER_TAGS_COMMAND} ${filePath}`)\n\n  if (stderr !== \"\" || status !== 0) {\n    throw new Error(`Failed buffer tags command: \"${BUFFER_TAGS_COMMAND} ${filePath}\"`)\n  }\n\n  return stdout.split(\"\\n\")\n}\n"
  },
  {
    "path": "src/type/args.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport type { argsParser } from \"@/args/parser\"\n\nexport type ArgsOptions = ReadonlyDeep<ReturnType<ReturnType<typeof argsParser>[\"parseSync\"]>>\n"
  },
  {
    "path": "src/type/command.ts",
    "content": "import type { cocCommandDefinition } from \"@/association/coc-command\"\nimport type {\n  AddFzfArg,\n  FzfCommandName,\n  FzfOptions,\n  Processes,\n  Resource,\n  ResumeQuery,\n  SourceFuncArgs,\n  UserProcesses,\n} from \"@/type\"\n\nexport type FzfPreviewCommandList = typeof cocCommandDefinition[number][\"commandName\"]\nexport type ExecuteArgs = {\n  sourceFunc: (args: SourceFuncArgs) => Promise<Resource>\n  sourceFuncArgs: SourceFuncArgs\n  enableDevIconsCommandSetting: boolean\n  commandName: FzfCommandName\n  userProcesses?: UserProcesses\n  fzfCommandDefaultOptions: FzfOptions\n  defaultProcesses: Processes\n  addFzfOptions: ReadonlyArray<AddFzfArg>\n  historyOption: {\n    commandName: string\n    historyDir: string | false\n  }\n  resumeQuery?: ResumeQuery\n  enableConvertForFzf: boolean\n  addGitStatus: boolean | undefined\n}\n"
  },
  {
    "path": "src/type/connector.ts",
    "content": "import type { OpenCommand } from \"@/type/process\"\n\nexport type OpenFile = {\n  openCommand: OpenCommand\n  file: string\n  lineNumber?: number\n  setTagStack?: boolean\n}\n\nexport type ExportQuickFix =\n  | {\n      filename: string\n    }\n  | {\n      filename: string\n      lnum: number\n      text: string\n    }\n"
  },
  {
    "path": "src/type/fzf.ts",
    "content": "import type { CommandOptions } from \"neovim/lib/host/NvimPlugin\"\nimport type { Merge, ReadonlyDeep } from \"type-fest\"\n\nimport type {\n  GitBranchData,\n  GitLogData,\n  GitReflogData,\n  GitStashData,\n  GitStatusData,\n  ProcessesName,\n  Resource,\n} from \"@/type\"\n\nexport type FzfCommandDynamicOption = ReadonlyDeep<{\n  \"--header\"?: string\n  \"--header-lines\"?: string\n}>\n\ntype SelectedLine = string\nexport type SelectedLines = ReadonlyArray<SelectedLine>\n\nexport type ExpectKeyAndSelectedLines = ReadonlyArray<string>\n\nexport type BaseFzfCommandName =\n  | \"FzfPreviewProjectFiles\"\n  | \"FzfPreviewGitFiles\"\n  | \"FzfPreviewDirectoryFiles\"\n  | \"FzfPreviewBuffers\"\n  | \"FzfPreviewAllBuffers\"\n  | \"FzfPreviewProjectOldFiles\"\n  | \"FzfPreviewProjectMruFiles\"\n  | \"FzfPreviewProjectMrwFiles\"\n  | \"FzfPreviewLines\"\n  | \"FzfPreviewBufferLines\"\n  | \"FzfPreviewCtags\"\n  | \"FzfPreviewBufferTags\"\n  | \"FzfPreviewOldFiles\"\n  | \"FzfPreviewMruFiles\"\n  | \"FzfPreviewMrwFiles\"\n  | \"FzfPreviewQuickFix\"\n  | \"FzfPreviewLocationList\"\n  | \"FzfPreviewJumps\"\n  | \"FzfPreviewChanges\"\n  | \"FzfPreviewMarks\"\n  | \"FzfPreviewProjectGrep\"\n  | \"FzfPreviewProjectGrepRecall\"\n  | \"FzfPreviewFromResources\"\n  | \"FzfPreviewCommandPalette\"\n  | \"FzfPreviewGrepHelp\"\n  | \"FzfPreviewGitActions\"\n  | \"FzfPreviewGitStatus\"\n  | \"FzfPreviewGitStatusActions\"\n  | \"FzfPreviewGitBranches\"\n  | \"FzfPreviewGitBranchActions\"\n  | \"FzfPreviewGitLogs\"\n  | \"FzfPreviewGitCurrentLogs\"\n  | \"FzfPreviewGitLogActions\"\n  | \"FzfPreviewGitStashes\"\n  | \"FzfPreviewGitStashActions\"\n  | \"FzfPreviewGitReflogs\"\n  | \"FzfPreviewGitReflogActions\"\n  | \"FzfPreviewVimLspReferences\"\n  | \"FzfPreviewVimLspDiagnostics\"\n  | \"FzfPreviewVimLspCurrentDiagnostics\"\n  | \"FzfPreviewVimLspDefinition\"\n  | \"FzfPreviewVimLspTypeDefinition\"\n  | \"FzfPreviewVimLspImplementation\"\n  | \"FzfPreviewNvimLspReferences\"\n  | \"FzfPreviewNvimLspDiagnostics\"\n  | \"FzfPreviewNvimLspCurrentDiagnostics\"\n  | \"FzfPreviewNvimLspDefinition\"\n  | \"FzfPreviewNvimLspTypeDefinition\"\n  | \"FzfPreviewNvimLspImplementation\"\n  | \"FzfPreviewBookmarks\"\n  | \"FzfPreviewYankround\"\n  | \"FzfPreviewVistaCtags\"\n  | \"FzfPreviewVistaBufferCtags\"\n  | \"FzfPreviewMemoList\"\n  | \"FzfPreviewMemoListGrep\"\n  | \"FzfPreviewTodoComments\"\n  | \"FzfPreviewBlamePR\"\n\ntype CocFzfCommandName =\n  | \"FzfPreviewCocReferences\"\n  | \"FzfPreviewCocDiagnostics\"\n  | \"FzfPreviewCocCurrentDiagnostics\"\n  | \"FzfPreviewCocDefinition\"\n  | \"FzfPreviewCocTypeDefinition\"\n  | \"FzfPreviewCocImplementations\"\n  | \"FzfPreviewCocOutline\"\n  | \"FzfPreviewCocTsServerSourceDefinition\"\n\nexport type FzfCommandName = BaseFzfCommandName | CocFzfCommandName\n\nexport type SourceFuncArgs = ReadonlyDeep<{\n  args: ReadonlyArray<string>\n}>\n\ntype FzfCommandBase = ReadonlyDeep<{\n  sourceFunc: (sourceFuncArgs: SourceFuncArgs) => Promise<Resource>\n  sourceFuncArgsParser: (args: string) => SourceFuncArgs\n  vimCommandOptions: CommandOptions\n  defaultFzfOptionFunc: () =>\n    | { [optionName: string]: string | boolean | undefined }\n    | Promise<{ [optionName: string]: string | boolean | undefined }>\n  defaultProcessesName: ProcessesName\n  enableConvertForFzf: boolean\n  enableDevIcons: boolean\n  addGitStatus?: boolean\n  beforeCommandHook?: (args: string) => void\n}>\n\nexport type BaseFzfCommand = ReadonlyDeep<\n  Merge<\n    FzfCommandBase,\n    {\n      commandName: BaseFzfCommandName\n    }\n  >\n>\n\ntype CocFzfCommand = ReadonlyDeep<\n  Merge<\n    FzfCommandBase,\n    {\n      commandName: CocFzfCommandName\n    }\n  >\n>\n\nexport type FzfCommand = BaseFzfCommand | CocFzfCommand\n\nexport type FzfOptions = ReadonlyDeep<{\n  \"--ansi\"?: true\n  \"--bind\"?:\n    | ReadonlyArray<{\n        key: string\n        action: string\n      }>\n    | string\n  \"--expect\"?: ReadonlyArray<string> | string\n  \"--history\"?: string\n  \"--no-separator\"?: true\n  [otherProperty: string]: any // eslint-disable-line @typescript-eslint/no-explicit-any\n}>\n\nexport type FzfCommandDefinitionDefaultOption = ReadonlyDeep<{\n  \"--header\"?: string\n  \"--header-lines\"?: string\n  \"--prompt\": string\n  \"--multi\"?: true\n  \"--preview\"?: string\n  \"--preview-window\"?: string\n  \"--no-sort\"?: true\n  \"--delimiter\"?: string\n  \"--phony\"?: true\n  \"--bind\"?: string\n  \"--query\"?: string\n  \"--with-nth\"?: string\n  \"--nth\"?: string\n  \"--keep-right\"?: true\n}>\n\nexport type AddFzfArg = ReadonlyDeep<{\n  optionName: string\n  value?: string\n}>\n\nexport type ResumeQuery = string | null\n\nexport type Session = {\n  gitStatusDataList?: ReadonlyArray<GitStatusData>\n  gitBranches?: ReadonlyArray<GitBranchData>\n  gitLogs?: ReadonlyArray<GitLogData>\n  gitStashes?: ReadonlyArray<GitStashData>\n  gitReflogs?: ReadonlyArray<GitReflogData>\n}\n\nexport type SessionToken = string\n"
  },
  {
    "path": "src/type/git.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport type {\n  GIT_ACTIONS,\n  GIT_BRANCH_ACTIONS,\n  GIT_LOG_ACTIONS,\n  GIT_REFLOG_ACTIONS,\n  GIT_STASH_ACTIONS,\n  GIT_STATUS_ACTIONS,\n} from \"@/const/git\"\n\nexport type GitAction = typeof GIT_ACTIONS[number] | \"header\"\nexport type GitStatusAction = typeof GIT_STATUS_ACTIONS[number] | \"header\"\nexport type GitBranchAction = typeof GIT_BRANCH_ACTIONS[number] | \"header\"\nexport type GitLogAction = typeof GIT_LOG_ACTIONS[number] | \"header\"\nexport type GitStashAction = typeof GIT_STASH_ACTIONS[number] | \"header\"\nexport type GitReflogAction = typeof GIT_REFLOG_ACTIONS[number] | \"header\"\n\nexport type GitBranch = ReadonlyDeep<{\n  prefix: string\n  name: string\n  date: string\n  author: string\n}>\n\nexport type GitLog = ReadonlyDeep<{\n  prefix: string\n  hash: string\n  date: string\n  author: string\n  comment: string\n}>\n\nexport type GitStash = ReadonlyDeep<{\n  prefix: string\n  name: string\n  hash: string\n  date: string\n  author: string\n  comment: string\n}>\n\nexport type GitReflog = ReadonlyDeep<{\n  prefix: string\n  name: string\n  hash: string\n  date: string\n  author: string\n  comment: string\n}>\n\nexport type ParsedGitStatus = ReadonlyDeep<{\n  file: string\n  status: string\n}>\n"
  },
  {
    "path": "src/type/index.ts",
    "content": "export * from \"@/type/args\"\nexport * from \"@/type/command\"\nexport * from \"@/type/connector\"\nexport * from \"@/type/fzf\"\nexport * from \"@/type/git\"\nexport * from \"@/type/lsp\"\nexport * from \"@/type/process\"\nexport * from \"@/type/resource\"\nexport * from \"@/type/rpc\"\nexport * from \"@/type/syntax\"\nexport * from \"@/type/system\"\nexport * from \"@/type/vim\"\nexport * from \"@/type/vim-variable\"\n"
  },
  {
    "path": "src/type/lsp.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nexport type Location = ReadonlyDeep<{\n  file: string\n  lineNumber: number\n  text: string\n}>\n\nexport type DiagnosticLevel = \"Error\" | \"Warning\" | \"Information\" | \"Hint\" | \"\"\n\nexport type Diagnostic = ReadonlyDeep<{\n  file: string\n  lineNumber: number\n  severity: DiagnosticLevel\n  message: string\n}>\n\nexport type DiagnosticItem = ReadonlyDeep<{\n  file: string\n  lnum: number\n  message: string\n  severity: string\n}>\n"
  },
  {
    "path": "src/type/process.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport type { PROCESSES_NAME } from \"@/const/fzf-processes\"\nimport type { ResourceData } from \"@/type/resource\"\n\nexport type CallbackLine = string\nexport type CallbackLines = ReadonlyArray<CallbackLine>\n\nexport type Process = ReadonlyDeep<{\n  name: string\n  key: string\n  execute: (lines: ReadonlyArray<ResourceData>) => void | Promise<void>\n}>\n\nexport type Processes = ReadonlyDeep<ReadonlyArray<Process>>\n\nexport type ProcessesName = typeof PROCESSES_NAME[number]\n\nexport type ProcessesDefinition = ReadonlyDeep<\n  ReadonlyArray<{\n    name: ProcessesName\n    processes: Processes\n  }>\n>\n\nexport type UserProcesses =\n  | {\n      type: \"custom_processes_variable\"\n      value: ProcessesName\n    }\n  | {\n      type: \"global_variable\"\n      value: string\n    }\n\nexport type CustomProcessesVimVariable = ReadonlyDeep<{\n  [key in ProcessesName]: {\n    [key: string]: string\n  }\n}>\n\nexport type SingleLineConsumer = ReadonlyDeep<{\n  consume: (line: ReadonlyDeep<ResourceData>) => Promise<void>\n  kind: \"single\"\n}>\n\ntype BulkLineConsumer = ReadonlyDeep<{\n  consume: (lines: ReadonlyArray<ResourceData>) => Promise<void>\n  kind: \"bulk\"\n}>\n\ntype LineConsumer = SingleLineConsumer | BulkLineConsumer\n\nexport type CreateProcessCreator = (\n  processesName: ProcessesName\n) => (expectKey: string, lineConsumer: LineConsumer) => Process\n\nexport type OpenCommand = \"edit\" | \"split\" | \"vsplit\" | \"tabedit\" | \"drop\"\n"
  },
  {
    "path": "src/type/resource.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nimport type {\n  FzfCommandDynamicOption,\n  FzfCommandName,\n  GitAction,\n  GitBranchAction,\n  GitLogAction,\n  GitReflogAction,\n  GitStashAction,\n  GitStatusAction,\n} from \"@/type\"\n\nexport type FileData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"file\"\n  file: string\n  lineNumber?: undefined\n}>\n\nexport type LineData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"line\"\n  file: string\n  lineNumber: number\n  text: string\n}>\n\ntype BufferData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"buffer\"\n  file: string\n  bufnr: number\n  lineNumber?: undefined\n}>\n\ntype CommandPaletteData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"command-palette\"\n  name: string\n  lineNumber?: undefined\n}>\n\ntype GitActionData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-actions\"\n  action: GitAction\n  lineNumber?: undefined\n}>\n\nexport type GitStatusData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-status\"\n  action?: \"header\"\n  file: string\n  status: string\n  lineNumber?: undefined\n}>\n\ntype GitStatusActionData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-status-actions\"\n  action: GitStatusAction\n  files: ReadonlyArray<string>\n  lineNumber?: undefined\n}>\n\nexport type GitBranchData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-branch\"\n  name: string\n  date: string\n  author: string\n  isCreate: boolean\n  lineNumber?: undefined\n}>\n\ntype GitBranchActionData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-branch-actions\"\n  action: GitBranchAction\n  branches: ReadonlyArray<string>\n  lineNumber?: undefined\n}>\n\nexport type GitLogData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-log\"\n  hash: string\n  date: string\n  author: string\n  comment: string\n  isCurrentFile: boolean\n  lineNumber?: undefined\n}>\n\ntype GitLogActionData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-log-actions\"\n  action: GitLogAction\n  hashes: ReadonlyArray<string>\n  isCurrentFile: boolean\n  lineNumber?: undefined\n}>\n\nexport type GitStashData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-stash\"\n  name: string\n  hash: string\n  date: string\n  author: string\n  comment: string\n  isCreate: boolean\n  lineNumber?: undefined\n}>\n\ntype GitStashActionData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-stash-actions\"\n  action: GitStashAction\n  names: ReadonlyArray<string>\n  hashes: ReadonlyArray<string>\n  lineNumber?: undefined\n}>\n\nexport type GitReflogData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-reflog\"\n  name: string\n  hash: string\n  date: string\n  author: string\n  comment: string\n  lineNumber?: undefined\n}>\n\ntype GitReflogActionData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-reflog-actions\"\n  action: GitReflogAction\n  names: ReadonlyArray<string>\n  hashes: ReadonlyArray<string>\n  lineNumber?: undefined\n}>\n\ntype RegisterData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"register\"\n  lineNumber: number\n  text: string\n  option: string\n}>\n\ntype GitPrData = ReadonlyDeep<{\n  command: FzfCommandName\n  type: \"git-pr\"\n  prNumber?: number\n  lineNumber?: undefined\n}>\n\nexport type ResourceData =\n  | FileData\n  | LineData\n  | BufferData\n  | CommandPaletteData\n  | GitActionData\n  | GitStatusData\n  | GitStatusActionData\n  | GitBranchData\n  | GitBranchActionData\n  | GitLogData\n  | GitLogActionData\n  | GitStashData\n  | GitStashActionData\n  | GitReflogData\n  | GitReflogActionData\n  | RegisterData\n  | GitPrData\n\nexport type ResourceLine = ReadonlyDeep<{\n  data: ResourceData\n  displayText: string\n}>\n\nexport type ResourceLines = ReadonlyArray<ResourceLine>\n\ntype JsonResource = ReadonlyDeep<{\n  type: \"json\"\n  lines: ResourceLines\n  options?: FzfCommandDynamicOption\n}>\n\ntype TextResource = ReadonlyDeep<{\n  type: \"text\"\n  lines: ResourceLines\n  options?: FzfCommandDynamicOption\n}>\n\nexport type Resource = JsonResource | TextResource\n"
  },
  {
    "path": "src/type/rpc.ts",
    "content": "import type { BaseFzfCommandName } from \"@/type\"\n\nexport type RpcExecCommandParams = {\n  commandName: BaseFzfCommandName\n  args?: string\n}\n\nexport type RpcCallProcessParams = {\n  lines: ReadonlyArray<string>\n}\n\nexport type RpcExecProcessCallbackParams = {\n  processName: string\n  lines: ReadonlyArray<string>\n}\n\nexport type DispatchResumeQueryParams = {\n  commandName: BaseFzfCommandName\n  query: string\n}\n"
  },
  {
    "path": "src/type/syntax.ts",
    "content": "export type Color = \"black\" | \"red\" | \"green\" | \"yellow\" | \"blue\" | \"magenta\" | \"cyan\" | \"white\"\n"
  },
  {
    "path": "src/type/system.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nexport type CommandResult = ReadonlyDeep<{\n  stdout: string\n  stderr: string\n  status: number | null\n}>\n"
  },
  {
    "path": "src/type/vim-variable.ts",
    "content": "import type { VimValue } from \"neovim/lib/types/VimValue\"\nimport type { ReadonlyDeep } from \"type-fest\"\n\nimport type { vimOptions, vimVariableAssociation } from \"@/association/vim-variable\"\n\nexport type GlobalVariableName = keyof typeof vimVariableAssociation\nexport type GlobalVariables = ReadonlyDeep<{ [key in GlobalVariableName]: VimValue }>\nexport type VimOptionName = typeof vimOptions[number]\n"
  },
  {
    "path": "src/type/vim.ts",
    "content": "import type { ReadonlyDeep } from \"type-fest\"\n\nexport type VimBuffer = ReadonlyDeep<{\n  fileName: string\n  bufnr: number\n  isCurrent: boolean\n  isAlternate: boolean\n  isModified: boolean\n}>\n"
  },
  {
    "path": "src/util/align.test.ts",
    "content": "import { alignLists } from \"@/util/align\"\n\ndescribe(\"align lists\", () => {\n  it(\"align 1 digit\", () => {\n    const lists = [\n      [\"1\", \"a\"],\n      [\"2\", \"b\"],\n      [\"3\", \"c\"],\n    ]\n\n    expect(alignLists(lists)).toEqual([\n      [\"1\", \"a\"],\n      [\"2\", \"b\"],\n      [\"3\", \"c\"],\n    ])\n  })\n\n  it(\"align 3 digit\", () => {\n    const lists = [\n      [\"1\", \"foo\"],\n      [\"10\", \"bar\"],\n      [\"100\", \"foobar\"],\n    ]\n\n    expect(alignLists(lists)).toEqual([\n      [\"1  \", \"foo   \"],\n      [\"10 \", \"bar   \"],\n      [\"100\", \"foobar\"],\n    ])\n  })\n\n  it(\"align 5 digit\", () => {\n    const lists = [\n      [\"1\", \"a\"],\n      [\"10000\", \"bbbbb\"],\n    ]\n\n    expect(alignLists(lists)).toEqual([\n      [\"1    \", \"a    \"],\n      [\"10000\", \"bbbbb\"],\n    ])\n  })\n})\n"
  },
  {
    "path": "src/util/align.ts",
    "content": "import printf from \"printf\"\n\nimport { transpose } from \"@/util/array\"\n\nexport const alignLists = (lists: ReadonlyArray<ReadonlyArray<string>>): ReadonlyArray<ReadonlyArray<string>> => {\n  if (lists.length === 0) {\n    return lists\n  }\n\n  const maxes = transpose(lists).map((list) => list.reduce((acc, cur) => Math.max(acc, cur.length), 0))\n\n  return lists.map((list) => list.map((value, i) => printf(`%-${maxes[i]}s`, value)))\n}\n"
  },
  {
    "path": "src/util/array.ts",
    "content": "export const transpose = <T>(table: ReadonlyArray<ReadonlyArray<T>>): ReadonlyArray<ReadonlyArray<T>> =>\n  table[0].map((_, index) => table.map((row) => row[index]))\n\nexport const asyncFilter = async <T>(\n  array: ReadonlyArray<T>,\n  asyncCallback: (args: T) => Promise<boolean>\n): Promise<ReadonlyArray<T>> => {\n  const bits = await Promise.all(array.map(asyncCallback))\n\n  return array.filter((_, i) => bits[i])\n}\n"
  },
  {
    "path": "src/util/type.ts",
    "content": "export const unreachable = (_: never): never => _\n"
  },
  {
    "path": "src/util/uniq-with.ts",
    "content": "export const uniqWith = <T>(array: Array<T>, comparator: (a: T, b: T) => boolean): Array<T> => {\n  return array.reduce((acc: Array<T>, v1: T) => {\n    if (!acc.some((v2) => comparator(v1, v2))) {\n      acc.push(v1)\n    }\n\n    return acc\n  }, [])\n}\n"
  },
  {
    "path": "stylua.toml",
    "content": "indent_type = \"Spaces\"\nindent_width = 2\ncolumn_width = 120\nquote_style = \"AutoPreferSingle\"\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es2017\",\n    \"module\": \"commonjs\",\n    \"lib\": [\"es6\"],\n    \"esModuleInterop\": true,\n    \"moduleResolution\": \"node\",\n    \"skipLibCheck\": true,\n    \"strict\": true,\n    \"baseUrl\": \"./\",\n    \"rootDir\": \"./src\",\n    \"paths\": {\n      \"@/*\": [\"src/*\"]\n    },\n    \"outDir\": \"./build\",\n    \"noErrorTruncation\": true\n  },\n  \"exclude\": [\"node_modules\"],\n  \"include\": [\"./src/**/*.ts\"]\n}\n"
  },
  {
    "path": "tsconfig.webpack-jest.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"module\": \"commonjs\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"baseUrl\": \"./\",\n    \"rootDir\": \"./\"\n  }\n}\n"
  },
  {
    "path": "webpack.coc.ts",
    "content": "import path from \"path\"\nimport { DefinePlugin } from \"webpack\"\nimport { merge } from \"webpack-merge\"\n\nimport common from \"./webpack.common\"\n\nexport default merge(common, {\n  entry: \"./src/coc.ts\",\n  externals: {\n    \"coc.nvim\": \"commonjs coc.nvim\",\n  },\n  output: {\n    path: path.join(__dirname, \"lib\"),\n    filename: \"coc.js\",\n    libraryTarget: \"commonjs\",\n  },\n  plugins: [\n    new DefinePlugin({\n      PLUGIN: JSON.stringify({\n        ENV: \"coc\",\n      }),\n    }),\n  ],\n})\n"
  },
  {
    "path": "webpack.common.ts",
    "content": "import path from \"path\"\nimport type { Configuration } from \"webpack\"\n\nconst common: Configuration = {\n  target: \"node\",\n  mode: \"none\",\n  resolve: {\n    mainFields: [\"module\", \"main\"],\n    extensions: [\".js\", \".ts\"],\n    alias: {\n      \"@\": path.resolve(__dirname, \"src\"),\n    },\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.ts$/,\n        include: [path.resolve(__dirname, \"src\")],\n        loader: \"ts-loader\",\n        options: {\n          transpileOnly: true,\n        },\n      },\n    ],\n  },\n  externals: {\n    // NOTE: Disable `node:{module}` import\n    // SEE: https://github.com/webpack/webpack/issues/14166\n    \"node:process\": \"commonjs2 process\",\n    \"node:os\": \"commonjs2 os\",\n    \"node:tty\": \"commonjs2 tty\",\n  },\n  ignoreWarnings: [{ module: /yargs/ }],\n  node: {\n    __dirname: false,\n    __filename: false,\n  },\n}\n\nexport default common\n"
  },
  {
    "path": "webpack.preview.ts",
    "content": "import fs from \"fs\"\nimport path from \"path\"\nimport type { Configuration } from \"webpack\"\nimport { BannerPlugin } from \"webpack\"\n\nconst preview: Configuration = {\n  entry: \"./scripts/preview.js\",\n  output: {\n    path: path.join(__dirname, \"bin\"),\n    filename: \"preview_fzf_grep\",\n    libraryTarget: \"commonjs\",\n  },\n  target: \"node\",\n  mode: \"production\",\n  resolve: {\n    mainFields: [\"module\", \"main\"],\n    extensions: [\".js\"],\n  },\n  node: {\n    __dirname: false,\n    __filename: false,\n  },\n  plugins: [\n    new BannerPlugin({ banner: \"#!/usr/bin/env node\\n\", raw: true }),\n    function addExec(): void {\n      this.hooks.done.tap(\"chmod\", () => {\n        fs.chmodSync(path.resolve(__dirname, \"bin\", \"preview_fzf_grep\"), \"755\")\n      })\n    },\n  ],\n}\n\nexport default preview\n"
  },
  {
    "path": "webpack.remote.ts",
    "content": "import path from \"path\"\nimport { DefinePlugin } from \"webpack\"\nimport { merge } from \"webpack-merge\"\n\nimport common from \"./webpack.common\"\n\nexport default merge(common, {\n  entry: \"./src/remote.ts\",\n  externals: {\n    \"coc.nvim\": \"commonjs2 coc.nvim\",\n  },\n  output: {\n    path: path.join(__dirname, \"rplugin/node/fzf-preview.vim\"),\n    filename: \"index.js\",\n    libraryTarget: \"commonjs2\",\n  },\n  plugins: [\n    new DefinePlugin({\n      PLUGIN: JSON.stringify({\n        ENV: \"remote\",\n      }),\n    }),\n  ],\n})\n"
  },
  {
    "path": "webpack.rpc.ts",
    "content": "import path from \"path\"\nimport { DefinePlugin } from \"webpack\"\nimport { merge } from \"webpack-merge\"\n\nimport common from \"./webpack.common\"\n\nexport default merge(common, {\n  entry: \"./src/rpc.ts\",\n  externals: {\n    \"coc.nvim\": \"commonjs coc.nvim\",\n  },\n  output: {\n    path: path.join(__dirname, \"lib\"),\n    filename: \"rpc.js\",\n    libraryTarget: \"commonjs\",\n  },\n  plugins: [\n    new DefinePlugin({\n      PLUGIN: JSON.stringify({\n        ENV: \"rpc\",\n      }),\n    }),\n  ],\n})\n"
  }
]