How can I keep IDEA from changing my active tab when I open other files - intellij-idea

A little annoying thing, but it happens all the time...
Here I am, minding my own business, coding away happily. I have CatClass.java and DogClass.java open in different groups (and usually lots of other files as well):
I want to open and edit CatService.java:
Unfortunately it opened in the wrong group, I wanted to see it side by side with CatClass.java. So I decide to move CatService.java to the other side:
Boom! Now the original group is not anymore in the CatClass.java, but has changed to some other file.
This is seriously my biggest problem with IDEA, I usually have tens of files open in both groups and digging through the tabs, getting back the file I was in just a moment ago, really hurts the flow. Is there a way to prevent this?

This turned out to be a known (old) bug:
https://youtrack.jetbrains.com/issue/IDEA-125946

Related

Ignore a directory In PyCharm "Find In FIles" search results

My question is the same as the one posed here:
Ignore a folder in search results
I'm using PyCharm rather than IntelliJ-IDEA, but I'm guessing that features common to all JetBrains IDEs should work the same. If the accepted answer actually did what is suggested, it would be just what I'm looking for. But it doesn't work for me. It does something interesting, but not what I want.
I have marked directories I don't want searched as "Excluded". My problem is, files aren't excluded from my search results as suggested. The interesting thing is, matched file in the directories I've marked Excluded ARE HILIGHTED to indicate that they were found in one of those directories. So I know I've got everything set up right. The GUI is showing me which files I can myself ignore by way of hilighting them in the search results window. So if it's going that far, surely there must be an option somewhere to exclude them completely. I've looked and looked. I can't find such an option.
Here's a sample result so that you can see what I'm talking about in terms of the hilighting:
Here, what I want is for the first four files shown here to show up but not the remaining eight. Can anyone tell me how to get Excluded files to not show up at all in a Jetbrains Find in Files result window rather than just hilighting them differently? TIA.
I sent off a tech support request to Jetbrains. They got back to me in less than 24 hours (I've always had great response times from them). Here's what they said:
Your understanding is correct -- the excluded directories should not
appear in the search result. However, if you just marked the directory
as excluded, it may require a project refresh to update the indices.
This is done when you reopen the project.
If the issue is still reproduced after reopening a project, there may
be an issue with indices, so please try File | Invalidate Caches... |
(Check all boxes) Invalidate and Restart.
If that doesn't help as well, please check if the issue is reproduced
in a new empty project with a minimal structure to reproduce the
issue.
I had already tried reloading my project, then restarting PyCharm, and even rebooting my Mac. None of those things helped. I had thought to rebuild the indexes, but I've got a number of large projects and was concerned that I'd keep hitting delays every time I opened one of them if I cleared out all of PyCharm's caches. But that was about all I had left to try, and since Jetbrains told me to try that, I did.
...and...clearing all PyCharm caches fixed the problem! I no longer see any of the files in Excluded directories when using any of the search modes in the "Find In Files" dialog. To be quite sure that the re-indexing fixed this, before clearing the PyCharm caches, I made a point of closing everything, then opening just the one project I was having trouble with, and then doing a straightforward search. I saw files from Excluded dirs that shouldn't have been there. Then I cleared all the PyCharm caches, and quit and restarted PyCharm. Then I did the exact same search I had done just a few minutes earlier (it took about 5 minutes to re-index the project). The results this time were to only show me what I expected/wanted. The files in Excluded directories were gone from the search results.

Excel VBA App stops spontaneously with message “Code execution has been halted”

I have exactly the problem described here:
From what I can see on the web, this is a fairly common complaint, but answers seem to be rarer. The problem is this:
We have a number of Excel VBA apps which work perfectly on a number of users' machines. However on one machine they stop on certain lines of code. It is always the same lines, but those lines seem to have nothing in common with one another.
If you press F5 (run) after the halt, the app continues, so it's almost like a break point has been added. We've tried selecting 'remove all breaks' from the menu and even adding a break and removing it again.
We've had this issue with single apps before and we've 'bodged' it by cutting code out of modules, compiling and then pasting it back in etc.
The problem now seems to relate to Excel itself rather than a single .xls, so we're a little unsure how to manage this.
I have managed to resolve it with the accepted answer, but now, when I send the VBA file to my colleagues, they have the same problem.
My question and my problem is - any ideas what to do, as far as it is really not a good idea to go to everyone and to debug every time. And I somehow do not want to add Application.EnableCancelKey = xlDisabled to my macros.
Sounds like a ghost break. File saved one time with a break in there. What has worked for me in the past was to remove any breaks you see and manually step through the code (F8) through completion and then save file. Prob now necessay to step all the way through but I like to know I went all the way and didn't miss any.

On Smalltalk IDEs (Squeak, VisualWorks, etc), how can you navigate away from a message's code you're working on to inspect another?

In every IDE I've tried so far, if I'm partway through writing a message and need to look at the code of another, the browser asks me if I want to save. But if I say I do want to save, it actually tries to compile/syntax check the code, and refuses to perform the save if it does not pass. The only way to view the source of another message seems to be to say "no" to save and have everything wiped. How can I look at another class incidentally, or save code I am partway through working on that might not build right now?
Smalltalk is a multi-browser system. You'll need to have lots of different browsers open. Smalltalk is opinionated. The system browser (Nautilus) doesn't make it easy to view long methods, steering you towards writing short ones. It doesn't make it easy to have non-compiling code in a method, to steer you towards making small changes.
Experimental/prototypical code you might want to have in a Workspace/Playground. That can save to disk.
We are aware that it is an issue for people new to Smalltalk. We tried some fixes, they were a lot worse.
For now there is no easy way to do that. The two easiest opting are
Make the current method syntactically correct and save it.
Open another browser. If you want to see a class or method that is in your current code, you can cmd+click it or use "browse it", "implementors of", shortcuts that will open another window.
Also in pharo you can use GTSpotter to quickly find what you are looking for and preview its source code
When you say "this seems like a pretty huge thing to be missing,
and it could be gotten around by just having the option to use
a regular editor" I'm afraid you've entirely missed the point.
Understandable, though -- happens to us all.
Or did. Perhaps it was long ago, but we
were all there.
You might be thinking about the task in terms of
scrolling a giant text up and down to find what
you want. Scroll up -- read a little -- scroll back --
and continue making your changes.
And when you say " I can't imagine any circumstance
where it is OK, in pursuit of any agenda, to throw away
the coder's work against their will "
you are spot on correct, of course.
Imagine -- scrolling around, making dozens of little changes,
and before you've saved them -- poof -- they're all thrown away --
a mistake, perhaps, but completely against your will.
That would be awful. We're agreed.
(In fact, the editor I'm using to type this
is like that -- I can scroll around the whole thing,
making little improvements, all over, but it could
all go --poof-- and disappear, All of it.
Fairly common occurrence, when editing the web.
)
So let's try another run through that same task.
You get one little teensy, DUMB AS A POST editor,
where you can only see one thing at a time.
And now you just want to scroll somewhere else,
for a moment, and come right back.
Which actually means that
you are attempting to look up a second method,
while already changing a first method
(which would require the browser toforget the
context of the first method, and move to the second).
The browser does not know how long you will be away
from this context. You might go chaining along from
place to place, stop and read an email, take a call,
and go to lunch.
So, the browser cautions
"Hey - want to save this first?"
as if to say:
"
Hey - I can't imagine any circumstance where it is OK,
in pursuit of any agenda, to throw away the coder's work
against their will.
So listen up, coder.
You want to save this first?
"
But you can't save it.
You must first look something up.
Conundrum.
Ah-ha! There is a list of methods in that other pane.
One of them is highlighted.
Not those -- that one.
Double click that one.
The one you're already in.
As if to say
" Thanks. Good catch.
Yes, I know - can't though.
I need to change contexts.
You stay right here.
And give me another context
to go wandering about in.
please.
"
Soon, I expect, they'll start actually talking.

Intellij IDEA 14 Ultimate cursor jumping around in Java Code when hitting Enter from time to time

Sometimes when i hit Enter behind a line to write the next line my cursor jumps down like 300 lines of code within the same Java class which is absolutly annoying.
It jumps just to anywhere within the same file but always somewhere faar below the line i hit enter behind ... so its not jumping to a definition or something like that - it literally just places the cursor to a random point.
Did anyone ever had a similar experience? (I cant find anything on the internet hence i think its either a very easy to fix thing or something for the support).
Like could this be a side effect of defined live templates or something like that?
ANY suggestion could help since i tried out anything i could think of (code completion, live templates, editor settings - nothing looks like it would trigger this behaviour)
Note: I dont like this question at all but i am realy lost right now.
I have not seen any one run into this nor have I seen a bug report on such (and something like that would be a critical). I recommend the following steps:
Upgrade to the latest v14.0.3 if you are not at that version
Invalidate your caches and restart, then wait for IntelliJ to re-index your project (this is a bit of a long shot, but worth the couple of minutes it takes)
File/Application > Invalidate Cache
Disable all third party (i.e. non-bundled) plug-ins and restart
My strongest suspicion is that a 3rd party plug-in is causing the issue.
If this solves the issue, isolate the plug-in causing the issue and contact the developer.
If none of the above work, provide as much detail as you can about the issue as #Makoto suggests. What type of file; what are you doing; OS; IDEA version; etc, etc.

Xcode 5 constantly crashing. Looking for root cause.

I know this is a site more for coding questions, but I have been having a problem with my game crashing for about two weeks now, and Apple hasn't even begun to be helpful in solving the issue or even identifying what it could be. I was hoping maybe someone has experienced something similar and could at least get me pointed in the right direction.
For about a week I had a problem with Xcode crashing every time i accessed a current file (gameboard.m) in my game. This file had existed in my game for months and NEVER caused a crash and never did until a few days after I installed Xcode 5. Whenever I would be working, and click on my gameboard.m, it would, with increasing frequency, crash xcode. When looking at activity monitor, my free ram would go from 5gigs to about 10 mbs, and I would have to force-quit xcode.
After gameboard.m would crash xcode, it would crash xcode upon opening every time after that. I found a temporary fix for the issue by duplicating my file, going into it and deleting the gameboard.m file, then copy and pasting it from the previous version and re-importing it.
Sometimes I could click on gameboard.m and it would open just fine, but then if i press Cmd+Opt+Shift+Left to collapse all my methods, THAT would crash xcode. Every time xcode crashes its the same thing, Ram goes to 0, freezes until force-quitted. After the first week and about 30 copy-pastes fo my game, my quick fix stopped working and I couldnt open ANY file on my desktop, including files I havent opened in months.
So far I've submitted a bug ticket, to which i have gotten no replys besides asking for additional crash reports, I've reinstalled xcode MANY times, created a new user and tried working on that, and am about to reinstall my OS. I'm trying to figure out if it is a code related problem, or a hardware problem that needs to get fixed. I know I have some memory leaks in my game which I am trying to address right now (I've been teaching myself how to program since the start and this has been a gaping hole in my education until now. Any good source material you guys know of point it my way!!)
Side question: If you have a memory leak, when does the computer take back over the allocated ram? Exiting simulator? Restarting computer?
Again, i know this is a bit of an unusual question for SO, but I've been unable to do any work for 2 weeks now and I cant see any end in sight, so any help or ideas i can get from you guys would be very helpful. Thank you!!
The most common way to resolve Xcode crashes is to clear out the derived data directory. Go to Preferences>Locations to find out where it is. Delete the whole directory tree. The default is ~/Library/Developer/Xcode/DerivedData but it may be different for you.
That said, the fact that this continued even when you were working as a different user is troubling, since by default the derived data directory is per-user, but it is possible you've set it to a single place.
I'm assuming by 'bug ticket' you mean the RADAR system (with its new facelift). If this is really preventing you from working on your app and that is critical, what you need to do is file a Technical Support Incident. You get 2 with your developer account, and you can buy 2 more at any time. This will put you in touch with an apple engineer that will focus on finding a solution to your problem as quickly as possible. I've only had to use it twice, and both times they had a solution for me within 48 hours.
I solved this by closing the project, then opening only the offending file in Xcode 5. Then 'Save' and the project then opened fine!
My Xcode was crashing every time I opened it for the last opened project. I got the issue resolved by following the following steps took from here.
Open a Finder window and navigate to your project
Right-click on the .xcodeproj file (it’s a package actually)
Select Show Package Contents
A new window appears
Delete a folder called xcuserdata
Also, delete scuserdata folder from project.xcworkspace inside the .xcodeproj file