textwidth / column number is misinterpreted when using linebreak and wrap

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

textwidth / column number is misinterpreted when using linebreak and wrap

Keith Smiley
Hey everyone,

This is a crosspost of an issue I reported on GitHub[0].

Using vim (on macOS from homebrew, see the GitHub post for full version info):

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 15 2018 12:54:51)
macOS version
Included patches: 1-1428

Along with this test vimrc file:

set nocompatible

" For easier display
set laststatus=2
set statusline=%c
set showcmd

set linebreak
set wrap
set textwidth=100
set formatoptions=tc

In a terminal with 78 columns, text wrapping happens earlier than expected. You can test this with this example text (leading whitespace matters):

    .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMinor(from: "4.6.0"))

This line, which is 94 characters long (excluding the trailing newline), causes text width issues based on the line length. For this line, textwidth should only hard wrap once you type 5 more characters, but if you have a 78 column terminal window, and the above settings, it hard wraps as soon as you type a single character.

Here's a video of the issue: https://asciinema.org/a/qyPcdmuLIjrMZQrPZKc9U11H8

See the GitHub link for some more details. Any help debugging this would be greatly appreciated.

0: https://github.com/vim/vim/issues/2555

You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.