From d95e3a4c9c8f468158a1f1f23921ebbaae75cf8b Mon Sep 17 00:00:00 2001 From: glepnir Date: Sat, 9 Dec 2023 17:28:28 +0800 Subject: fix: use no_ff instead of ffdos as condition Problem: line2byte behavior is changed after commit b051b13. It no longer return `-1` on empty buffer. Solution: use `nof_ff` instead of `!ff_dos` as condition. Then compatible behavior of line2byte() is restored. --- test/functional/api/buffer_spec.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua index 6ed9aa574a..ed93135acb 100644 --- a/test/functional/api/buffer_spec.lua +++ b/test/functional/api/buffer_spec.lua @@ -1876,6 +1876,7 @@ describe('api/buf', function() it('works in empty buffer', function() eq(0, get_offset(0)) eq(1, get_offset(1)) + eq(-1, funcs.line2byte('$')) end) it('works in buffer with one line inserted', function() -- cgit