Change :pop to :cscope pop
Move the :pop command inside of the :cscope namespace to avoid interfering
with other plugins.
Add :cscope help
Add a new help command that finds the README and opens it in a vis:message
window. Add help messages to the vis:command_register to point to
the help.
Thanks to Andrew Gierth (RhodiumToad on libera/#lua) for figuring out how
to get the path of the script so I could avoid hideous debug.getinfo()
solutions.
Add init.lua to support require(`vis-cscope`)
Without init.lua the user has to require(`path/to/vis-cscope/cscope`)
to match the cscope.lua file. By adding init.lua the user can
require(`path/to/vis-cscope`). Use vis `:help lua path` to see the
directories and filenames lua will search for plugins.
By having init.lua just require cscope.lua both usages work.
refactor, use <C-/>, respect !, limit filenames
Major refactor to clean up the code and return errors in a consistent
manner.
Include many ideas I came across while working on vis-ctags including
limiting the length of the filename field to fit more useful context in
a narrow terminal, and the idea of using an index into matches instead
of reparsing the line.
Respect ! for the cs, cscope, and pop commands to force switching files
even if the current one has unsaved changes.
Switch from g<C-]> to <C-/> for fewer keystrokes and to follow usage of /
for searches. Using <C-\> as vim does is out of the picture until vis
can read <C-\> in curses mode.
Fix luacheck warnings
Add missing local for a few functions and variables. Change a variable
name in a loop that shadowed another variable (it worked correctly,
but I agree different names is less confusing). Change some single
character variables to more descriptive names while I'm in there.
Keep to 80 columns (with tabwidth=8)
While 80 columns may seem archaic as our monitors have grown, our
eyes haven't, and it's useful for many (4) terminals side by side on
a 1080p screen, or many more on a larger screen. Switch to tabwidth=8
and keep to the 80 columns for more readable code.
Add shquote and use for all shell commands
The call to popen did not properly quote arguments which could result
in code injection. The call to vis-menu did better. Add an shquote
function that makes a string safe to inject in a call to sh (such as
popen or vis:pipe) and use it on all arguments being injected.
Fixes: ac8880e (Initial commit.)
Mention mailing list in README
There is no clear link from the repo at git.sr.ht/~emg/vis-cscope to
the mailing list ~emg/dev@lists.sr.ht