Closed SystematicError closed 2 years ago
I think your configuration didn't call require'hologram'.setup()
before hand, so if you are packer user , can you try to use the code below (and :PackerComple).
use {'edluffy/hologram.nvim',
config = function()
require'hologram'.setup {}
local function map(input, output)
vim.api.nvim_set_keymap('n', input, output, { noremap = true, silent = false})
end
function Fft()
local my_image = require('hologram.image'):new({ source="/Users/.../something.png", row=2,col=5})
my_image:transmit()
end
map('<space>lf', ":lua Fft()<cr>")
end,
}
If you get line value outside range
error, fill the file with space.
Thanks for the help! Adding the setup function fixes it. Initially didn't have it due to it not being mentioned in the README
@Cassin01 I got the error line value outside range
, what does it mean? what do you mean by fill the file with space
???
@winkee01 The row for an image has to be a valid line inside the buffer in which it is placed (with 0 based indices). I probably didn't make that clear enough in the docs. I have a lot of changes planned for this plugin so this issue and a few others should be fixed soon.
Sorry, still didn't quite understand. my settings is your minimal
local my_image = require('hologram.image'):new({
source = '/Users/.../Documents/Chun-Li.jpeg',
row = 11,
col = 0,
})
And I opened a file with 200+ lines, which is obviously more than 11 rows. But I still get this error.
The buffer must be filled with any words till the row you defined (11 at that time). Can you fill the file that you want to show the picture on with any 11 words?
I filled my file with 100 x 100 spaces, still not able to display the image. Do you mean I have to fill it with printable characters?
Ok, this time, I fill the file with characters, but still can't display the image.
Only PNG file format is supported right now so that is probably why
you mean I have to fill it with printable characters?
No
I filled my file with 100 x 100 spaces, still not able to display the image.
My solution may not work or there is another problem on your environment.
I tested PNG, not working at also.
Can you try the latest commit? I have made a few changes which includes encoding and sending only the image path to the terminal instead of the entire image contents - which is a considerable performance increase and should mean that masses of base64 data isn't dumped into the terminal like that.
I tried the latest commit, but still nothing was shown.
this is my test image laptop.png
It works fine for me. What OS are you using and what version of Kitty do you have installed?
I am using macOS Monterey, and I just installed kitty on my machine (never used it before), so I guess it's the latest version 0.25.2.
So my question is: except for your minimal settings, did I miss any other configs?
Hey, I recently decided to try out this plugin and noticed that when running the following command
:lua require("hologram").add_image(0, "/tmp/test.png", 5, 5)
I get this error:After scouring the code, I noticed something in this snippet:
Here, no fallback value is set for
vim.g.hologram_extmark_ns
, so if the user hasn't defined it, it returnsnil
, which the nvim api does not like. I'm not really sure what extmark_ns really does so I'm not submitting a pull request, but hopefully this issue should be easy to fix :)Nvim version info: