Skip to main content

New answers tagged

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 ...
Jared's user avatar
  • 748
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.
user3758232's user avatar
  • 1,010
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
GopherM's user avatar
  • 770
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 = ...
Andrew's user avatar
  • 1
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 ...
shawndoeswhat's user avatar
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]....
Revolthell's user avatar
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 ...
arainchi's user avatar
  • 1,532
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 ...
Ivo's user avatar
  • 23.7k
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....
Stas Simonov's user avatar
  • 1,142
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 ...
Monsieur Merso's user avatar
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 ...
Kostyantyn's user avatar
  • 5,241
-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 ...
kavadias's user avatar
  • 1,188
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") ...
shingo's user avatar
  • 31.2k

Top 50 recent answers are included