Skip to content

Bug: (Extremely low priority) filetype component - Extra space after icon #1453

@monr3d

Description

@monr3d

Self Checks

  • I'm using the latest lualine.
  • I didn't find the issue in existing issues or PRs.

How to reproduce the problem

Enable filetype component with icon only or align right

Expected behaviour

there shouldn't be and extra space after the icon or a to add/remove it
Image
Image
Image
Image (this actually is fine)

Actual behaviour

there is an annoying (to me) space after the icon in the filetype module
Image
Image
Image
Image

Minimal config to reproduce the issue

require("lualine").setup({
    sections = {
        lualine_a = { { "mode" }, },
        lualine_b = { { "filetype", icon_only = true }, }
    },
}

Additional information

I'm not sure if there is a reason for the space or if it is the author design choice.
As you can see from the screenshot I already fixed for myself, but I don't want to have a fork just for that, if the change is welcome I can submit a PR as it is a very simple edit.
Although the screenshots show my config, I tried a few separators and the problem persist, if there is a case where it is useful i can be made optional.

This is the code responsible:

if icon then
icon = icon .. ' '
end

if icon then
icon = icon .. ' '
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions