Skip to content

Conversation

@thisisrandy
Copy link

Adds total_lines_in_location option to display location as current_line/total_lines:current_col. Two notes:

  1. I modeled location.lua off of fileformat.lua in order to have access to self.options. This may not be the best approach.
  2. This PR is INCOMPLETE. In particular, it doesn't include docs updates. There might reasonably be a test to write, too. Haven't explored that yet. The motivation for the current PR is to see if the maintainers approve of the approach and solicit any comments.

@thisisrandy
Copy link
Author

Addresses #1333

@thisisrandy
Copy link
Author

I'm trying to test locally and running into some issues. What exactly is meant (from CONTRIBUTING.md) by "For running tests you'll have to make sure lualine.nvim, plenary.nvim and nvim-web-devicons are in same directory"? The expected directory tree would be helpful.

I interpretted this as, "copy the contents of the plenary/icons lua and scripts dirs into the same dirs in your lualine dir," and that got me through linting without any errors. However, make test unhelpfully outputs the following and then immediately exits with 0:

nvim --headless --noplugin -u scripts/minimal.vim -c "PlenaryBustedDirectory tests/plenary/ {minimal_init = 'tests/minimal_init.vim', sequential = true}"
Starting...%

@thisisrandy
Copy link
Author

This hasn't generated any traction as a draft after some months, so I'm going to mark it as ready for review. I'll reiterate that it's incomplete inasmuch as it currently lacks documentation.

@thisisrandy thisisrandy marked this pull request as ready for review January 12, 2025 09:17
@djsigmann
Copy link

I'd personally really like this, having to hit <C-g> every time I open a large file is a bit annoying.

@zeta-squared
Copy link

zeta-squared commented May 13, 2025

This is a fantastic addition to the repo that should be included. While this PR awaits approval is there any way to implement your change without editing the source code? I.e. can this be done from our personal config?

EDIT: Nevermind I've seen in the docs that you can use a lua function as a custom component.

@djsigmann
Copy link

This is a fantastic addition to the repo that should be included. While this PR awaits approval is there any way to implement your change without editing the source code? I.e. can this be done from our personal config?

EDIT: Nevermind I've seen in the docs that you can use a lua function as a custom component.

One could also use a plugin manager to pull this PR into your local copy of lualine, e.g. (for lazy):

return {
	url = 'https://github.com/nvim-lualine/lualine.nvim',
	build = {
		'git pull --no-rebase --no-commit origin pull/1334/head', -- PR that includes more customization options for the `location` component
	},
	dependencies = {
		'https://github.com/nvim-tree/nvim-web-devicons',
	},
}

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.

3 participants