diff options
| author | Marco Hinz <mh.codebro@gmail.com> | 2015-07-21 14:29:08 +0200 | 
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2015-08-09 21:13:25 -0400 | 
| commit | 21c0d87a242a50e09445ece0fdef8780394f6457 (patch) | |
| tree | 260c17ea83c6b6f622abb69764cfd4eedc09d389 /src | |
| parent | 990c0350aba4553baa980ff9305d67ebae1b2aef (diff) | |
| download | rneovim-21c0d87a242a50e09445ece0fdef8780394f6457.tar.gz rneovim-21c0d87a242a50e09445ece0fdef8780394f6457.tar.bz2 rneovim-21c0d87a242a50e09445ece0fdef8780394f6457.zip  | |
vim-patch:7.4.781 #3065
Problem:  line2byte() returns one less when 'bin' and 'noeol' are set.
Solution: Only adjust the size for the last line. (Rob Wu)
Original patch:
  https://code.google.com/p/vim/source/detail?r=30c9301f33ed76d0b76b9e22362f5e78e26786da
Diffstat (limited to 'src')
| -rw-r--r-- | src/nvim/memline.c | 3 | ||||
| -rw-r--r-- | src/nvim/version.c | 2 | 
2 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 53f9a544b4..d90e91be5d 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -3934,8 +3934,9 @@ long ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)        size += lnum - 1;      /* Don't count the last line break if 'bin' and 'noeol'. */ -    if (buf->b_p_bin && !buf->b_p_eol) +    if (buf->b_p_bin && !buf->b_p_eol && buf->b_ml.ml_line_count == lnum) {        size -= ffdos + 1; +    }    }    return size; diff --git a/src/nvim/version.c b/src/nvim/version.c index 4b9142323d..1f8aaf6e69 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -80,7 +80,7 @@ static int included_patches[] = {    784,    //783,    //782, -  //781, +  781,    //780,    //779,    //778,  | 
