From e6e1dda74dcda63972b5bb136bc4df5771d99039 Mon Sep 17 00:00:00 2001 From: Philippe Richard Date: Fri, 12 Jan 2024 09:31:49 -0500 Subject: [PATCH] fix(#26): set signcolumn to `yes` for netrw buffers (#27) Some users may want to disable the signcolumn globally, and still use the netrw plugin. This change sets the signcolumn value to `yes` locally. Fixes #26. Thank you @shesmu for raising the issue and suggesting to make it part of the plugin :) --- .luacheckrc | 4 ++-- lua/netrw/config.lua | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 14072db..46e8a2b 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,10 +1,10 @@ stds.nvim = { - read_globals = { + globals = { "vim", }, } std = "lua51+nvim" include_files = { - "lua/**/*.lua", + "lua/**/*.lua", } diff --git a/lua/netrw/config.lua b/lua/netrw/config.lua index 9a40a77..632e0f1 100644 --- a/lua/netrw/config.lua +++ b/lua/netrw/config.lua @@ -30,6 +30,9 @@ function M.setup(options) return end + -- Forces the usage of signcolumn in netrw buffers. + vim.opt_local.signcolumn = "yes" + local bufnr = vim.api.nvim_get_current_buf() require("netrw.ui").embelish(bufnr) require("netrw.actions").bind(bufnr)