Open 4rtemis-4rrow opened 3 months ago
Wouldn't checking if the buffer name ends with .h
work? (e.g. vim.api.nvim_buf_get_name(0):match('%.h$')
no, a buffer ending with .h would be when you are editing the header file itself, I'm talking about when you are including a header file in a C project, eg
#include <stdlib.h>
and I can't do it to all C files in general, because using < and > for anything other than include statements would be annoying, so it has to be only when the line begins with #include
Then wouldn't current_line:match('^%s*#%s*include[^%w]')
solve the problem? (notice that the pattern doesn't use $
at the end)
I searched high and low, went over all the docs, and though I don't know lua (I know, I have to learn it, my config is 1225 lines of lua, it's getting hard to maintain), I tried my best
I failed, if anyone can help me, that'd be greatly appreciated, I submit this here, for I don't know where else to ask
thank you for taking the time to read this, and have a great day, whoever you may be, wherever you may be