ruben2020 / codequery

A code-understanding, code-browsing or code-search tool. This is a tool to index, then query or search C, C++, Java, Python, Ruby, Go and Javascript source code. It builds upon the databases of cscope and ctags, and provides a nice GUI tool.
https://ruben2020.github.io/codequery/
Mozilla Public License 2.0
685 stars 86 forks source link

implement highlight occurrence or implement find functionality. #24

Open MHL3060 opened 11 years ago

MHL3060 commented 11 years ago

It would be nice to have some sort of navigation functionality on the file view window.

Things that nice to have are: 1). able to jump to/jump back to the definition (like ctrl+T and ctrl +] in vim). 2). highlight occurrence. 3). find dialog box.

ruben2020 commented 11 years ago

Hi,

This is a good idea for future enhancements.

However, for the time being, you can use the "Open In Editor" button to open the file in your favourite editor (e.g. gedit, Notepad++, eclipse), and jump to the selected line. Your favourite editor can be configured in Options -> External Editor.

There seems to be a bug with the help text in the External Editor settings. It should be for example:

gedit %f +%n

CodeQuery will replace %f for filename and %n for line number

ruben2020 commented 11 years ago

1). able to jump to/jump back to the definition (like ctrl+T and ctrl +] in vim). This can already be done with the existing features. When a file is open in the fileviewer, you can select a keyword by double-clicking it. When something is selected, the "Copy, Paste and Search" button (above the fileviewer) becomes enabled. When you click it, it will search that keyword. This is like Ctrl-]. If you check the "Symbol Only" checkbox, then it will always perform only the Symbol search for "Copy, Paste and Search", no matter what kind of search option is selected in the Combo box (e.g. Functions that call this function etc.). Then, if you press the "Previous search term" arrow button, which is to the left of the search bar, it would go back to the last search term. This is like Ctrl-T. Are you happy with these?

2). highlight occurrence. This is a good idea. Highlight all occurrences of the searched keyword. In addition, we could also have Up and Down arrows to go to the next or previous occurrence of the keyword in the same file. The list box selection would also be updated accordingly. So, instead of highlighting the entire line as we do now, we could just highlight the keywords.

3). find dialog box. This might make the UI too complicated. So, I will leave this to the external editor for the moment.