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

How to disable auto wrapping? #3

Open
wanaiqing opened this issue Mar 11, 2023 · 15 comments
Open

How to disable auto wrapping? #3

wanaiqing opened this issue Mar 11, 2023 · 15 comments

Comments

@wanaiqing
Copy link

How to disable auto wrapping? It's annoying if the screen is narrow.

@Eliot00
Copy link
Owner

Eliot00 commented Mar 14, 2023

80f65d1 support disable wrapping:

g:GIT_LENS_CONFIG = {
    blame_wrap: false,
}

@wanaiqing
Copy link
Author

80f65d1 support disable wrapping:

g:GIT_LENS_CONFIG = {
    blame_wrap: false,
}

What's the right syntax for this in .vimrc? It's causing an error.

@Eliot00
Copy link
Owner

Eliot00 commented Mar 14, 2023

80f65d1 support disable wrapping:

g:GIT_LENS_CONFIG = {
    blame_wrap: false,
}

What's the right syntax for this in .vimrc? It's causing an error.

I guess your .vimrc is not vim9 script, try this:

vim9cmd g:GIT_LENS_CONFIG = {
    blame_wrap: false,
}

@wanaiqing
Copy link
Author

wanaiqing commented Mar 14, 2023

80f65d1 support disable wrapping:

g:GIT_LENS_CONFIG = {
    blame_wrap: false,
}

What's the right syntax for this in .vimrc? It's causing an error.

I guess your .vimrc is not vim9 script, try this:

vim9cmd g:GIT_LENS_CONFIG = {
    blame_wrap: false,
}

It works now. But actually my output of :echo has('vim9script') is 1...
But thx

@wanaiqing
Copy link
Author

There's still a problem of it.
If there is a long line which is so long that it could totally hide the blame line(no letter will appear in screen), the blame line will entirely wrap to next line.
For example([] indicates screen, {} indicates blame line):
[This is a normal text line which is very long. ]
{ Author · Date · Commit Log }
It supposed to be rendered like below.
[This is a normal text line which is very long. { ] Author · Date · Commit Log }

@wanaiqing wanaiqing reopened this Jun 25, 2023
@Eliot00
Copy link
Owner

Eliot00 commented Jun 26, 2023

There's still a problem of it. If there is a long line which is so long that it could totally hide the blame line(no letter will appear in screen), the blame line will entirely wrap to next line. For example([] indicates screen, {} indicates blame line): [This is a normal text line which is very long. ] { Author · Date · Commit Log } It supposed to be rendered like below. [This is a normal text line which is very long. { ] Author · Date · Commit Log }

Can you put you :version output here?

@Eliot00
Copy link
Owner

Eliot00 commented Jun 26, 2023

Cannot reproduce in Vim-9.0.1441

@wanaiqing
Copy link
Author

wanaiqing commented Jun 26, 2023

The key to reproduce it is that you have a line which's tail is touching the right border of screen.
I don't think it's a version specific issue.
But my version is as below.
v

@Eliot00
Copy link
Owner

Eliot00 commented Jun 26, 2023

Try the latest version, I think c27b09f should fix this.

@wanaiqing
Copy link
Author

wanaiqing commented Jun 26, 2023

@Eliot00 I have just tried, but another problem appeared...
Say, we have three lines:
[some text... Author · Date · Log ]
[a line that is very long so that it is touching screen ]
[some text... ]
Now you use j/k to move upward or downward and stay at the long line, the blame info of the line before the long line or after the long line won't disappear...
It looks like above or below.
[some text... ]
[a line that is very long so that it is touching screen ]
[some text... Author · Date · Log ]

@Eliot00
Copy link
Owner

Eliot00 commented Jun 27, 2023

Fixed, looking forward to your feedback.

@wanaiqing
Copy link
Author

Fixed, looking forward to your feedback.

It looks great now, thanks.

@wanaiqing
Copy link
Author

Still has a problem.
[this is a long line.........................................]
[............end of it. ]
The blame info won't be rendered...

@wanaiqing wanaiqing reopened this Jun 29, 2023
@Eliot00
Copy link
Owner

Eliot00 commented Jun 29, 2023

In fact, this should be an upstream bug. If a line of text just occupies the entire line width, virtual text will wrap. Vim doesn't provide a way to judge this situation, I'm not sure my method can cover all situations

if !GetConfig('blame_wrap') && (winwidth(0) - &numberwidth - 1) == virtcol('$')
    return
endif

@Eliot00
Copy link
Owner

Eliot00 commented Jul 6, 2023

vim/vim#12640

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

2 participants