nvim-autopairs icon indicating copy to clipboard operation
nvim-autopairs copied to clipboard

Clarification of documentation

Open thecontinium opened this issue 3 years ago • 0 comments

Description

In the docs we have:

`ONLY_CR(COND)` ~

This shortcut method disables the "pair", "del", and "move" events by setting a
single predicate for each that is always false. Additionally, the effect of any
`use_key` modifiers are removed as well. If `cond` is specified, a "newline"
predicate is set as if `with_cr` were called.

This method is convenient for defining _simple_ end-wise rules. As an example,
a default rule is defined with `only_cr` for Markdown code blocks with an
explicit language; the closing triple-backtick is not completed until you press
`<CR>` after specifying the language:

>
    ```lua  <-- <CR> pressed here
    |
    ```
<

but I see the last three ``` before I press CR

Mapping bug

NA

Steps to reproduce

From the above docs I was expecting to see


   ```lua|

and the on CR

    ```lua
    |
    ```

but after typing ``` I see


    ```|```
 

then I type lua and see


    ```lua|```
 

then after CR


    ```lua
    |
    ```
 

Is this correct ?

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'windwp/nvim-autopairs',
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('nvim-autopairs').setup()
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing nvim-autopairs and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]

thecontinium avatar Jul 06 '22 05:07 thecontinium