From: SourceForge.net <no...@so...> - 2006-04-10 17:04:18
|
Patches item #1328563, was opened at 2005-10-17 04:01 Message generated for change (Comment added) made by ezust You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=1328563&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Gerd Knops (gerti) Summary: Code Browser, function prototypes and function definitions Initial Comment: When using the Code Browser plugin with C files I find the following annoying quirk. When a file contains both a function prototype and a function definition for the same function, clicking on the function name in Code Browser will sometimes bring you to the prototype instead of the definition. I noticed the determining factor seems to be whether the prototype spans across several lines or not. If it fits into a single line, Code Browser will bring you to the defintion, otherwise it will point you to the prototype. Typically I am interested in the function definition (for the prototype I can use Code Browser's tool tip for example). The above happens because the regexp pattern generated by ctags for a protoype that spans across several lines only contains the first line. Because in this case the closing semicolon is notpart of the pattern, the pattern is exaclty the same for both the prototype and the definition. The plugin is coded so that only the first occurrence of the pattern is jumped to. I changed the plugin code as follows to allow for mutliple mouse clicks on a symbol in the code browser window. A double click will bring you to the second occurrence, treble click to the third, etc. Fairly simple change in file CodeBrowser.java: class MouseHandler extends MouseAdapter { ... //Change this line to goToSelectedNode(evt.getClickCount()); ... // Add 'count' argument to this method private void goToSelectedNode(int count) { ... SearchAndReplace.find(currentView,currentBuffer,0); // Add the following lines count --; while(count > 0) { SearchAndReplace.find(currentView); count --; } ... } } alm...@ya... ---------------------------------------------------------------------- >Comment By: Alan Ezust (ezust) Date: 2006-04-10 10:02 Message: Logged In: YES user_id=935841 oops - hi gerti - I just assigned this item to you. And gave you tracker tech/admin permissions. I added CodeBrowser to jedit's CVS but forgot you told me you were also maintaining it... Anyway, I don't liket he single-click and double-click approach - I would prefer a cycling through each match with each single-click on the same tree item. Any particular reason you do not want to have codebrowser in jedit's cvs? ---------------------------------------------------------------------- Comment By: Gerd Knops (gerti) Date: 2006-04-10 09:30 Message: Logged In: YES user_id=561513 Make sure you use the latest CodeBrowser from here: http://www.bitart.com/software.html Version 1.4 introduced code similar to this. For some reason several submissions for plugin central fell through the cracks. ---------------------------------------------------------------------- Comment By: Dani Carles (danic) Date: 2006-04-10 02:14 Message: Logged In: YES user_id=787769 For some reason I can't see anywhere a place to attach a file. Anyway, I'll try and paste an example here that you should be able to use to test this. At the top you have a prototype and further down a definition. Both span across more than one line. With my own patch I can go to the first or second one by clicking or double clicking. Your suggestion of remembering the number of clicks is probably better. I am not much of a Java head so I was just lazy at the time and implemented what worked for me. /*********************************************************** ***************** * LOCAL FUNCTION PROTOTYPES ************************************************************ *****************/ static ErrorCode_t HddGetWorstTiming(const void *pInstanceHandle, U32 curLsn, U32 newLsn, U32 nbSectors, U32 * seekTime); /*********************************************************** ***************** * FUNCTION DEFINITIONS ************************************************************ *****************/ /** * @brief HAL interface function for hdd GetWorstTiming function * * @param pInstanceHandle instance handle * @param curLsn start sector for evaluation * @param newLsn end sector for evaluation * @param nbSectors number of sectors to use for evaluation * * @retval FAILURE * @retval SUCCESS */ static ErrorCode_t HddGetWorstTiming(const void *pInstanceHandle, U32 curLsn, U32 newLsn, U32 nbSectors, U32 * seekTime) ---------------------------------------------------------------------- Comment By: Alan Ezust (ezust) Date: 2006-04-09 16:11 Message: Logged In: YES user_id=935841 I noticed this before, but I don't have a good test case. Can you please submit one, so I can test the patch? also, instead of counting number of clicks, I am counting number of times you repeatedly single-click the same node in the tree. That should be easier, I think, than remembering whether to single or double-click. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=1328563&group_id=588 |