aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-03-01 18:01:34 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-03-01 18:23:35 +0100
commit7450cb509558b83781516c1667d5215ccd379938 (patch)
tree35218330718a212a23a4c39fcafd3e4cb2c71ae3 /lua
parent17786fb0c6982888534885792b390d5ff9f9a342 (diff)
downloadvis-7450cb509558b83781516c1667d5215ccd379938.tar.gz
vis-7450cb509558b83781516c1667d5215ccd379938.tar.xz
lua: return nil for invalid text objects
Diffstat (limited to 'lua')
-rw-r--r--lua/plugins/textobject-lexer.lua4
1 files changed, 2 insertions, 2 deletions
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")