Comments (10)
from package-info.nvim.
I think I have a path to a solution
When you highlight the virtual text you use the highlight param guifg=#hexcode
. I think guifg
only works with termguicolor
enabled. The highlight option that works with 256 colors is ctermfg=colorcode
. e.g. ctermfg=136
would be the closest color to your outdated default.
So this would require a more complicated utils.helpers.M.register_highlight_group()
that understands what mode to operate in and likely more complicated default options. Like if termguicolor
is false, use ctermfg
.
Unsure when I might get to a patch for this, but at least it's a way forward.
from package-info.nvim.
Hey, thanks for checking out the plugin.
I think I know what the problem is. I'll take care of it tomorrow morning.
from package-info.nvim.
Then virtual text colors are not observed. The rest of the display seems fine.
Just to be on the same page, when you say observed, you mean you get no colors at all if you disable icons? Would you mind sharing a screenshot?
I just tried disabling icons and am getting the highlight working on my end:
from package-info.nvim.
I just tried this morning and saw no color highlighting with icons enabled or disabled. Like many people I have a slew of plugins enabled so I created a new init.lua that only loads your plugin:
local cmd = vim.cmd -- Vim commands e.g. cmd('pwd')
cmd 'packadd paq-nvim' -- load the package manager
local paq = require('paq-nvim').paq
paq {'savq/paq-nvim', opt = true} -- paq-nvim manages itself
paq {'vuki656/package-info.nvim'} -- package.json versioning
require('package-info').setup {
icons = {
style = {
up_to_date = "| =", -- Icon for up to date packages
outdated = "| -", -- Icon for outdated packages
},
}
}
paq {'nanotech/jellybeans.vim'}
cmd('colorscheme jellybeans')
And still no highlights in Terminal.app
So I thought to myself, this thing might be intended to be used with truecolor, and possibly something's funky with my Terminal.app setup, so I downloaded iTerm2 and still no luck:
with vim.opt.termguicolors enabled or disabled.
$ echo $TERM
xterm-256color
fwiw
its the same behavior with the jellybeans colorscheme or without.
I even tried opening a new terminals in iterm2 and Terminal.app that do not load my .bash_profile for a fresh environment and still no luck.
I'm struggling to figure out what could be unique about my setup.
from package-info.nvim.
Aha. I've got something.
- Colors do work in iTerm2 when
vim.opt.termguicolors = true
. I don't think they work at all withouttermguicolors
- Colors do not work when
colorscheme jellybean
is applied. - Colors sometimes work inconsistently. This is very strange behavior. Sometimes only the
up_to_date
color is applied to all virtual text, even theoutdated
text. Its as if a terminal color reset code isn't being set. Other times it does work. It's almost like a caching problem. This is probably what concealed my earlier efforts to debug the problem.
Sad for me because I don't like iTerm2 and Terminal.app's color support sucks.
from package-info.nvim.
I suggest putting a warning about termguicolors
being required to show colors in the README
It would be quite an enhancement for poor stubborn souls like me if you could get it to work with xterm256 colors as well.
And a smoother experience if you changed the defaults to be in the 256 color space. The closest translations to your defaults are LightSalmon3 (#d7875f) and Grey27 (#444444).
from package-info.nvim.
Wow, thanks for digging into this.
I don't really know that much about truecolor/termguicolors/etc... I remember messing with those when I was setting up my nvim config and once I got it working I set it and forgot about it.
I'll have to check if I can in any way detect what color mode is set by the user and adjust the colors accordingly.
What happens if you set the 256 supported colors through the config?
colors = {
up_to_date = "#3C4048", -- Text color for up to date package virtual text
outdated = "#d19a66", -- Text color for outdated package virtual text
},
from package-info.nvim.
Awesome. This does seem like a possible solution.
I'm currently on vacation so my dedicated time for this project is limited but when I get back in around a week I'll try to fix it.
If you get the time to setup a fix please use the develop branch since I reorganized the whole project there recently.
from package-info.nvim.
PR #42 submitted, with questions
from package-info.nvim.
Related Issues (20)
- Remove internal json lib usage and use vim.json
- Nest hide options under one option
- Yarn workspaces support HOT 1
- Fetch and display repo release notes HOT 1
- Loading hook in vim-airline HOT 4
- Bug trying to edit a `package.json` with unsaved changes HOT 3
- [BUG] Not in valid package.json file | after refactor HOT 2
- [BUG]: Once a package.json is loaded, every buffer after shows that it is invalid HOT 2
- [BUG] It does nothing HOT 40
- [FEATURE REQUEST] Support nvim-notify HOT 4
- [BUG] setting wrong colors HOT 7
- [FEATURE REQUEST] Update Readme keymap config examples with description HOT 1
- [FEATURE REQUEST] add option to configure the order of detection of package manager HOT 3
- [FEATURE REQUEST] Support monorepo. HOT 3
- [BUG] Plugin doesn't work when lazy loaded HOT 1
- [FEATURE REQUEST] fire autocmd on loading status change HOT 1
- [FEATURE REQUEST] support for bun HOT 1
- [BUG] remove icon for `require('package-info').get_status()` HOT 2
- [BUG] Spinner "not included" HOT 2
- [BUG] Error when key contained in dependencies and devDependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from package-info.nvim.