Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make "go to definition" compatible* with Lua 5.2 (issue #2)
* Bonus points if you can guess without
  the diff what the incompatibility was ;-)

Issue #2 on GitHub:
  #2
  • Loading branch information
xolox committed May 27, 2013
1 parent ea8cea8 commit 77f9da1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions autoload/xolox/luainspect.vim
@@ -1,9 +1,9 @@
" Vim script.
" Author: Peter Odding <peter@peterodding.com>
" Last Change: May 25, 2013
" Last Change: May 27, 2013
" URL: http://peterodding.com/code/vim/lua-inspect/

let g:xolox#luainspect#version = '0.4.26'
let g:xolox#luainspect#version = '0.4.27'

function! xolox#luainspect#toggle_cmd() " {{{1
if !(exists('b:luainspect_disabled') && b:luainspect_disabled)
Expand All @@ -22,7 +22,7 @@ function! xolox#luainspect#auto_enable() " {{{1
" Define buffer local mappings for rename / goto definition features.
inoremap <buffer> <silent> <F2> <C-o>:call xolox#luainspect#make_request('rename')<CR>
nnoremap <buffer> <silent> <F2> :call xolox#luainspect#make_request('rename')<CR>
nnoremap <buffer> <silent> gd :call xolox#luainspect#make_request('goto')<CR>
nnoremap <buffer> <silent> gd :call xolox#luainspect#make_request('go_to')<CR>
" Enable balloon evaluation / dynamic tool tips.
if has('balloon_eval')
setlocal ballooneval balloonexpr=LuaInspectToolTip()
Expand Down Expand Up @@ -94,7 +94,7 @@ function! xolox#luainspect#make_request(action) " {{{1
call s:clear_previous_matches()
call s:highlight_variables()
call xolox#misc#timer#stop("luainspect.vim %s: Highlighted variables in %s in %s.", g:xolox#luainspect#version, friendlyname, starttime)
elseif response == 'goto'
elseif response == 'go_to'
if len(b:luainspect_output) < 3
call xolox#misc#msg#warn("luainspect.vim %s: No variable under cursor!", g:xolox#luainspect#version)
else
Expand Down
4 changes: 2 additions & 2 deletions misc/luainspect/luainspect4vim.lua
Expand Up @@ -3,7 +3,7 @@
This module is part of the luainspect.vim plug-in for the Vim text editor.
Author: Peter Odding <peter@peterodding.com>
Last Change: August 21, 2010
Last Change: May 27, 2013
URL: http://peterodding.com/code/vim/lua-inspect/
License: MIT
Expand Down Expand Up @@ -152,7 +152,7 @@ function actions.tooltip(tokenlist, line, column, src) -- {{{1
end
end
function actions.goto(tokenlist, line, column) -- {{{1
function actions.go_to(tokenlist, line, column) -- {{{1
-- FIXME This only jumps to declaration of local / 1st occurrence of global.
local curvar = getcurvar(tokenlist, line, column)
for i, token in ipairs(tokenlist) do
Expand Down

0 comments on commit 77f9da1

Please sign in to comment.