Coder Social home page Coder Social logo

uberzug can't work about rnvimr HOT 20 CLOSED

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024
uberzug can't work

from rnvimr.

Comments (20)

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024 1

It is not resolution problem.(My resolution is 2160x1440).
By xrandr -s 1920x1080 switching to 1080p, it doesn't work. Pictures are still not in place.
And then I switch to Deepin DDE and Deepin terminal, it doesn't work as well.
I reinstall ueberzug by pip install ueberzug --user again, nothing changes.

我几乎肯定是你的ueberzug的版本问题,当我使用pip install ueberzug --user就会出现问题,请使用yay -S python-ueberzug-git或者git clone master并手动安装。

nvim -d /home/kevin/.local/lib/python3.8/site-packages/ueberzug/xutil.py /usr/lib/python3.8/site-packages/ueberzug/xutil.py 会有差别的。

Translate from google:

I almost certainly have a problem with your version of ueberzug. When I use pip install ueberzug --userit, problems will occur. Please use yay -S python-ueberzug-gitor git clone master and install it manually.

nvim -d /home/kevin/.local/lib/python3.8/site-packages/ueberzug/xutil.py /usr/lib/python3.8/site-packages/ueberzug/xutil.py There will be differences.

from rnvimr.

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024
  • Ranger-devicons works well when using ranger in terminal. However, I cannot use it in rnvimr.

You should syn your ranger plugins by using :RnvimrSync. Make sure your ranger-devicons plugin is existed in $HOME/.config/nvim/plugged/rnvimr/ranger.

  • Similarly, I cannot preview images well using rnvimr. Pictures are very big. They are not in correct position and even part of them are out of the screen.

rnvimr only calibrated preview image for uberzug for now.
If use uberzug, this may happen when your window size is small. Preview image works best in tmux because of tmux api.

I am using Archlinux + dwm now. How can I fix these problems?

I have a friend using Archlinux + dwm, rnvimr works flawless in his env.

from rnvimr.

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024

Had your read README to update the latest version of uberzug?

84dc677

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

Thank you. I have solved the first problem.
Actually, I am using uberzug to preview image. What consused me is not rander pictures but pictures not in place...I try to adjust g:rnvimr_layout but no results.
Maybe your friend is theniceboy?? I know this plugin from his nvim repo.

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

I have installed the latest version of ueberzug.

from rnvimr.

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024

Thank you. I have solved the first problem.
Actually, I am using uberzug to preview image. What consused me is not rander pictures but pictures not in place...I try to adjust g:rnvimr_layout but no results.

Could you upload an image? I can't get your point clearly.

Maybe your friend is theniceboy?? I know this plugin from his nvim repo.

Yes.

I have installed the latest version of ueberzug.

Install by yay -S python-ueberzug-git.

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

scrot

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

Just as what you see, the picture is no in place.

from rnvimr.

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024

What's your terminal? Had you tested with others? I have tested under dwm with alacritty which works flawlessly.

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

I am using simple terminal now. However, testing in alacritty, nothing changes.

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

2020-03-25-230739_2158x1408_scrot
So is it probably my rnvimr configuration problem??

from rnvimr.

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024

No, there aren't any configurations in rrnvimr refer to this issue.

Maybe you should check out the version about ueberzug. I found that no command can output the version of ueberzug. You may diff your ueberzug lib and check it out with seebye/ueberzug@d86eeb3

It outputs python-ueberzug-git 18.1.5.a8ac9c3-1 by typing yay -Q python-ueberzug-git in my env.
My lib path is /usr/lib/python3.8/site-packages/ueberzug

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

Thanks a lot! I will follow u suggestion to find out the solution.

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

I haven't found a perfect solution. But I found a personal temporary solution, adjust varibes start_x, start_y, width and height of function calibrate_ueberzug in ~/.config/nvim/plugged/rnvimr/lib/hacks.py.
However, resizing rnvimr will break it...XDXD

from rnvimr.

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024
    def calibrate_ueberzug(self):
        """
        Ueberzug can't capture the calibration of floating window of neovim, fix it.

        """

        client = self.fm.client

        def wrap_draw(self, path, start_x, start_y, width, height):
            win_info = client.request('nvim_win_get_config', 0)
            if not win_info['relative']:
                return
            start_x += win_info['col']
            start_y += win_info['row']

            self.raw_draw(path, start_x, start_y, width, height)

        try:
            # ueberzug is supported by ranger since [b58954d4258bc204c38f635e5209e6c1e2bce743]
            # https://github.com/ranger/ranger/commit/b58954d4258bc204c38f635e5209e6c1e2bce743
            # pylint: disable=import-outside-toplevel
            from ranger.ext.img_display import UeberzugImageDisplayer
        except ImportError:
            pass
        else:
            UeberzugImageDisplayer.raw_draw = UeberzugImageDisplayer.draw
            UeberzugImageDisplayer.draw = wrap_draw

This method only capture the top left coordinate of floating window.
I'm not sure that nvim_win_get_config work properly for you. You can enter neovim command line mode (default keymap is C-\) to use echo nvim_win_get_config(0) in the floating window to check out whether the size of the floating window is proper for you. If not, please check out the version of your neovim.

You can also test the behavior of the previewing image under a raw ranger in the floating window by vim-floaterm.

In short, make sure that echo nvim_win_get_config(0) and the version of ueberzug are correct.

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

I just adjust the position and size of picture manually. Anyway it exactly works for me if not resizing rnvimr. Probably there's a hidden environmental problem in my computer...finding out and fixing it may be difficult.lollol

    def calibrate_ueberzug(self):
        """
        Ueberzug can't capture the calibration of floating window of neovim, fix it.

        """

        client = self.fm.client

        def wrap_draw(self, path, start_x, start_y, width, height):
            win_info = client.request('nvim_win_get_config', 0)
            if not win_info['relative']:
                return
            #  start_x += win_info['col']
            #  start_y += win_info['row']
            start_y += win_info['row'] *2/3 + 1
            width = width*3/ 4
            height = height*3 / 4

            self.raw_draw(path, start_x, start_y, width, height)

        try:
            # ueberzug is supported by ranger since [b58954d4258bc204c38f635e5209e6c1e2bce743]
            # https://github.com/ranger/ranger/commit/b58954d4258bc204c38f635e5209e6c1e2bce743
            # pylint: disable=import-outside-toplevel
            from ranger.ext.img_display import UeberzugImageDisplayer
        except ImportError:
            pass
        else:
            UeberzugImageDisplayer.raw_draw = UeberzugImageDisplayer.draw
            UeberzugImageDisplayer.draw = wrap_draw

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

Thanks a lot for your patient help!!! Maybe we should close this issue, after all it is my problem not this plugin.

from rnvimr.

kevinhwang91 avatar kevinhwang91 commented on August 30, 2024

You can also test under tmux. Old and latest ueberzug will use tmux api to fix X11. Or change your X11 resolution to 4k or 1080p.

Thanks a lot for your patient help!!! Maybe we should close this issue, after all it is my problem not this plugin.

This is a strange issue, I'm interested in it. Maybe it's a compatible issue.

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

It is not resolution problem.(My resolution is 2160x1440).
By xrandr -s 1920x1080 switching to 1080p, it doesn't work. Pictures are still not in place.
And then I switch to Deepin DDE and Deepin terminal, it doesn't work as well.
I reinstall ueberzug by pip install ueberzug --user again, nothing changes.

from rnvimr.

sheriby avatar sheriby commented on August 30, 2024

非常感谢,从AUR中安装ueberzug之后,这个问题被解决了。
同时也非常抱歉,我应该早点听从你的建议从AUR中安装的,只是一开始我使用yay -S python-ueberzug-git时出现了很多安装问题。因为虽然卸载了pip uninstall ueberzug,但是很多依赖库没有被卸载。当我手动卸载所有的依赖库之后再次从AUR中安装的时候,成功了。
再次非常感谢您的帮助,我非常喜欢这个插件。

Translate from google:

Thank you very much ueberzug, this issue was resolved after installing from AUR .
At the same time, I am very sorry, I should have followed your suggestion to install from AUR, but I yay -S python-ueberzug-githad a lot of installation problems at the beginning . Because although uninstalled pip uninstall ueberzug, many dependent libraries have not been uninstalled. When I manually uninstalled all the dependent libraries and installed them from AUR again, it succeeded.
Thanks again for your help, I really like this plugin.

from rnvimr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.