Cursor doesn't move when I accept multi-line suggestions #2

Closed
opened 2024-05-11 02:20:56 -04:00 by amirhhashemi · 4 comments
amirhhashemi commented 2024-05-11 02:20:56 -04:00 (Migrated from github.com)

I have the following code:

export function useCreateClient() {
    const queryClient = useQueryClient();

    return useMutation({>|<
>>      mutationFn: async (data) => {
}

>|< represents the cursor and the lines started with >> represent the Supermaven suggestion. When I accept the suggestion with Tab, the suggested code inserts but the cursor stays where it was:

export function useCreateClient() {
    const queryClient = useQueryClient();

    return useMutation({>|<
>>      mutationFn: async (data) => {
        mutationFn: async (data) => {
}

As the result, I get the same suggestion again. No matter how many time I accept the suggestion, it gives me the same suggestion over and over again:

export function useCreateClient() {
    const queryClient = useQueryClient();

    return useMutation({>|<
>>      mutationFn: async (data) => {
        mutationFn: async (data) => {
        mutationFn: async (data) => {
        mutationFn: async (data) => {
        mutationFn: async (data) => {
}

This does not happen when the suggestion is on the same line as the cursor.

I'm using the latest nightly release of neovim:

NVIM v0.10.0-dev-3103+gca735c755

And I'm using the Pro version.

I have the following code: ```ts export function useCreateClient() { const queryClient = useQueryClient(); return useMutation({>|< >> mutationFn: async (data) => { } ``` `>|<` represents the cursor and the lines started with `>>` represent the Supermaven suggestion. When I accept the suggestion with Tab, the suggested code inserts but the cursor stays where it was: ```ts export function useCreateClient() { const queryClient = useQueryClient(); return useMutation({>|< >> mutationFn: async (data) => { mutationFn: async (data) => { } ``` As the result, I get the same suggestion again. No matter how many time I accept the suggestion, it gives me the same suggestion over and over again: ```ts export function useCreateClient() { const queryClient = useQueryClient(); return useMutation({>|< >> mutationFn: async (data) => { mutationFn: async (data) => { mutationFn: async (data) => { mutationFn: async (data) => { mutationFn: async (data) => { } ``` This does not happen when the suggestion is on the same line as the cursor. I'm using the latest nightly release of neovim: ``` NVIM v0.10.0-dev-3103+gca735c755 ``` And I'm using the Pro version.
super-jacob commented 2024-05-12 10:29:41 -04:00 (Migrated from github.com)

We're having trouble reproducing this. Could you provide some more information about your setup? Do you have any other plugins installed or any custom keybindings that could affect this?

We're having trouble reproducing this. Could you provide some more information about your setup? Do you have any other plugins installed or any custom keybindings that could affect this?
amirhhashemi commented 2024-05-12 11:06:59 -04:00 (Migrated from github.com)

I don't think any of my plugins or keybindings could affect this, but I can investigate it. https://github.com/supermaven-inc/supermaven-nvim/pull/5 fixed the issue though.

I don't think any of my plugins or keybindings could affect this, but I can investigate it. https://github.com/supermaven-inc/supermaven-nvim/pull/5 fixed the issue though.
amirhhashemi commented 2024-05-12 11:12:35 -04:00 (Migrated from github.com)

I was able to reproduce it in a clean install with this config:

-- init.lua

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
    {
      "supermaven-inc/supermaven-nvim",
      config = function()
        require("supermaven-nvim").setup({})
      end,
    },
}, {})
I was able to reproduce it in a clean install with this config: ```lua -- init.lua local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ { "supermaven-inc/supermaven-nvim", config = function() require("supermaven-nvim").setup({}) end, }, }, {}) ```
Hashiraee commented 2024-05-12 12:25:32 -04:00 (Migrated from github.com)

With:

NVIM v0.10.0-dev-3117+g4e5c633ed
Build type: RelWithDebInfo
LuaJIT 2.1.1713484068

And:

-- init.lua

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
    {
      dir="~/Dev/nvim/plugin/supermaven-nvim", -- This includes PR #7 
      config = function()
        require("supermaven-nvim").setup({})
      end,
    },
}, {})

Using PR #7 i get the correct behaviour and this does not occur anymore.

With: ``` NVIM v0.10.0-dev-3117+g4e5c633ed Build type: RelWithDebInfo LuaJIT 2.1.1713484068 ``` And: ``` -- init.lua local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ { dir="~/Dev/nvim/plugin/supermaven-nvim", -- This includes PR #7 config = function() require("supermaven-nvim").setup({}) end, }, }, {}) ``` Using PR #7 i get the correct behaviour and this does not occur anymore.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
supermaven-inc/supermaven-nvim#2
No description provided.