Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

How to decrease padding size? #209

Open
javeoff opened this issue Feb 28, 2023 · 4 comments
Open

How to decrease padding size? #209

javeoff opened this issue Feb 28, 2023 · 4 comments

Comments

@javeoff
Copy link

javeoff commented Feb 28, 2023

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

image

@sudoCompetence
Copy link

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

@cxzhou35
Copy link

Same problem with yours, It is really unpleasant!!

@sudoCompetence
Copy link

I believe I fixed this.

#165 (comment)

@hedyhli
Copy link

hedyhli commented Nov 8, 2023

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 --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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants