Skip to content

feat: buf highlights for current buffer fuzzy find #732

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

Merged
merged 5 commits into from
Apr 6, 2021

Conversation

tjdevries
Copy link
Member

2021-04-06 12-16-02

Don't know why the picture is weird, but gives you the right idea at least.

@@ -685,14 +685,30 @@ function make_entry.gen_from_buffer_lines(opts)
separator = ' │ ',
items = {
{ width = 5 },
{ remaining = true },
{ dynamic_highlight = true, },
Copy link
Member

Choose a reason for hiding this comment

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

Is that actually a thing? I think you solved this differently so we should change that line back to not confuse people reading that code :)

Copy link
Member Author

Choose a reason for hiding this comment

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

well technically, I don't think remaining = true does anything either haha

Copy link
Member

Choose a reason for hiding this comment

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

Good call.
Just thinking out load: We should probably make it explicit and error on wrong key input, so people aren't up being confused if they have a typo, when using width or right_justify or something sunjon wanted some time ago, was right side align, not column but result side (currently not possible because we need to lazy evaluate the result window width).

For me it makes sense to validate the items tbl.

Copy link
Member

@Conni2461 Conni2461 left a comment

Choose a reason for hiding this comment

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

Tested it. Works like a charm. Lets ship it :)

Thanks tj :) also treesitter is amazing

@kkharji
Copy link
Member

kkharji commented Apr 6, 2021

Amazing work @tjdevries works well

@tjdevries tjdevries merged commit 0b2c801 into master Apr 6, 2021
williamboman added a commit to williamboman/telescope.nvim that referenced this pull request Apr 14, 2021
* upstream/master:
  picker(live_grep): add option to grep only over open files (nvim-telescope#666)
  git(action): create and checkout branch (nvim-telescope#755)
  readme: fix broken links and spelling errors (nvim-telescope#753)
  added a new DynamicFinder (which can be used with rust_analyzer) (nvim-telescope#705)
  feat: add icons to git_status finder (nvim-telescope#401)
  fix: update to newer code (nvim-telescope#744)
  pickers(buffers): added only_cwd opt (nvim-telescope#739)
  feat: asyncify pickers - except for live_grep (nvim-telescope#709)
  fix: Use standardized names for current buffer fuzzy find (nvim-telescope#737)
  fix(git_branches): use the quoted fields instead of json-formatting and fix regressions with nvim-telescope#695 (nvim-telescope#704)
  feat: buf highlights for current buffer fuzzy find (nvim-telescope#732)
@jesseleite
Copy link
Contributor

jesseleite commented May 19, 2021

Hey @tjdevries, absolutely love this one, BUT...

If I have treesitter highlighting disabled for a specific syntax, ie)

require'nvim-treesitter.configs'.setup {
  ensure_installed = "maintained",
  highlight = {
    enable = true,
    disable = {'php'},
  },
}

Opening this finder will not only use treesitter in the results view, but will switch to treesitter highlighting in my actual file buffer as well. I can flip back to polyglot highlighting after closing telescope by running :e, but it's a bit annoying when I've intentionally ignored the syntax in my treesitter config, nawmean?

PS. Don't judge me. I want to fully switch to treesitter, but the php implementation is a bit buggy in my experience compared to polyglot. I'll get there though!

PSS. Don't judge me, for developing in PHP instead of Rust.

@clason clason deleted the current_buf_highlights branch August 13, 2021 11:23
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.

4 participants