Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Cannot enter Operator mode with :MagmaEvaluateOperator with lazy.nvim #102

Open
dtetruash opened this issue Aug 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@dtetruash
Copy link

dtetruash commented Aug 9, 2023

Describe the bug
I am unable to find the proper definition for the keymap settings for :MagmaEvaluateOperator within a lazy.nvim set up. The provided vimscript mapping for the same command given in README.md works.

To Reproduce
Steps to reproduce the behavior:

  1. Use the following keymap (as per Add LAzyVim config options to README and sign it #94 and others):
    return {
      {
        "dccsillag/magma-nvim",
        version = "*",
        build = ":UpdateRemotePlugins",
        lazy = false,
        keys = {
          {
            "<leader>r",
            "<cmd>MagmaEvaluateOperator<CR>",
            desc = "Evaluate given operator",
            {
              noremap = true,
              expr = true,
              silent = true,
            },
          },
        },
      },
  2. Initialize a kernel in a buffer with :MagmaInit
  3. Try to evaluate a given paragraph of text with the cursor on it using <leader>rip
  4. See the character "p" be inserted at cursor instead of the paragraph being interpreted.

Note: Plugin works, is initialized correctly, and commands like :MagmaEvaluateLine work as expected.

Expected behavior
The paragraph being evaluated as seen in the preview GIF in README.md

Desktop (please complete the following information):

  • OS: Linux/Manjaro
  • Version
NVIM v0.9.0-dev-1355+gb2d10aa01
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/home/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src -I/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include

  system vimrc file: "$VIM/sysinit.vim"
 fall-back for $VIM: "/share/nvim"
@dtetruash dtetruash added the bug Something isn't working label Aug 9, 2023
@yunus-sun
Copy link

Describe the bug I am unable to find the proper definition for the keymap settings for :MagmaEvaluateOperator within a lazy.nvim set up. The provided vimscript mapping for the same command given in README.md works.

To Reproduce Steps to reproduce the behavior:

  1. Use the following keymap (as per Add LAzyVim config options to README and sign it #94 and others):
    return {
      {
        "dccsillag/magma-nvim",
        version = "*",
        build = ":UpdateRemotePlugins",
        lazy = false,
        keys = {
          {
            "<leader>r",
            "<cmd>MagmaEvaluateOperator<CR>",
            desc = "Evaluate given operator",
            {
              noremap = true,
              expr = true,
              silent = true,
            },
          },
        },
      },
  2. Initialize a kernel in a buffer with :MagmaInit
  3. Try to evaluate a given paragraph of text with the cursor on it using <leader>rip
  4. See the character "p" be inserted at cursor instead of the paragraph being interpreted.

Note: Plugin works, is initialized correctly, and commands like :MagmaEvaluateLine work as expected.

Expected behavior The paragraph being evaluated as seen in the preview GIF in README.md

Desktop (please complete the following information):

  • OS: Linux/Manjaro
  • Version
NVIM v0.9.0-dev-1355+gb2d10aa01
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/home/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src -I/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include

  system vimrc file: "$VIM/sysinit.vim"
 fall-back for $VIM: "/share/nvim"

I also encountered this issue, and I found a solution by defining the key mappings as follows:

  vim.cmd[[
  nnoremap <expr><silent> <Leader>r  nvim_exec('MagmaEvaluateOperator', v:true)
  ]]

If you have any better solutions, I would appreciate it if you could share them with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants