New answers tagged lua
0 votes
overriding conform.nvim via nvim-config-local to stop autoformatting certain files
-- @file /path/to/project/.nvim.lua require("conform").formatters_by_ft.python = {} require simply returns the table that is defined in conform.nvim/lua/conform/init.lua, for which one of ...
Best practices
0 votes
0 replies
0 views
Lua: install via rockspec a github project, no realease, no version
Did you try luarocks build (no arguments)? It worked for me after cloning the repo. You may add --local if you are not installing to a privileged location, as with other install commands.
0 votes
How to exit a REPL from the command line
os.exit() os.exit(0) in case you need to have an explicit function call with exit code instead of direct Ctrl+D
0 votes
Luau --!strict: "Unknown type 'DataServiceServer'" when returning typed table
The error you're getting is because types must be declared before they get referenced. In my example below, "DataServiceServer" exists as a type. ModuleScript --!strict local RunService = ...
Advice
0 votes
0 replies
0 views
I would like some advice on ways I can make this code better
Your totalMutationChance variable is unused. I would standardize your comments based on the documentation, and what I mean by that is commenting above the code instead of directly on-top of it for the ...
0 votes
Setting up handlers for mason-lspconfig in Neovim with luasnip returns a nil value
Looks very similar to josean's nvim guide especially with the comments, so I'm going to assume so. mason_lspconfig.setup({ function(server_name) lspconfig[server_name]....
0 votes
How could I embed Lua into Python 3.x?
From: https://github.com/scoder/lupa Lupa integrates the runtimes of Lua or LuaJIT2 into CPython. It is a partial rewrite of LunaticPython in Cython with some additional features such as proper ...
0 votes
Accepted
Function return value changing when being used on variable assignment
love.math.colorFromBytes has 4 return values. If the result is used as the last argument of a function as you did in the "Pure" print it will count as a vararg and will put them all as ...
2 votes
Accepted
xml2lua gives me multiple root nodes
Before reusing handle.root, you have to claim that the old node tree will not be used: handler.root = nil The code can be as follows: local function count_root_nodes() local parser = xml2lua....
0 votes
nvim restoring last cursor position
You can make use of :mkview command, one of the things that it does is: The scroll position and the cursor position in the file. Doesn't work very well when there are closed folds. Here is a short ...
0 votes
Neovim: icons missing nvim-tree-web-devicons
Tried installing fonts, adjusting TERM variable, etc. Nothing worked for my Ubuntu 24.04. Both Gnome-terminal 3.52 and instead of Xterm refused to show the proper icons. Solution: switched to ...
-2 votes
Declaring a variable as 'local' when outside Lua functions
Even tough I can't say I know Lua, from use of the language, I believe people are describing this the wrong way. In my understanding, a local declaration outside functions is just a declaration that ...
1 vote
How do I manage classes in such a way, that I can create as many objects from a class as I need, and not cause a data leak?
Because every time you create a new note, you also create a new Image object: function notesClass:new(id, x, hitTime, speed) ... note.image = love.graphics.newImage("img/Note_1.png") ...
Top 50 recent answers are included
Related Tags
lua × 22956coronasdk × 2333
roblox × 1708
c++ × 1437
lua-table × 1429
c × 874
string × 691
love2d × 628
nginx × 575
torch × 496
redis × 476
function × 421
neovim × 389
lua-patterns × 369
luajit × 366
android × 353
arrays × 348
python × 341
nodemcu × 314
c# × 302
openresty × 299
scripting × 289
logitech-gaming-software × 249
esp8266 × 225
java × 215