From 7450cb509558b83781516c1667d5215ccd379938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 1 Mar 2017 18:01:34 +0100 Subject: lua: return nil for invalid text objects --- lua/plugins/textobject-lexer.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua/plugins/textobject-lexer.lua') diff --git a/lua/plugins/textobject-lexer.lua b/lua/plugins/textobject-lexer.lua index 4837935..681f226 100644 --- a/lua/plugins/textobject-lexer.lua +++ b/lua/plugins/textobject-lexer.lua @@ -5,7 +5,7 @@ local MAX_CONTEXT = 32768 vis:textobject_new("ii", function(win, pos) if win.syntax == nil or not vis.lexers then - return pos, pos + return nil end local before, after = pos - MAX_CONTEXT, pos + MAX_CONTEXT @@ -30,5 +30,5 @@ vis:textobject_new("ii", function(win, pos) cur = token_next end - return pos, pos + return nil end, "Current lexer token") -- cgit v1.2.3