Giter Club home page Giter Club logo

vim-lua's People

Contributors

dhcmrlchtdj avatar idbrii avatar muhmuhten avatar oberon00 avatar tbastos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-lua's Issues

Issue when indenting anonymous functions

Hi there,

I have trouble with the indenting proposed by this plugin. The code I am trying to write is the following:

describe("something", function()
  it("does something", function()
  end)
end)

I have a parenthesis-insertion plugin, so when write it( I get it(|) (with the cursor between the parenthesis). It seems that this confuses the indentation plugin.

From this position:

describe("something", function()
  it("does something", function() |)
end)

When I press enter it gets missaligned - it seems it is trying to align the parents instead of the it:

describe("something", function()
  it("does something", function()
    |)
end)

Also, the weirdest part is if I try to write end on that position. Then the line gets completely missaligned (I don't even press enter).

describe("something", function()
  it("does something", function()
  
end|)
end)

How can I solve this behavior?

Why is luaFuncCall linked to PreProc instead of Function?

I've used it without thinking for a while, but recently realized why lua looks weird: function calls don't use the colors for functions.

  HiLink luaFuncCall         PreProc
  HiLink luaFuncId           Function

luaSpecialValue (built-in functions like ipairs) also uses PreProc which makes them look the same. However, for table.insert table is luaSpecialTable and insert is luaFuncCall instead of luaSpecialValue. If not for that inconsistency, it'd be nice for built-ins to stand out.

vim help says Function is:

function name (also: methods for classes)

I can see how that might be interpreted as "names in definitions" and not "names in uses", but using PreProc doesn't make sense to me.

Seems like ideally there's two changes to solve this:

  • Change luaFuncCall to Function
  • highlight functions on luaSpecialTable as luaSpecialValue

Help

Hey, how can i highlight the self keyword? thanks

Indentation issue with table literal function arguments

Hello, I have noticed an issue with the indentation of table literals as function arguments, when the braces and parentheses are combined like below.

Expected Indentation

do
  foo()
  somefunction(arg1, arg2, {
    key1 = val1, key2 = val2,
  })
  otherfunction({
    key3 = val3, key4 = val4,
  })
  bar()
end

Actual Indentation

do
  foo()
  somefunction(arg1, arg2, {
      key1 = val1, key2 = val2,
    })
  otherfunction({
      key3 = val3, key4 = val4,
    })
  bar()
end

Has this been merged upstream?

I ran across this repository and thought "oh cool, better Lua syntax highlighting!". I installed it and nothing happened. Then I started checking the comparison in the readme and realized I already have the improvements there. Was this merged into vim and/or neovim upstream? (I'm running Neovim.)

If so its probably worth mentioning that in the README.

Breaks tpope/vim-endwise

tpope/vim-endwise lets you complete Lua code, adding an automatic end. This is done via the following code:

let b:endwise_addition = 'end'
let b:endwise_words = 'function,do,then'
let b:endwise_pattern = '^\s*\zs\%(\%(local\s\+\)\=function\)\>\%(.*\<end\>\)\@!\|\<\%(then\|do\)\ze\s*$'
let b:endwise_syngroups = 'luaFunction,luaStatement,luaCond'

The function completion does not work if this plugin is active. I'm not sure how to patch this.
I believe it's related to the syntax group luaFunction.

Comparison to BetterLua

cf. #14

How does this stack up against BetterLua.vim

For starters I'm guessing:

  • This hasn't dropped old Lua 4.0 and 5.0 support.

Anything else noteworthy? What reasons would there be to switch or not switch?

Weird function colour

Before it was like this.

image

Now it looks like this.

image

Can I have some orange back? Perhaps for the function calls, instead of all this green?
Also, now local and function share the same colour. Can I get function to be green again?

How to trigger the indent?

I have installed the plugin to my vim via vim-pathogen, but when gg=G, the indention is still odd,

Screenshot:
a

So, how to indent it correctly ?

And, is it possible for the plugin to support another extension in addition to .lua suffix, e.g .luae ?

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.