Function List Updating

Syntax highlighting, code folding, brace matching, code indenting, and function list

Function List Updating

Postby crusy » Thu Jan 08, 2009 10:54 am

How can I make the Function List update every time I insert or delete a line in the Editor so that it would always be up to date (not only after pressing F8 or reloading)? I am using 14.20.1.1006 with my own language definition.
crusy
Newbie
 
Posts: 4
Joined: Thu Jan 08, 2009 10:45 am

Re: Function List Updating

Postby Mofi » Thu Jan 08, 2009 12:00 pm

That is simply not possible.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Function List Updating

Postby crusy » Fri Jan 09, 2009 2:14 am

How can I request (wish) this from IDM? Have others had this concern too? I can't find anything in the forums.
crusy
Newbie
 
Posts: 4
Joined: Thu Jan 08, 2009 10:45 am

Re: Function List Updating

Postby Mofi » Fri Jan 09, 2009 3:35 am

crusy wrote:How can I request (wish) this from IDM?

See top of this page.

crusy wrote:Have others had this concern too?

I don't think so because the performance loss will be dramatically. To scan whole file with several complex regular expression searches every time a line is inserted/deleted would cause a significant delay when typing. And lines can be inserted/deleted not only by you with the keyboard, it can be also done with clipboard copy/cut/paste, replace (all) command, macros, scripts, tags, templates, HTML toolbar commands, ...

UEStudio is an IDE specialized for writing programs and scripts. It's IDE configuration has an option to scan for functions every time a file is saved and updates the function list accordingly which makes more sense then update the function list on every line insertion/deletion.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Function List Updating

Postby crusy » Fri Jan 09, 2009 4:56 am

I don't think the technical implementation is that difficult, but I'll leave that up to IDM. I don't think you would have to research the whole file every time a line is inserted or deleted, all you need to do is move the address of all the pointers in the function list to the file up or down by the number of lines being changed (for those functions after the lines being changed). We would still refresh the regular way if there is a new function or if one has been removed.

What do you think, Mofi?
Greetings from a neighbor in Switzerland.

I'll send an email to IDM support with a link to this thread.
crusy
Newbie
 
Posts: 4
Joined: Thu Jan 08, 2009 10:45 am

Re: Function List Updating

Postby Mofi » Fri Jan 09, 2009 10:23 am

Aha, you just want that UltraEdit updates the line numbers of the functions already present in the function list for the current file (and ignoring the other project files) depending on the line number of current cursor position and how many lines were inserted or deleted and not update the list of found function names. That would not cause a high performance loss, but is nevertheless not really simple to implement.

A more easier method for updating the line numbers would be the method which I think is used by some IDEs. When a function in the function list is activated, the cursor is always set to the correct function definition line because the IDE in the background checks if this function name can be found on the remembered line (= 1st and fast test) and if not search whole file to find it on a new position (= 2nd test - fast for small files, problematic for large files with hundreds of MB) if the function name is still present in the file at all (last condition - use remembered line number if not found anymore). The line number of this function could then be updated too.

The disadvantage of this method is that the feature which highlights the name of the function in the function list where the cursor is currently located will not really benefit on this "test and find on activation" method.

However, ideas and suggestions are accepted always by IDM at all.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Function List Updating

Postby Mofi » Mon Feb 02, 2009 6:46 am

Hotfix info for UE v14.20.1.1008 contains the line:

Function list now automatically updates

and indeed the line number for every function in the function list is updated in the background when inserting/deleting lines with the keys RETURN, DEL or BACKSPACE, when cutting/pasting 1 or more lines, when inserting a multi-line template, when duplicating a line or delete an entire line, when undo/redo a multi-line modification, and maybe also when using other features which modify the line count.

The line numbers of the functions in the function list are not updated when a replace is executed which changes the number of lines in the file. So in this case a manual update of the function list is still required.

But I think you and many other users are very happy now, I too. That is a great enhancement hidden in a hotfix version. I can only recommend that all users of UE v14.xx using daily the function list should update to this version.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Function List Updating

Postby crusy » Thu Mar 12, 2009 10:51 am

Its a pity I only just today noticed the fix!

By the way of interest, when I sent my message to support I tried this in V11.20a and there it had already worked. So it must have been broken since V11.20a. We only just updated to V14.20 because of Vista :roll: :wink: and then noticed the missing of this functionality.

Well the three of us working with UE here are happy campers again!
crusy
Newbie
 
Posts: 4
Joined: Thu Jan 08, 2009 10:45 am


Return to Syntax Highlighting