Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowed for config.center.desc = '' #329

Merged
merged 3 commits into from
Mar 9, 2023

Conversation

AlphabetsAlphabets
Copy link
Contributor

  local col = line:find('%w')
  if col then
    col = col - 1
  else
    col = 0
  end

Added this change and removed all lines that use col - 1.

This made it possible to do this

      require("dashboard").setup {
        theme = 'doom',
        config = {
          header = opts.header,
          footer = { opts.footer },
          center = {
            {
              desc = '',
            },
          },
        }
      }

A small note is that some the cursor is visible and all the way on the left and I can't figure out where to place the cursor. I've been looking for ways to hide the cursor, this should probably be in a separate issue or discussion.

@@ -108,7 +108,12 @@ local function generate_center(config)

local line = api.nvim_buf_get_lines(config.bufnr, first_line, first_line + 1, false)[1]
local col = line:find('%w')
api.nvim_win_set_cursor(config.winid, { first_line + 1, col - 1 })
if col then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

col = col and col -1 or 0

Copy link
Contributor Author

@AlphabetsAlphabets AlphabetsAlphabets Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glepnir glepnir merged commit 69f4c3f into nvimdev:master Mar 9, 2023
glepnir added a commit that referenced this pull request Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants