Sometimes, when coding in RAD Studio 2009 (Delphi), suddently the behaviour of the code editor changes. After such an event, a selection is no longer cleared on character input. This often happens after a session of very intense coding (many characters per second!), so I might accidently hit a keyboard (shortcut) combination.
Is this the case? How to "fix" the issue? (I want my selections to be ereased upon character input!)
This is a bug, and you don't have to quit and restart to fix it. Just hit Insert twice (which changes the text entry mode between Insert and Overwrite and then back) and your text selection will be back to working normally. It's notoriously difficult to pin down, though from my own experience it seems to have something to do with mixing SyncEdit and Undo. If anyone's able to find any way to reproduce this consistently, please send it to QC.
When this happens, you should be able to toggle the "Persistent blocks" option on and then off again. Go to "Tools | Options | Editor Options". Turn on "Persistent blocks", and click OK in the dialog. Then go back and undo that operation, and the editor should reset itself.
BTW, this is definitely a bug. If you are able to reliably reproduce it, a test case submitted to QualityCentral would be most useful.
Quit and restart the IDE is probably your only solution.
I have found some IDE/Editor instabilities too. It's probably a bug. Restarting the IDE solves the issue.
And I haven't found it in 2010 yet.
Related
Using C++Builder v10.4.2.
When compiling, errors pop-up a modal dialog which I have to close to go to the offending line(s).
Is there a way to turn this off and have the IDE take you directly to the error?
I believe the IDE used to work like this on previous versions.
I found the solution. If you don't have background compilation turned on, you get this modal dialog which you must close to proceed.
If background compilation is turned on, you get a similar dialog though non-modal, which allows you to go to the offending line without closing the box.
Why there would be two versions is a mystery.
Does anyone else have this problem or is my Delphi cursed somehow?
I'll have a bunch of forms and files open in tabs in the editor and I'll be typing away and then suddenly everything stops - my .pas file has, seemingly at random, become read-only.
Sometimes I can just right-click the tab at the top and uncheck "Read-Only" and continue, but sometimes this option is checked and greyed-out (disabled), meaning I can't uncheck it and I can't make any further edits to the file. This too seems to be random.
In the latter case, the only solution is to save the file in question, which works, despite Delphi's assertion that the file is read-only, close its tab in the editor, and re-open it. Not catastrophic, really, but it's starting to become annoying.
Could it be that I am hitting a keyboard command combination accidentally to do this or is this a bug in Delphi?
I'm in Delphi 2010, Windows 7. Doubt it's anything to do with installed packages, but if anyone wants the list I'll generate it and attach it here.
Skip to last paragraph for quick Solution :)
Yes! this just happened to me. I was typing a line of code... a line in Intraweb's ServerController.... OnBeforeDisbatch.. anyways. I was typing..
If
and then I typed a Space... so If <---- then space... and then the IDE autofilled in
If True then
after the above line was in the system all hell broke loose.... hell being that the file would stay in a read-only mode....
I edited the file manually and removed the line
if True then
and all is good.
just to update: I do believe it is file size... 125K and then bang. at least on the server controller... IW10/Delphi 2010
update again... 8 hours later...
I reduced my source file (iwservercontroller) from 125k to well under 80k and all was good. then now right when I first press the control key to paste over a value the file goes read-only!! like wow....
going to reduce file again..
Minutes later...
after shutting down d2010 and reloading project... I have narrowed down the problem to using the "paste" command.... the second I tried to paste a clipboard value read-only occurred... but a harddrive hit occurred for a instant before the read-only activated!
Final solution!!! I got it! I couldn't believe there is a "Read Only" option in the Right Click Menu.... Click on the left side Pane where the check box is when the Read-Only appears! no more need to restart IDE and reload everything etc etc...
All fixed... whoo hoo
Nope... not all fixed... 3 hours later... I reactivate IDE and I am just about to paste in some data and then the file goes in read only (not explorer's file attributes) and the Pop up menu value is now grayed out!! like wtf!!
Full day later.. trying everything.. I have a solution!! first time I got it to go off read-only without using the PUM/insert Key
simply just access the unit in question that is causing read-only and do a single character change with a outside app. (ultraedit) and save. upon saving d2010 will detect outside changes and go switch back to insert-mode even with the pop up menu is disabled.... whoo hoo...
* Final Solution *
Things are all good now and not a single read-only but the solution is not too elegant in terms of keeping my text edit habits in check.. but if you open settings and change the editor to keep insert mode on you will be laughing to the bank... at least things are all good for me now.
Delphi2010-->Options-->Editor Options-->["Insert Mode"] check that option.
Seems since i have had the above checkbox clicked not a single Read-only.... good luck.
This happened once to me. I think it's a bug, I can't find an existing report for it and when you find repeatable steps the please create QC report for it.
This happens to us all the time - once a file gets over a certain size/complexity Delphi starts randomly going read only - sometimes accompanied by freezing for several seconds.
We think it's something to do with the syntax highlighter failing on certain constructs - certainly it comes and goes in waves, and I've had times where I've been reduced to editing a file in notepad just to get some work done.
It happens on units with no related DFM, so it's not a component doing it, and it's not storage related (Delphi isn't writing to the disk when it fails).
Yes, this just started happening to me after I installed Model Maker 11. I think the Model Maker plug-in might be monkeying around with the read only setting of a source file. (I've been using Delphi 2010 for a year now without this issue ever happening, all of a sudden it started right around the time I got MM11.) I haven't tried uninstalling MM11 yet though. So --- do you have ModelMaker 11?
I've seen it many, many times in Delphi 7 which rules out some of the explanations others have suggested.
I haven't seen it on 2010 but I haven't done all that much with 2010.
I also see a switch to "readonly" for pas files in the D2010 editor. None of the above suggestions have always worked for me. I am transferring a large project from D6 to D2010 and am making many necessary changes. On way to overcome the problem for a file that has been marked "readonly" and where (right-click in the editor "[ ] Read Only") has been greyed out, is to close the file and reopen it.
I face a very annoying bug in D2007 IDE :
It's the second time I have this problem within one month (on two differents computers, but with the same project), and it is a very annoying bug that causes the IDE to close itself without allowing me to save any changes in the code.
I tried but cannot reproduce the bug, it only appears randomly.
Here's what happen exactly :
i'm changing a line of code then (when I press "enter" to go next line)
the message
"Assertion failed: amount >= dest - startDest, file ek_flbuf.cpp, line 315" appears.
and when I press OK an second message "Abnormal program termination" appears.
Closing this message cause the IDE to quit.
When googling at my problem i found QC 33917 but the status is Closed : Cannot Reproduce
My questions are :
Is there any known workaround to this problem ?
can this problem be caused by third party stuff ? (I'm using GExperts and Delphi SpeedUp)
Does anyone here encountered the problem on a more recent IDE ?
UPDATE :
I remembered the problem occurs the first time (a month ago) within the same Unit.
so maybe the problem is not only project related but unit related.
I've restarted Delphi and returned in the same function where the problem appears today, trying to reproduce the bug only typing some code then deleting it, again and again, like a mad...
just restarting delphi and editing code in the unit (no other actions before), I managed to reproduce the problem a second time today ! but no more, despite many new similar tentatives... :(
...still investigating. (and thank you for the answers, I will now stop trying to reproduce the bug and check the answerers hints.)
The last time I have seen this, is when one of my source files had inconsistent line endings.
Make sure all your lines in all your source files end with CRLF.
--jeroen
When I used 2007 and saw this, it only happened on very long units (10,000+ lines - having that many is an issue for another discussion :p) Usually the IDE would be fine, then typing would become fairly slow - I could see the letters I typed lagging behind in the code editor. Unless I paused and let the editor catch up, I'd get that error.
So, my fix was:
If you're in a large unit and the editor starts lagging, pause, immediately. Let it catch up, and keep going.
This is really annoying, but worked for me.
I also turned off many of the Code Insight features, but I don't know if they affected this particular issue or not. They did help general editing speed. Turning them off was recommended to me in the then-Codegear forums. I can't remember who by, but I have a vague feeling it may even have been one of the Codegear QA staff who was aware of the bug but was trying to see if I could narrow down what affected or caused it. This was a couple of years ago now though, so don't take that as gospel.
Splitting your files into smaller, say <5000 line units may also help. For me it only happened on large and complex files.
The issue seems to have been fixed in RAD Studio 2010. Another way to avoid the error would be to upgrade :) If you do, wait a few days or talk to their salespeople first. The next version, RAD Studio XE, is due out at any moment. I'd recommend upgrading anyway: you'll need to handle Unicode issues, but other than that the 2010 edition is the best version I've used, including its stability, and I've used Delphi since version 1.
The first thing to try is to remove both add-on packages (GExperts and Delphi Speedup). It could be something they are doing.
The second is to do your best to reproduce and submit the issue.
The third is to upgrade to a new version of Delphi and hope that it solves your problems without creating new ones.
If this happens on two separate computers, but the same project on both, then the problem is most likely in the project itself and not the IDE. Of course, you didn't post any of the code that causes the error message to appear, so it's hard to help you find out what the problem is with the code. I find it very unlikely that the problem is the IDE, though, or others would have reported the same problem (D2007 has been out and in use by millions of developers for years now).
If the problem is in the IDE itself, you should be able to reproduce it with a new, empty project. Copy and paste only enough of the code from the old project into the new one to allow the problem line to compile, and then replicate the same change->press Enter to add a new line - does the same assertion failure and then abnormal termination happen?
If you can't reproduce the problem in a new project, the problem is most likely with your code, and without seeing it it's hard to tell what might be causing it.
This is driving me crazy. I'm not going to take it anymore. I'm going to ask, even at the risk of eternal public humiliation! (If it's something really obvious or that I've done to the system myself).
For reasons I've never quite had the patience to work out, every so often the form I'm working on in Delphi 2007's visual form editor goes 'pseudo-read-only'; I can add new components to the form, I can move/resize existing ones (and change any properties in the Object Inspector), and I can select a component and 'copy' it to the clipboard.
But I'm completely unable to cut a component from the form, or paste a new copy down. I don't believe it's to do with the 'Lock Controls' Edit menu option as I can toggle this on or off and it has the effect it's supposed to - this disappearance of Cut & Paste happens on the right-click context menu, from the keyboard and from the main Edit menu - it's as if the form has become read only to thing to do with the clipboard.
If I close the form in the IDE and then reopen it, everything starts working fine again (just as D1, D3, D5 and D7 always did for me, previously).
I'm not going mad, as I'm sure I read something about why this happens on a newsgroup once and it's caught me out from time to time many many times in the last few months, but I've failed to find the newsgroup reference this evening and I've decided that, as more and more Delphi users seem to be making use of StackOverflow, it was worth asking here.
Help - when I'm doing lots of form-work it drives me absolutely mad!
you can try to download the clipboard monitor application to see if anything is messing with your cut/paste. I have noticed simular problems when running in a VM, the VM gets confused as to what is in the clipboard and won't let me cut/paste again until I go back to my host application open something else (notepad works fine) and copy something fresh. I think thats more a problem of the other clipboard monitoring applications on my system than anything else.
I'm using copy/paste "desing" a lot, but they never went away.
Are you using some other IDE addins that mandle with copy/paste?
I think it is a known bug in the IDE, but I can't seem to find any references to it. I also have experienced this problem. You might want to try IDE Fix Pack, although it does not claim to fix this problem.
Check that other apps can use the clipboard too. Sometimes I am paused in the middle of a clipboard operation in my app, which stops other apps opening the clipboard. Can be confusing!
The virus detector app: Webroot SecureAnywhere stopped pasting from working - when I disabled this dumb virus detector - all was good again.
I think you should try the Desktop Settings. I had the same issue and after changing the Setting to Debug, Cut/Copy started working.
Maybe this is an overarching question as I've seen similar bugs in Firefox and I'd like to know how to avoid coding them.
For no apparent reason, the function keys, arrow keys (de-numlocked numpad as well), the 6 keys over the arrows, and backspace stop working. Every other key seems to work leading me to think it's some sort of interrupt issue. It works again when I restart Delphi.
This is on an IBM Model M keyboard so certainly it couldn't be a hardware issue, although if someone knows better I won't be that naive, I've noticed this with different keyboards.
I'm not actually interested in a fix for Delphi, I just would like to know how to avoid keyboard input bugs. I'm most certainly debugging bug laden code. I just wonder why it causes parts of the keyboard to malfunction.
I doubt that it's Delphi's fault. I'm using Delphi 7 and never had this problem. I suggest you look for another culprit.
If this happens when in the debugger, it is possible that the message processing for a keystroke is failing to be completed. Try pressing all the Alt, shift, control, and all other such keys to see if the issue clears.
Or is it a faulty Global Keyboard Hook? Try disabling as much utilities that have global hotkeys.
Ha! I finally figured out what was doing it, I've got MadExcept installed and when I used Ctrl-Shift-C to autogenerate class functions I was getting a delphi exception. I'd get an error and it was secretly a MadExcept error. If I clicked OK it would stop me from entering some "meta"-keyboard input. If I Ctrl-Shift-C again on that stub class and the error pops up. I can hit Details, then it tells me regular MadExcept info about the error. I can hit Details and continue programming, and my IDE is fine again!