Forum > Editor
[forget it] A request or maybe its already there?
jamie:
Feature request or show me where it is?
At times I am deep in a long list of code in a procedure where the VAR section is out of site! I need to add a variable to my local list of that procedure as I go along but it requires me to scroll up and set it or use the bookmarks so I can return.
The auto-complete code to do this just does not seem to work well in-place so I have a much better idea that would allow for one to view what is currently listed in the VAR section and add a new variable without leaving the location of my current editing spot.
It would be nice to use a Hot-Key or control sequence to popup a dial window with the current list of the variables in that block, I suppose we could have tree structure to show the global variable section of the unit, too, or even maybe some local procedures to that block.
I use Code-Explorer but that does not cut the mustard as it does not allow you to insert a new variable on the fly. Also, it does not really give you a good view of your variables.
This needs to show the VAR section block and allow you to insert a new variable and check against duplicates etc.
and when closing the dialog could even elect to auto-insert that new variable in-place where you were!
How a bout it?
Josh:
Hi
If you put a valid statement with new var name
ie
fred:='gt';
place the cursor on fred, right click->refactoring->declare variable, it then asks where you want to declare it and its type
Alt-O R D
if its already defined you get a message
jamie:
Ok, it would be nice to also see the current list of variables there, too.
let's see, create a variable that may or may not exist, who knows, right click, then right click again, hum...
I still would like to see the whole list there and so I can simply insert as if it was a mini editor.
I'll take your suggestions under advisement in any case!
My Right-Click+Refactoring does not show an option to declare a variable..
Sorry.
I still want the to popup window in place that shows the current local list and able to insert what I want.
Josh:
hi
if i right click the fred part, refactoring, declare variable or ALT+O then press R then press D
if anchordocking then you can see a list of vars in the procedure on the right in code explorer.
if not anchor docking open code explorer
440bx:
I often run into the problem you described... here is how I solve it...
First, I often set a bookmark to the beginning of the "var" section.
Second and, most important, I usually have 2 editor windows open side by side. The left side shows the code part, the right side shows the "var" part. That way, I only have to switch from one window to the other to declare the variable and, that gives you a full page of already declared variables. (see the attachement.)
Also, I do the same using the editor I use when I am really coding (instead of just making minor adjustments - usually when testing/debugging - which is when I use the Lazarus editor.) Effectively, I always 2 editors running with side by side windows showing different parts of a function/procedures. The main editor usually has several dozen windows open, some belonging to the project I'm working on and many other windows from other projects that I copy/paste code from.
I find having a file showing in two different editing windows to be the most convenient solution because the text isn't jumping around to another location. Everything stays put, which makes it much easier to deal with.
HTH.
Navigation
[0] Message Index
[#] Next page