Comment.nvim icon indicating copy to clipboard operation
Comment.nvim copied to clipboard

Comment broke the indentation

Open GNITOAHC opened this issue 1 year ago • 0 comments

neovim version:

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202

Just find out after upgrading to neovim version v0.10.0, the visual mode comment will break the indentation.

Original code:

type MyType struct {
    Name string
    Id   int
}

Before upgrading to v0.10.0, after visual mode select and gc

// type MyType struct {
//     Name string
//     Id   int
// }

But now it became as following, which won't push back the other line of code.

// type MyType struct {
//  Name string
//  Id   int
// }

I've tested on lua, too. Before:

{
    "numToStr/Comment.nvim",
    config = function()
      require("Comment").setup({
        pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), 
      })
    end,
    dependencies = { "JoosepAlviste/nvim-ts-context-commentstring" },
},

After commenting:

-- {
--  "numToStr/Comment.nvim",
--  config = function()
--      require("Comment").setup({
--      pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), 
--  })
--  end,
--  dependencies = { "JoosepAlviste/nvim-ts-context-commentstring" },
-- },

GNITOAHC avatar May 18 '24 03:05 GNITOAHC