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

short_file_names cannot hide all path

Open Jaehaks opened this issue 1 year ago • 9 comments

Thank you for you effort. I'm windows 10 user with nvim-qt.

I installed this plugin and set short_file_names = true to show only filename + extension. But the behavior is the same with short_file_names = false. All lists show their path. If files are in subdirectory of current path, relative path is shown. If files are in parent directory of current path, absolute path is shown. Is It normal?

image

this is my configuraiton

bm.setup({
  select_menu_item_commands = {
    edit = {
      key = '<CR>',
      command = 'edit'
    },
    v = {
      key = '<C-v>',
      command = 'vsplit'
    },
    h = {
      key = '<C-h>',
      command = 'split'
    },
  },
  short_file_names = true, -- show shorten filename
  short_term_names = true,
  loop_nav = true,
})

one more question.,. The vsplit / split mapping doesn't work. <C-v> works as visual block only

Jaehaks avatar May 03 '24 14:05 Jaehaks

Hello. Thanks for the feedback. This feature does not work on Windows yet. As for the vsplit/split mappings, you should not have any problems. Maybe those mappings are overridden somewhere in normal mode.

j-morano avatar May 05 '24 16:05 j-morano

@j-morano
I see. I think the reason is that buffer_manager.nvim deals path wiht '/' as delimiter only.

Jaehaks avatar May 15 '24 01:05 Jaehaks

@j-morano I thought that this problem is caused by windows path delimiter.

I checked the M.toggle_quick_menu() and found that config.short_file_names is always false although I set this option in configuration.

Jaehaks avatar May 15 '24 12:05 Jaehaks

I'm having the same issue in Fedora. Short_file_names doesn't work, shows me the full path.

bdemirtas avatar May 21 '24 23:05 bdemirtas

I'm having the same issue in Fedora. Short_file_names doesn't work, shows me the full path.

I am using Fedora, and it is working. Can you provide more details? So I can try to reproduce it.

j-morano avatar May 22 '24 06:05 j-morano

I created the branch windows-separator and added a commit to try to solve this issue. Can you give it a try to check if the problem perists?

j-morano avatar May 22 '24 07:05 j-morano

I'm having the same issue in Fedora. Short_file_names doesn't work, shows me the full path.

I am using Fedora, and it is working. Can you provide more details? So I can try to reproduce it.

When I have multiple nested folders, it become very long and continue on the second line. My config it's pretty much what's in the README.md.

config

{
		"j-morano/buffer_manager.nvim",
		dependencies = "nvim-lua/plenary.nvim",
		lazy = false,
		keys = {
			{ "<leader>db", ":Bdelete<CR>", desc = "Delete Buffer" },
		},
		config = function()
			require("buffer_manager").setup({
				vim.keymap.set(
					{ "t", "n" },
					"<leader>fb",
					require("buffer_manager.ui").toggle_quick_menu,
					{ noremap = true, desc = "Buffers List" }
				),

				select_menu_item_commands = {
					v = {
						key = "<C-v>",
						command = "vsplit",
					},
					h = {
						key = "<C-h>",
						command = "split",
					},
				},
				focus_alternate_buffer = false,
				short_file_names = true,
        order_buffers = "filename",
				loop_nav = true,
				highlight = "Normal:BufferManagerBorder",
				win_extra_options = {
					winhighlight = "Normal:BufferManagerNormal",
				},
			})
		end,
	},

Screenshot from 2024-05-24 05-51-39

bdemirtas avatar May 24 '24 09:05 bdemirtas

I created the branch windows-separator and added a commit to try to solve this issue. Can you give it a try to check if the problem perists?

@j-morano I tested the commit 2b0e03e of branch 'windows-separator'

It does not work like I thoght it would.
This is result of the commit. it still does not apply the configuraiton.
It shows backslash at first region of path. but change to slash after USER directory image

It is the result of adding get_config() in toggle_quick_menu() It recognize the short_file_names feature. but cannot change to short name entirely. image

Jaehaks avatar May 25 '24 10:05 Jaehaks

Thank you for your effort. I do not have access to a Windows machine, so I welcome any help to solve this issue.

j-morano avatar May 31 '24 08:05 j-morano