Coder Social home page Coder Social logo

command-block limitations about vim HOT 6 CLOSED

balki avatar balki commented on May 27, 2024
command-block limitations

from vim.

Comments (6)

benknoble avatar benknoble commented on May 27, 2024

What should return do? It wouldn’t be valid in a normal command block.

It would probably be nice to support heredocs though.

from vim.

chrisbra avatar chrisbra commented on May 27, 2024

yeah, return is strange. commands are basically nice and simple ways to execute functions. Thus I would argue the desired logic belongs into a function.

from vim.

balki avatar balki commented on May 27, 2024

return does not have to return anything to called. But useful as a control flow to stop the command execution to avoid nesting. Creating a wrapper function is not bad but it is unnecessary boiler plate if the function is called in only once which is in the command definition. I think the behavior should at-least be documented.

from vim.

chrisbra avatar chrisbra commented on May 27, 2024

:return does not make sense in an interactive session (which is basically the same what :com does). I also think there is nothing to document at least not for the :return case.

And btw: you can always negate the condition.

from vim.

dkearns avatar dkearns commented on May 27, 2024

:help :command-repl states that inline functions cannot be used and :help return is documented as "return from function". The error is "E133: :return not inside a function".

I think it's documented well enough.

I can't see why heredoc assignment shouldn't work though.

from vim.

chrisbra avatar chrisbra commented on May 27, 2024

Yes, let's leave this ticket for the missing heredoc functionality.

from vim.

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.