rgieseke / textredux

Text-based interfaces for Textadept
http://rgieseke.github.io/textredux/
Other
59 stars 11 forks source link

Hijacking the ctags go_to window? #37

Closed snoopy closed 5 years ago

snoopy commented 5 years ago

Is it possible for textredux to hijack the go_to window which opens when using ctags? How would this be possible/how much work is it?

For info on ctags in TA see: https://foicica.com/wiki/ctags

rgieseke commented 5 years ago

There is a ctags module in Textredux: https://github.com/rgieseke/textredux/blob/master/ctags.lua

So i think you just need to overwrite the keyboard shortcut, though i'm not sure if i understand your question correctly.

snoopy commented 5 years ago

Sorry, didn't see there already was one in TR. Sadly it doesn't work but i ported the normal ctags module by mitchell to TR which works fine.

rgieseke commented 5 years ago
local textredux = require("textredux")
keys.cg = textredux.ctags.goto_symbol

Works for me (on Linux) -- what problem did you have @snoopy?

The Textredux version is also based on Mitchell's code, so I'd be happy to have improvements or fixes.

ghost commented 5 years ago

Since no code was provided here I decided to rewrite the ctags functionality somewhat.

@rgieseke could you take a look at it and let me know if you think this warrants a PR? https://github.com/loomer/textredux/blob/update-ctags/ctags.lua

It basically just uses the "tags" file created by ctags just like the official ctags module by Mitchell. You can also restrict search to only symbols from the current file as otherwise you can get a lot of (useless) results in large projects at times.

rgieseke commented 5 years ago

This looks great! I'm not sure it should be in core Textredux - maybe a separate module (which requires Textredux) would also have better visibility ... what do you think?

ghost commented 5 years ago

That might work.