simrat39 / symbols-outline.nvim

A tree like view for symbols in Neovim using the Language Server Protocol. Supports all your favourite languages.
MIT License
1.85k stars 100 forks source link

How to decrease padding size? #209

Open javeoff opened 1 year ago

javeoff commented 1 year ago

I have left pading with 3 spaces, how to decrease it?

image
sudoCompetence commented 1 year ago

I have the exact same question, mine it much larger than your as well.

cxzhou35 commented 1 year ago

Same problem with yours, It is really unpleasant!!

sudoCompetence commented 1 year ago

I believe I fixed this.

https://github.com/simrat39/symbols-outline.nvim/issues/165#issuecomment-1718489289

hedyhli commented 11 months ago

Hi everyone,

Unfortunately, it seems like simrat39 isn't very active in this plugin lately, so a few days ago I've decided to fork the repo to implement a lot of features people have asked for and fixes users reported from this repo.

Thanks @sudoCompetence for the suggested fix. Unfortunately, the extra padding does not originate from window settings, but it is due to symbols-outline guide markers. Below is the diff which, I believe, is the actual fix to this issue.

Show diff ```diff diff --git a/lua/symbols-outline/parser.lua b/lua/symbols-outline/parser.lua index d1945fb..e0088ed 100644 --- a/lua/symbols-outline/parser.lua +++ b/lua/symbols-outline/parser.lua @@ -118,12 +118,10 @@ function M.get_lines(flattened_outline_items) end for index, _ in ipairs(line) do -- all items start with a space (or two) if config.options.guides.enabled then -- makes the guides and add guide markers local guide_markers = config.options.guides.markers if index == 1 then - line[index] = ' ' + line[index] = '' -- if index is last, add a bottom marker if current item is last, -- else add a middle marker elseif index == #line then @@ -177,6 +175,7 @@ function M.get_lines(flattened_outline_items) running_length = running_length + vim.fn.strlen(line[index]) end + line[1] = '' local final_prefix = line local string_prefix = t_utils.table_to_str(final_prefix) ```

I've recently pushed this fix to my fork.

You are welcome to try it out but do note that some new features may be experimental (unstable). These along with other fixes are listed in the readme.