Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(telescope): support live preview of currently selected colorscheme #1085

Merged
merged 1 commit into from
Nov 30, 2023
Merged

feat(telescope): support live preview of currently selected colorscheme #1085

merged 1 commit into from
Nov 30, 2023

Conversation

Cyberczy
Copy link
Contributor

When I use fc to switch colorschemes,I can't see the change in real time.
So I made some changes

Signed-off-by: Cyberczy <109653523+Cyberczy@users.noreply.github.com>
@Cyberczy
Copy link
Contributor Author

before.mp4

@Cyberczy
Copy link
Contributor Author

after.mp4

Copy link
Owner

@ayamir ayamir left a comment

Choose a reason for hiding this comment

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

In fact, alpha.lua is also needed to change.

@Cyberczy
Copy link
Contributor Author

Cyberczy commented Nov 30, 2023

事实上,alpha.lua也是需要改变的。

yup, I had that problem too,and I'll try to fix it later

@CharlesChiuGit
Copy link
Collaborator

nice work!

@Cyberczy
Copy link
Contributor Author

Cyberczy commented Nov 30, 2023

In fact, alpha.lua is also needed to change.

I made the same change in alpha.lua, but it didn't work

@Cyberczy
Copy link
Contributor Author

In fact, alpha.lua is also needed to change.

I made the same change in alpha.lua, but it didn't work

it.didn.t.work.mp4

@Cyberczy Cyberczy requested a review from ayamir November 30, 2023 07:19
@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Nov 30, 2023

I change the lazy event of telescope.nvim to BufWinEnter, but it also wont change the colorscheme in realtime.

I also went dig some docs about alpha.nvim and telescope.nvim, can't find any useful info tho.

image

@Cyberczy
Copy link
Contributor Author

I change the lazy event of telescope.nvim to BufWinEnter, but it also wont change the colorscheme in realtime.

I also went dig some docs about alpha.nvim and telescope.nvim, can't find any useful info tho.

image

I had the same problem when using nvim-tree
nvim-tree

@Cyberczy
Copy link
Contributor Author

2023-11-30.16-38-53.mp4

In this video, you can clearly see that the README.md file works properly, but the nvim-tree file does not

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Nov 30, 2023

i think it's about special filetype, for example, alpha's bufer filetype is alpha and nvim-tree's bufer filetype is NvimTree.

image
image

@Cyberczy
Copy link
Contributor Author

yup, but I'm running out of ideas

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Nov 30, 2023

@Jint-lzxy
Copy link
Collaborator

I made the same change in alpha.lua, but it didn't work

AFAIU this is the expected behavior under the current implementation. Since these buffers aren't included in the listed buffer list, there's no simple way to open such a buffer in another window, and setting the current colorscheme to itself in those buffers (e.g, running :colorscheme catppuccin again when the current colorscheme is already catppuccin) is usually not supported across implementations. And this is also the behavior when Telescope is first opened (because the caret defaults to point to the current active colorscheme.) The following one-liner intuitively demonstrates this:

nvim unlisted_buffer "+set nobuflisted | Telescope colorscheme enable_preview=true"

So I'm kinda on the fence about whether to include this patch in our defaults, because it doesn't work as expected in some (rather common) use cases.

@Cyberczy
Copy link
Contributor Author

So I'm kinda on the fence about whether to include this patch in our defaults, because it doesn't work as expected in some (rather common) use cases.

Thank you no matter what

@ayamir
Copy link
Owner

ayamir commented Nov 30, 2023

I tend to merge it and add the exception situations to wiki.

Copy link
Collaborator

@CharlesChiuGit CharlesChiuGit left a comment

Choose a reason for hiding this comment

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

I think this is gd enough too. agree with ayamir

Copy link
Collaborator

@Jint-lzxy Jint-lzxy left a comment

Choose a reason for hiding this comment

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

Agree with this too lol @Cyberczy thanks for the great work here!

@Jint-lzxy Jint-lzxy changed the title refactor <leader>fc feat(telescope): support live preview of currently selected colorscheme Nov 30, 2023
@Jint-lzxy Jint-lzxy merged commit d1c852e into ayamir:main Nov 30, 2023
2 checks passed
singlemancombat pushed a commit to singlemancombat/nvim-config that referenced this pull request Dec 3, 2023
…me (ayamir#1085)

Signed-off-by: Cyberczy <109653523+Cyberczy@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants