Search all within opened tabs with Sublime Text 2

1,554

Yes.

Ctrl+F on Windows/Linux or +F on a Mac.

or just go to the menu "Find" and use the option almost at the bottom called "Find in Files".

To search in all open files, add this to the Where textbox:

<open files>

If you want to search in folders and such, please just look at the right of the textbox and see there's a button .... Click on it and it will show you options.

Share:
1,554

Related videos on Youtube

Jen123
Author by

Jen123

Updated on September 18, 2022

Comments

  • Jen123
    Jen123 over 1 year
        public static double sumGeom(double term, double ratio, int n)
        {
            double sum = 0;
    
            if (n<=1)
            {
                return term;
            }
            else
            {
                sum = sum + term * ratio;
                return sumGeom(term * ratio, ratio, n-1);
            }
        }
    }
    
    //Geometric sequence: 2 4 8 16 32
    //Geometric sum: 62
    

    I am a beginner to Java, and my assignment was to find the sum of a geometric sequence using recursion only.

    The parameters are: term = 2, ratio = 2 and n = 5. Above is the code that I attempted. I am having a very hard time visualize how recursions work, so I do not know what went wrong with my code. Instead of giving me the desired answer of 62, I am getting 32 instead. What is wrong with this code?

    I have tried this version as well but am still getting 32 instead of 62:

    public static double sumGeom(double term, double ratio, int n)
    {
        double sum = 0;
    
        if (n<=1)
        {
            return term;
        }
        else
        {
            return sum = sum + sumGeom(term * ratio, ratio, n-1);
        }
    }
    }
    
    • Jean-François Savard
      Jean-François Savard over 6 years
      What parameters are you passing to the method?
    • Thomas Weller
      Thomas Weller over 6 years
      Do you know what a debugger is? Run your code under the debugger and go through it step by step. You'll learn a lot.
    • Tom
      Tom over 6 years
      Wouldn't it be clever to actually do something with sum? Like using it to calculate the return value?
    • Kacper Wiszczuk
      Kacper Wiszczuk over 6 years
      This is because you are ignoring 'sum' variable in recursion calls, and you end up with returning only last item from geometric sequence. You should rather return sum + sumGeom(...).
    • Jen123
      Jen123 over 6 years
      I returned sum + sumGeom(...) but it still doesn't work
    • Tom
      Tom over 6 years
      Now come on, please think before trying random stuff. Your sum will always be 0.0, what do you expect here?
  • lucas
    lucas over 7 years
    Mamsaac's answer is also supported in Sublime Text 3, for those who are wondering.
  • jan deeg
    jan deeg almost 6 years
    When I try this (Sublime Text 3.1.1 on Mac OS), it doesn't search all open tabs; it only searches open tabs within the current window.
  • AlexLaforge
    AlexLaforge about 3 years
    You can also leave the "WHERE" text box Empty instead of typing <open files>.