mac automatically selecting text after delete - macos

Running OS X 10.9, though the issue occurred in 10.8 as well, and I've noticed it in Xcode and Netbeans. When I highlight some text and delete it, usually some variable or string with in some code, the selected area stays selected, basically selecting the next set of characters. So when I continue typing, I type over that bit of selected code.
For example, say I have the following bit of code selected between the brackets:
The quick [brown fox] jumps over the lazy dog.
Now after I delete the text, the following text between the brackets will be selected:
The quick [ jumps ov]er the lazy dog.
The expected result would be to have no text selected and the cursor simply at the the 'J' (or space before) in the word jumps.
I've searched for this type of behavior in Netbeans and Xcode, but haven't found anything, so I'm concluding the behavior is with in OS X, but I haven't found anyone else with this issue nor how to remedy it.
Thank you for any help.

It´s an old issue, but still persists. This answer does not provide a solution but a recording of the issue happening in mail, which may help finding a reason. First you see a successful mark-and-overwrite, then a failing one. After that, I hit undo and redo several times, to show that the issue was recorded in the editing history. See the video in the following link:
https://www.dropbox.com/s/av3jtp7knhh8wki/Text_input_bug.mov?dl=0

Related

How can I fix Xcode's open quickly?

I wonder if I'm doing something to make it not work, but simply put after tapping cmmd + shift + O or going to File >> Open quickly the option doesn't show up. It's like I did nothing.
Wondering if this is a known Xcode bug or if I'm doing something.
I'm using Xcode 10.1
You probably have more than one monitor connected.
This is something that confused me a lot of times as well; the quick search prompt will remember its position (you can drag it around) even on secondary monitors.
For what is worth, in my opinion, that field should always be presented on the current (in focus) editor.

Why is VS Code adding many blank lines at the end of all my files?

I just installed Win 10 1809 on my Dell PC, and it seems to run okay. But the first thing I did was start up VS Code. I wanted to run yarn start for my React project, but I had to type it way down in the terminal window, while the prompt was at the top. It worked though.
And when I open any project file, there seems to be approximately 100 blank lines appended at the end of each. But the line numbers don't go down that far and the cursor stops at the last line number. But the scroll bar acts as if those blank lines are there.
So I'm guessing the same number of blank lines are being added to the terminal too. But in the terminal window, the cursor is positioned at the bottom of the scrollable window.
What's going on? Is there a fix?
EDITED:
I see that I can scroll the file's window up until the cursor and last line is at the top, but no further, regardless of the window size. Maybe this has always be the case, and I never noticed. But now because of my terminal problem, I am suspicious of everything and checking for any abnormalities. So I don't think that extra blank lines are being added to my files. Sorry for the mistake.
But the terminal problem persists. The screen clip below shows the terminal display after I enter "yarn start". The typed input shows up way down from the initial prompt, and the blank area is a long string of "0D0A" characters. Sometimes I can click on "kill Terminal" and then start a new one and the new one works correctly. But not always.
Still trying to figure this out.
Can you share snapshots for your problems?
This is some hint for your problem
In VS Code, type
Linux / Windows: Ctrl + Shift + P
MacOS: Cmd + Shift + P
Type Settings to go Settings
At settings, search end of file, at here you can configure something for your problem with auto append blank lines each file
I hope it will help you :)
Your Terminal Problem is described as Bug in VS Code Issues.
As of July 2019 the intergration is pending due to stability problems.
https://github.com/Microsoft/vscode/issues/57803
Addendum (August 2019):
The Problem seams to be fixed with VS Code 1.37.1 and Windows 10 Patchlevel 1903
Did you try uninstalling and reinstalling?
Going back to your questions.
What's going on? No idea.
Fix. Use this extension https://marketplace.visualstudio.com/items?itemName=rintoj.blank-line-organizer
or
Open Visual Studio project and collapse all the folder and make it handy.
Now press “ Control + Shift + H “ key combination and you can see the Popup which shows Find and Replace options.
In the Find place input “^&\n” combination and select Use Regular Expression checkbox without fail as this input will mainly work with the regular expressions only.
In the replace field leave it empty so nothing will be replaced rather remove the empty blank lines.
In the input Find field we have give ^ for Start of the line and $ for end of line and \n which is for new line break.
source for second solution: http://www.f5debug.net/post/2015/01/03/How-to-remove-Blank-lines-between-codes-in-Visual-Studio-Code-editor.aspx
The extension will be useful overall especially when working in a team project where a lot of people might be leaving too many empty lines. Good luck

Syntax color very slow to appear with xcode 6.3.1

Since few days (since the last version of xcode?), I noticed that the syntax color takes sometimes a while to appear and sometimes doesn't even appear, then I need to "reload" the file by clicking on another file and going back to the current one.
I tried to solve it by deleting the derived data but it didn't solve my problem. It is quite annoying as it seems I cannot click on a method (and go to its definition) if the syntax color is not ready.
Any idea?
So briefly, my problem was about some lines of code that had a hard time to compile and was taking the whole compilation process ages. It was linked to my problem probably because Xcode quickly compiles the file you're working on before enabling any inner link/color for the code.
So if your compilation takes a while here is how you can quickly find out what's the problem (if it is related to some of your lines of code)
So I found some help on some website to find out what it was but I can't give you the links as I don't remember them. So here is how I proceed.
First when you compile, go on the Report Navigator on your left and select the Build being built. Then in your main tab, try to look for the file that takes a while to compile (it is the one that should stay with the arrow longer than the other ones). Once you found it, select the line of the file and on the very right side, there is a button that will expand a tab showing the command to compile your file with Terminal.
Copy the part starting with /Applications/Xcode.app/Contents/Developer/Toolchains to the end (name_of_your_file.o) and paste it in the Terminal.
If you execute it, it should take more than just 3-4 seconds.
Then when you execute it, you have to press Ctrl(^) + \, you will send a quit signal and it will cause the process to terminate and dump core, showing you the line and the code it was compiling so most probably the part that was taking a long time.
In my case, one of the problematic lines was
maximumValue = CGFloat(abs(high + (15/100) * (high - low)))
I replace it by
let maximumValue = abs(high + (15/100) * (high - low))
maximumValue = CGFloat(maximumValue)
and it solved my problem. Why this piece of code was causing problem is another question...
I found that is also was a line that seemed too complex to process. I found that if I typed "let bob = UII" at the very top of the class, the syntax highlight worked fast, whereas at the bottom of the file, it was crazy slow. The simplest way I found was to simply try the "let bob = UII" at half way, and then basically halve and halve again. My problem turned out to be calculating a variable with multiple calculation and additions. Broke it up over 4 lines and everything is fine again.

Sublime Text autocomplete suggestions looks corrupt, how to fix?

Not sure what is happening to my installation of Sublime Text, when ever autocomplete drop down appears it is populated with a bunch of corrupted looking suggestions, this just started recently. I have Googled around and have not yet seen another person with the same issue. I've already tried uninstalling, throwing out User/me/Library/Application Support/Sublime Text 3 folder, and re-installing, but still the corrupted text shows up in my autocomplete. I am working on a Macbook Air, I also use a Macbook Pro at work with the same setup and have never seen this happen before?
As established in the comments, you have base64-encoded strings (likely an inline image) elsewhere in your file. Sublime's default autocomplete populates its choices menu with elements from your file, and uses fuzzy matching to bring up selections. Since base64 can contain all letters and numbers, chances are that any sequence you're typing may match, and that string will be brought to the top of the autocomplete dropdown.
There are a couple of ways around this. First, if the base64 content is actually scoped as a string (i.e., it's surrounded by single or double quotes), you can add the following line to your settings (Preferences -> Settings-User):
"auto_complete_selector": "source - comment - string, meta.tag - punctuation.definition.tag.begin"
This should hopefully solve your problem for the time being, with the downside that you lose any other string-encoded information that you may wish to be in autocomplete.
You can also try using an autocomplete engine like SublimeCodeIntel (works for multiple languages, including JS) or TernJS. These can have the option of turning off Sublime's internal autocomplete mechanism, and just filling in the choices with their generated content.

Xcode 4 code editor questions

How can I turn on curly brace matching?
This worked fine in Xcode 3.x. In Xcode 4 is doesn't work. I've already checked the box for "Automatically insert closing '}'" in the Preferences->Text Editing->Editing panel.
How can I turn on parenthesis matching?
How can I turn on code compeletion for "if/else-if", "for" etc?
In Xcode 3.x I would start to type "for" and autocomplete would provide the parenthesis, curly braces, semi-colons etc. I could then press escape for a menu containing (amongst other things) the option to do a "for i" loop (in which case Xcode would fill in "int i; i < n; i++" with n selected so I could just type a value).
In Xcode 3.x I could do something similar for if/else-if blocks. I could just start to type "if" and autocomplete would provide parenthesis, curly braces etc.
Edit: after looking for the "get info" option for a source code file (was simply right click the file name in Xcode 3) for five minutes I decided to downgrade to version 3.2.x. Which means hours of downloading. This really stinks :-(
Auto-} works a little differently in Xcode4. It doesn't appear as soon as you type the {. You have to hit return after to get the closing brace. So typing { gives the autocomplete. It feels a little odd at first, it took me awhile to adjust, but I think it makes sense. Most coding styles dictate a return after the opening brace, so it pretty much will always auto-close when you want it to. It doesn't give the } though in a case like making a single line if into a multi-line one. You can now add in the opening brace, move the curser to after the line, and enter the closing brace. Before when I did something like that I'd have to spend time deleting the auto-}.
For code completion, it sounds like you're having an indexing issue. Code completion still works as you want (it's actually a lot smarter now) in Xcode4. Your syntax coloring is also usually off when this happens. I ran into it with one of my projects and fixed it by editing my build settings, I had a bad one in it. You might also try deleting the project's derived data in the organizer. That'll force a rebuild of the index.
The "get info" items have moved. It's one of the land mines of the IDE rewrite. They're not in the file inspector. Show the utilities pane and then select the file inspector (the first icon in the tab bar).
Xcode 4 is a bit alien when coming from Xcode 3. They changed a lot of stuff. I'd recommend getting a feel for it. At some time in the near future Xcode 3 will be deprecated and you won't get the new SDks for it. You can have Xcode 3 and 4 both installed at once which is helpful for making the switch. That way you can fall back to Xcode 3 when you get stuck on something and will allow you to gradually make the change.

Resources