Skip to content
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

TUI shifted left inside floaterm #388

Open
1 of 3 tasks
Bekaboo opened this issue Jan 14, 2023 · 2 comments
Open
1 of 3 tasks

TUI shifted left inside floaterm #388

Bekaboo opened this issue Jan 14, 2023 · 2 comments

Comments

@Bekaboo
Copy link

Bekaboo commented Jan 14, 2023

Before reporting

  • Please make sure you have searched through the F.A.Q. first.

  • Please make sure you are using the latest version of this plugin.

  • It's better to use English as it's more friendly to other non-Chinese native users.

Environment

If you are using vim(not neovim), fill in the following blanks

  • Output of vim --version:

  • Platform:

    • Linux
    • Mac OS X
    • Windows

If you are using neovim, just run :checkhealth floaterm and post the content

below.

floaterm: health#floaterm#check

common ~
- Platform: linux
- Nvim: NVIM v0.9.0-dev-672+g4876654d4c
- Plugin: 06c7398


terminal ~
- OK Terminal emulator is available

floating ~
- OK Floating window is available

Configurations related to vim-floaterm in vimrc(i.e. g:floaterm_xxx):

vim.opt.sidescrolloff = 8

Describe your question, feature request, or bug.

Although it is previously previously discussed (#218, #96) that setting sidescrolloff to a positive value will cause some TUI tools like lazygit to shift left and this problem is considered solved, it still occurs to me when I call :FloatermPrev or :FloatermNext

Steps to reproduce

Using the minimal vimrc

set sidescrolloff=8

Steps to reproduce the behavior:

  1. Enter nvim
  2. In cmdline, call :FloatermNew
  3. In cmdline, call :FloatermHide
  4. In cmdline, call :FloatermNew lazygit
  5. In cmdline, call :FloatermPrev
  6. In cmdline, call :FloatermNext

Actual behaviour

Lazygit TUI is shifted left.

Expected behaviour

TUI should not be shifted left

Screenshots(Optional, GIF is better)

simplescreenrecorder-2023-01-14_02.13.27.mp4
@Bekaboo
Copy link
Author

Bekaboo commented Jan 14, 2023

A guess on this issue: window is not properly initialized (set window option scrolloff to 0 when user switch from a floaterm window to another). Currently it seems like that it is only set for newly opened windows.

@Bekaboo
Copy link
Author

Bekaboo commented Jan 14, 2023

Update: this issue also happens when you have a floating terminal opened (not necessarily floaterm, it can be a floating terminal provided by rnvimr) before you toggle floaterm, see demo below:

simplescreenrecorder-2023-01-14_02.25.10.mp4

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

No branches or pull requests

1 participant