git-lens.vim icon indicating copy to clipboard operation
git-lens.vim copied to clipboard

How to disable auto wrapping?

Open wanaiqing opened this issue 2 years ago • 15 comments

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

wanaiqing avatar Mar 11 '23 22:03 wanaiqing

80f65d161587f052c7f5d4e8b97877d9c8379ca0 support disable wrapping:

g:GIT_LENS_CONFIG = {
    blame_wrap: false,
}

Eliot00 avatar Mar 14 '23 02:03 Eliot00

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.

wanaiqing avatar Mar 14 '23 07:03 wanaiqing

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,
}

Eliot00 avatar Mar 14 '23 08:03 Eliot00

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 avatar Mar 14 '23 09:03 wanaiqing

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 avatar Jun 25 '23 14:06 wanaiqing

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 avatar Jun 26 '23 02:06 Eliot00

Cannot reproduce in Vim-9.0.1441

Eliot00 avatar Jun 26 '23 02:06 Eliot00

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

wanaiqing avatar Jun 26 '23 09:06 wanaiqing

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

Eliot00 avatar Jun 26 '23 13:06 Eliot00

@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 ]

wanaiqing avatar Jun 26 '23 14:06 wanaiqing

Fixed, looking forward to your feedback.

Eliot00 avatar Jun 27 '23 01:06 Eliot00

Fixed, looking forward to your feedback.

It looks great now, thanks.

wanaiqing avatar Jun 27 '23 02:06 wanaiqing

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

wanaiqing avatar Jun 29 '23 02:06 wanaiqing

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 avatar Jun 29 '23 06:06 Eliot00

https://github.com/vim/vim/issues/12640

Eliot00 avatar Jul 06 '23 10:07 Eliot00