22,973 questions
0
votes
0
answers
31
views
Catch `otherMouseDragged` event in Hammerspoon
I am totally new to Lua. The main idea is to use my logitech mouse but not the buggy and resource-eating Logi Options+ application. I try to implement these actions :
Btn 4 click : Mission Control
...
1
vote
0
answers
166
views
Is it normal for pattern matching to take forever when used on a 600kb+ string?
Take a look at the following code:
local contents = assert(io.open("foo.html", "r")):read("*a")
print(string.len(contents))
string.find(contents, ".+\"url\"...
3
votes
1
answer
113
views
Karatsuba Square Root implementation correctness
I'm currently trying to implement Karatsuba Sqrt for my BigInteger module in luau, though I'm having trouble with its accuracy and I don't know what I'm doing wrong.
Karatsuba function:
local function ...
Advice
1
vote
4
replies
174
views
Pygame or Love2d for game development?
I have been looking at frameworks for game development and I have found that pygame (a python game development libary) and love2d (a lua game development libary) seem the eisiest to learn. I also know ...
3
votes
0
answers
54
views
inlay hints don't work for golang in neovim?
i have hints working for lua, but not for go.
i've already tried a bunch of stuff like several go configs, though it seems like it is a server problem, because Settings: {} is what i get in ...
1
vote
0
answers
63
views
neovim treesitter and mini.ai
I found out the mini.ai html tag selection is very bad but treesitter was so good at it so I decided to change it to treesiter without loosing the good things in mini.ai so I did this config and so ...
-3
votes
0
answers
84
views
How to use auto-completet by Clangd in Lazy.nvim?
To be convenient when coding C/C++ programs, I decided to use Clangd for auto-complete plugin. I went to the official website of Lazy.nvim and read guides to install and use. I tried :Mason and :...
1
vote
1
answer
561
views
How to finish Tree-sitter plugin in Neovim by Lazy.nvim?
I am a newbie Neovim user and I am configuring Neovim by Lazy in init.lua. However, I had a problem when installing Tree-sitter plugin by Lazy.nvim.
In file init.lua, I use below command to install ...
1
vote
0
answers
57
views
Error while configuring jdtls on neovim 0.12 without using any plugin
I am trying to run jdtls lsp on the latest nvim 0.12 with minimal setup without using any plugin for my nvim version:
NVIM v0.12.0-dev-5299967
Build type: Debug
LuaJIT 2.1.1764270282
However, when i ...
3
votes
1
answer
60
views
Object and entity colliding multiple times regardless of disabling cantouch property
I am creating a game about fighting other people in arenas, and when 2 people are in the arena, anyone that tries to enter becomes a spectator, for some reason, the part you touch to enter the arena ...
Best practices
0
votes
7
replies
147
views
In lua, is there a way to "force" an argument to its multiple values
Let tableA = {"a","b","c"}.
print( table.unpack(tableA) ) will print : a b c - the multiples values of table.unpack(tableA) are displayed,
print( table.unpack(tableA) , &...
2
votes
0
answers
75
views
Neovim LuaSnip configuration problem, Lua snippets work correctly but JSON doesn't
I have an NvChad configuration for NeoVim, and I was trying to configure a LuaSnip plugin, but for some reason my Lua snippets are working correctly, but the json ones do not, and I want to figure out ...
4
votes
1
answer
111
views
How to evaluate arithmetic expression in pseudo‑SQL style (Lua 5.1)
In love2D I have a string that represents a mathematical expression, for example:
local expr1 = "[p35] div [p36]"
local expr2 = "((([p35]*100) div [p36]) mod 100)"
local params = {...
Advice
0
votes
3
replies
81
views
String manipulation: extract words under brackets
I'm not yet very familiar with the patterns in Lua's string.gsub function.
If I have a string like this:
Fishing Lure(+100 Fishing Skill)(1 hour)
and I want extract only the string "1 hour"...
-4
votes
2
answers
114
views
Question regarding using : and [] together, Lua
Take the following block of code
function pickrand()
local v = math.random(1,3)
if v==1 then return ‘px' elseif v==2 then return ‘py' elseif v==3 then return 'pb' end
end
prin = {
x = ...