aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-11-02 08:36:38 +0100
committerGitHub <noreply@github.com>2018-11-02 08:36:38 +0100
commit48398d61e422f74db4fa5c2e279692dd97347f41 (patch)
treeef7e2f51195c6a5a1a5f7a210290b43868c4d3c8 /src/nvim/buffer.c
parentc45a859171090746c8b81f183474c22e489b8ad0 (diff)
parentc40f992e10355edd586d5cfbca246b9659554438 (diff)
downloadrneovim-48398d61e422f74db4fa5c2e279692dd97347f41.tar.gz
rneovim-48398d61e422f74db4fa5c2e279692dd97347f41.tar.bz2
rneovim-48398d61e422f74db4fa5c2e279692dd97347f41.zip
Merge pull request #9183 from bfredl/offset2
api: make nvim_buf_get_offset independent on platform option
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index ce6aa69239..cd77f48320 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -3734,7 +3734,8 @@ int build_stl_str_hl(
FALLTHROUGH;
case STL_OFFSET:
{
- long l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL);
+ long l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL,
+ false);
num = (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) || l < 0 ?
0L : l + 1 + (!(State & INSERT) && empty_line ?
0 : (int)wp->w_cursor.col);