Git Product home page Git Product logo

Comments (3)

kana avatar kana commented on May 21, 2024

Thank you for the report. It might be a bug in Vim. I confirmed a similar problem without vim-vspec. Try the following steps with vim -u NONE -i NONE -N:

set runtimepath+=path/to/bundles/autovar

echo autovar#Number()
" => Echos 12

echo autovar#NUMBER
" => Echos 12

function Foo()
  return autovar#NUMBER
endfunction

echo Foo()
" => Fails with the following message:
" Error detected while processing function Foo:
" line    1:
" E121: Undefined variable: autovar#NUMBER
" E15: Invalid expression: autovar#NUMBER
" 0

from vim-vspec.

glts avatar glts commented on May 21, 2024

After reading your reply I found this message and a work-around:

describe 'autovar#NUMBER'
  it 'works now'
    Expect g:autovar#NUMBER == 12
  end
end

So technically this might not be a bug, but a very strange scoping rule in Vim eval.

I am not sure if I should report it on vim_dev, but I agree that this is not a vspec problem. I'm closing it, thank you.

from vim-vspec.

kana avatar kana commented on May 21, 2024

Thank you. I've added a note on the problem and the workaround to the document. Because it's hard to guess the scoping rule of autoload variables form :help.

from vim-vspec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.