Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Editor Find/Replace

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Editor Find/Replace

    One of my pet peeves with the code editor is that the find/replace dialog box will not stay on top. If I search for something and then click in the editor window to make a change, the find dialog disappears behind the editor. Is it possible to make it so that the find dialog will, or can, stay on top of the editor so one can quickly search for the same or new piece of code without moving the editor window out of the way. The only way I have found to do this is to move the dialog away from the edit window before searching (another annoyance). If editing in full screen mode, this gets to be really tough w/o multiple displays.

    Thanks,
    Snap

    #2
    Hello Snap,

    I will forward your suggestion to support an option to have the Find/Replace window to be always on top to our Development team and ask them if they can add this to the list of future considerations of the software.

    Thank you for your feedback.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Try "CTRL + F". It brings the open Find/Replace window to the front.

      Comment


        #4
        That works, but even the lowliest of text editors, like notepad, keep the F/R dialog on top. I shouldn't have to recall it every time I do search and edit.

        Comment


          #5
          A suggestion for Edit Find improvement

          I find the free source code editor Notepad++ very useful when developing and changing NinjaScript. Find and Replace in NT Edit NinjaScript would be much easier to use if it behaved like Notepad++

          Suggestion: Make the NT Edit NinjaScript Find/Replace window work like Notepad++.

          To compare the two do the following:

          1) Install the current Notepad++ from http://notepad-plus-plus.org/download/v6.1.6.html .
          Notepad++ C++ source code can also be downloaded there.
          2) Open NinjaScript code in side by side NinjaTrader and Notepad++ windows.
          3) Enter a Find in both windows. See 1.jpg attached.
          Notepad++ has a Transparency option that makes find and replace much easier.
          4) Enter a Find command in both windows. See 2.jpg
          5) Click Find Next on both windows and click on the source windows. See 3.jpg.
          Note that the NinjaScript is now hidden below the source window (awaiting a "CTRL + F") while Notepad++ is always on top and the source below is visible thru the transparent Find window.
          6) Click on the Notepad++ find window. See 4.jpg

          I find that it is very productive to have a Notepad++ window for the same NinjaScript that I am editing with NT. I only make changes from NT never to the source in the Notepad++ window.

          This allows me to:

          1) Browse one section of code in NotePad++ while editing another section in NT.
          2) When NinjaScript is saved or compiled and focus is returned to NotePad++ then NotePad++ gives a warning. See 5.jpg.

          If I do not reload the source then I can view it as it was when previously loaded into Notepad++. Reloading keeps the two source windows in sync.

          Update:
          Should have mentioned the NotePad++ Compare Plugin. If the source has changed and you do not reload then you can select the Compare Plugin and see the changes to the source file in side by side NotePad++ windows. See 6.jpg in my next post.
          Attached Files
          Last edited by Jim W.; 09-10-2012, 07:28 AM.

          Comment


            #6
            Hello Jim W,

            Thank you for your detailed suggestion and taking the time to post it. I will forward it to development to put it on the list of possible future enhancements.
            JasonNinjaTrader Customer Service

            Comment


              #7
              I have update my post to mention the very useful Notepad++ Compare Plugin. See 6.jpg attached
              Attached Files
              Last edited by Jim W.; 09-07-2012, 12:04 PM.

              Comment


                #8
                Jim,
                I, too, use Notepad++ for almost all my editing; however, I use a slightly different method.

                I do all my editing in Notepad++ while having a NT script open in the NT editor; however, the open NT script is not the same one I am editing in NP++.

                Once finished in NP++, I compile the odd indicator in NT. If errors are found, I quickly navigate to that line in NP++ and make corrections, save, recompile. Lather, rinse, repeat.

                Because the script in the NT editor is not the same as the one in NP++, the errors are found w/o the script being re-saved by NT.

                The only thing I like about the NT editor better than NP++ is that regions open collapsed in NT and expanded in NP++. I keep looking for a plugin but haven't found one, yet.

                I wish I knew how to set up Visual Studio to do all the editing/compiling of NT script. Does anyone use VS for this? and, if so, how do I set it up?

                Snap

                Comment


                  #9
                  Great info snaphook. I am sure that many NT users have favorite ways of using 3rd party tools with NinjaScript. Where would it be appropriate to start a "Using 3rd party Tools With NinjaScript" thread in this support forum?

                  I have never written a NP++ plugin but here is how to do it: http://sourceforge.net/projects/note.../topic/3393597 . May try to create plugins to invoke WinMerge, and Save Backup (Save source appending YYYY-MM-DD-HH-MM-SS.BAK to file name to optionally: 1) A common NP++ backup folder, 2) Backup folder named Backup in the same folder as the source, or 3) the same folder as the source). After I get one working, should be able to think of many more that would be useful.

                  I only use VS for NinjaScript debugging, but I think that the VS information that you want is here: http://www.ninjatrader.com/support/forum/showthread.php?t=18313

                  Update: Found this thread about using VisualStudio Express to Debug NinjaScript.
                  http://www.ninjatrader.com/support/f...ad.php?t=15671. (This is of course unsupported by NinjaTrader.) I am Installing VS Express 2010 to a VM and will see if it works for me.
                  Last edited by Jim W.; 09-17-2012, 08:43 PM.

                  Comment


                    #10
                    Hello Jim W,

                    You can start such a thread under NinjaScript Development Support - General Programming.
                    JasonNinjaTrader Customer Service

                    Comment


                      #11
                      I have started a thread "Using 3rd party Tools With NinjaScript" under NinjaScript Development Support - General Programming at http://www.ninjatrader.com/support/f...ad.php?t=52374
                      Last edited by Jim W.; 09-11-2012, 09:31 AM.

                      Comment


                        #12
                        The suggestion has been added to our list of possible future enhancements and has been assigned to ID# 1974.
                        JasonNinjaTrader Customer Service

                        Comment


                          #13
                          Found command to collapse all code blocks

                          Originally posted by snaphook View Post
                          . . .
                          The only thing I like about the NT editor better than NP++ is that regions open collapsed in NT and expanded in NP++. I keep looking for a plugin but haven't found one, yet.
                          . . .
                          Snap
                          snaphook,
                          Found this link http://sourceforge.net/apps/mediawik...nes_And_Blocks that describes NT++ Code Folding commands.

                          To make source in NT++ look like the NinjaScript Editor when opened you can enter the command Alt-0 to fold/collapse all code blocks.

                          NT++ is very extendable and this can be done in a startup macro. You can define user command See Editing Configuration Files in http://sourceforge.net/apps/mediawik...nedCommands.3E then start the command by "Controlling Notepad++ at startup by passing it Command Line Options" http://sourceforge.net/apps/mediawik..._Line_Switches. Or, compile it into a plugin DLL which are all loaded at startup.

                          One topic from above link "Managing text lines and grouping them into blocks":

                          Code folding
                          Most programming languages support the notion of code block. When Notepad++ detects a keyword or operator that starts a block, it inserts a fold point, which shows on the fold margin.

                          You can click on such a symbol to fold/unfold the corresponding block. Its first line is always displayed. Ctrl-clicking a folded point will recursively unfold all blocks inside it. Additionally, the View menu provides the following commands:
                          • Fold all blocks (Alt-0)
                          • Unfold all blocks (Alt+Shft+0)
                          • Fold this block (Ctrl+Alt+F)
                          • Unfold this block (Ctrl+Alt+Shift+F)
                          • Fold this block at level n (Alt+n)
                          • Unfold this block at level n (Alt+Shift+n)
                          The words "fold" and "collapse" are used interchangeably, and similarly "unfold" and "ucollapse".

                          Topmost code blocks are said to be at level 1. Their direct sub-blocks are at level 2 and so on. The block level must be a digit between 1 and 8. The default shortcuts use the top keybboard row, not the numeric keypad. Note that the folding block where the current line lies is highlighted on the fold margin. You can change the colour being used using Settings -> Styler Configurator -> Global Styles , Fold active. This will work with the box or circle folding block style only.

                          The shortcuts for folding and unfolding a level have the same appearace on the Shortcut mapper. However, collapsing commands follow Collapse current level, and likewise for uncollapsing.

                          As of version 6.1.6, folding arbitrary text is not supported. Saving the state of the folding points isn't supported either.
                          Last edited by Jim W.; 09-18-2012, 06:22 AM. Reason: added paragraph "NT++ is very extendable"

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by JonesJoker, 04-22-2024, 12:23 PM
                          8 responses
                          41 views
                          0 likes
                          Last Post JonesJoker  
                          Started by timko, Today, 06:45 AM
                          0 responses
                          3 views
                          0 likes
                          Last Post timko
                          by timko
                           
                          Started by Waxavi, 04-19-2024, 02:10 AM
                          2 responses
                          38 views
                          0 likes
                          Last Post poeds
                          by poeds
                           
                          Started by chbruno, Yesterday, 04:10 PM
                          1 response
                          44 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by Max238, Today, 01:28 AM
                          1 response
                          25 views
                          0 likes
                          Last Post CactusMan  
                          Working...
                          X