lichray/nvi2

Removing cscope support

mmcco opened this issue · 5 comments

mmcco commented

We removed the cscope features downstream in OpenBSD because it was interfering with privilege dropping via pledge(2).

If I understand correctly, this code lets you view connections between vi and cscope instances, and lets you execute cscope commands from vi.

Is there interest in keeping this code? Do people use it? I suspect that it's very rarely used, and its interference with pledging suggests that it uses privileges and system resources otherwise unnecessary in vi. This is a potentially dangerous combination.

Of course, you can still use cscope with vi - you just won't have these extra features. As a daily (practically minute-ly) cscope user, removing this seems like the best option to me.

If people agree, I'm happy to cook up a diff.

Just curious, which part is against pledge(2). Does :e ../*.txt can't be used as well?

mmcco commented

Here's our diff.

mmcco commented

There was a second one that just removed some references from the docs.

I'm not sure whether there are people who using it (probably no FreeBSD users since I just found a bug...), but the feature is not that useless -- actually, it's as powerful as that in Vim. Take a look at https://github.com/lattera/freebsd/blob/master/contrib/nvi/docs/internals/cscope.NOTES

It's tricky to setup the keybindings though. <tab> needs to be inputted as ^V^I in the config file, and there needs to be a space before the buffer, like find g "t.

@lichray I know this is an ancient thread but, I was disappointed when NeoVim dropped cscope support, and had to adjust accordingly.

I don't use cscope directly usually - my main use of it with Vim was using it to build the database for CCTree (https://github.com/hari-rangarajan/CCTree) use. OpenVi doesn't have cscope either, since OpenBSD is my upstream.

If you are still using cscope, I'd imagine that GNU Global or Universal CTags would work for most Nvi/Nvi2 users, but I'd recommend not getting rid of the feature unless it's actually causing problems or a maintaince burden. There are probably others using it who don't even remember that it's there working for them in the background.