I was creating java classes in netbeans, and I don't know what button I pressed to make points for placeholder followed by the paragraph markers (ΒΆ) appear in my code.
How can I proceed to make them disappear?
That's what it looks like at the moment
Try view > Show Non-Printable Characters
Go to 'View' and uncheck the Show Non-Printable Characters. That will clears off your problem
View -> Show Non-printable Characters
Related
Whenever I type into a text field and click on the special characters button & then try to edit past text by clicking in between some of the letters, it'll automatically highlight all of the text instead of showing the original single cursor sitting between 2 letters. This can be a bit annoying and confusing for the user experience. Is there any quick fix for this?
Note: I'm using a real device (Samsung Galaxy S8)
Here are 2 images to better explain this problem:
Trying to edit text before clicking on special characters button:
Trying to edit text after clicking on special characters button:
I downloaded some code from the Internet, and the four-space indentation is bugging the crap out of me. I tried to do a find and replace for "<4 spaces>" and replace it with "\t", but that just replaced all sets of spaces with the string "\t". How would I put a tab in the "replace" box?
Open Window->Preferences from menu bar.
Select Text Editors from tree menu.
Uncheck Insert spaces for tabs.
After that, run Format menu from context menu and save the file:
I figured it out. I just check the box that says "use regular expressions", then use \t.
In answer to the second half of your question:
The reason why people like spaces more than tabs is consistency. If you have your editor set to show tabs as 4 spaces wide, and I have my editor set to show tabs as 8 spaces wide, the code we're writing will look different to each of us. That's okay until our mutual coworker forgets that we're using tabs and starts spacing his lines using 4 spaces. Now his code looks fine to you, but all the indentation is off to me.
Also, what happens when our work decides that lines should be 80 characters long, or 120 characters long? You'll happily code with 4 space tabs, and when it gets to my editor, I suddenly see some of your lines as too long.
Generally, it doesn't matter whether you use spaces or tabs, as long as you (and every person who works on your code) agrees on which to use, and how wide a tab character is.
I use 4 spaces everywhere, because it looks the same on every editor, every repository, when cated, and everywhere else.
Kouhei response is in the right track, but you'll need to change the options of the Java formatter if you want the auto formatter to use spaces (in the preferences, look for Java -> Code Style -> Formatter, create a new style from one of the existing one, and choose "always use spaces"). Then, Ctrl + Shift + F will remove the tabs and insert spaces.
To resolve the issue of tab with space in the Eclipse editor:
Menu Window --> Preferences --> Java --> Code style --> Formatter
Click on configure project specific settings.
Choose the project
Check Enable project-specific settings
Click on New
Mention your profile name --> click OK.
The profile page will be popped up
Choose Space only under tab policy label of the indentation tab.
Click apply and the OK.
Use Ctrl + Shift + F to format a Java class which will replace tab with space.
Eclipse Helios for C++ developers
Instead of changing the default text editor, change the Code Style/Edit -> see pictures
I'm using Eclipse + EGit, and every time I make a commit, Egit detect tab chars as changed:
but I don't change anything on that part of the code. Tab chars are tab chars, and are not replaced by whitespaces.
Any idea ?
You may have some auto formatter active, which replaces tabs by blanks or the other way around. This may not really be visible in the editor on first glance, as the editor can display a tab character the same as the respective number of blanks. You may want to store the original file and the edited one separately outside Eclipse to compare them in another editor.
However, you can ignore whitespace changes in the compare view at least. I'm not sure of your version, for me that is a toolbar button in the main toolbar. You can press Ctrl-3 and enter "Ignore" to see, if that command is available for you.
I am using Adobe's ColdFusion Builder, an Eclipse-based IDE built on top of Aptana.
All of a sudden, I am getting a type of whitespace marker showing in my Eclipse Editor. I must have accidentally hit a key combination.
Here is a screen dump.
I have already tried "General > Editors > Text Editors > Show whitespace characters" and it is not this. I already have show whitespace characters turned off. If I turn it on, then the Whitespace Characters display over the top of what I am already seeing.
Can anyone tell me how this can be turned off? Most annoying.
Many Thanks
It's under Preferences -> General -> Editors -> Text Editors
Just uncheck 'Show Whitespace Characters':
Did you try Restarting Eclipse? If that didn't work, you might try this http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka11640.html which explains which file to delete to force eclipse to revert to use default settings.
I have done this several times by accidentally hitting some keystrokes.
If you go to Windows/Preferences/General/Keys you will see all the keyboard shortcuts you have.
Mine is set to Control + .
(that's a period by the way) I had to place my cursor inside the document and do it a couple of times to make it work because there is also a keyboard shortcut for Control +
On a Mac it is Cmd +.
Hope that helps.
When I search something in Eclipse, the search items stay highlighted for some time. How do I remove this after I have found what I was looking for?
Remove your matches in the search view, that will remove the highlighting. I.e., click the button with the two X's in the search view.
If you cannot see that view, navigate to window -> show view -> Search
AFIAK, the search result view has a toolbar button to clear the search results. This removes the highlighting in the editor.
An alternative way is to run a search that will yield no results. For example file search, containing text - leave this field empty, files - some stupid extension like ".qwe".
For people concerned that https://stackoverflow.com/a/3545215/6012102 removes search results from history.
Select the search from history, press "Run the current search again" (2 rotating arrows icon). This will run the search and you will get all the results back (this brings back the text highlight as well unfortunately).
Disable Preferences->General->Text Editors->Annotations->Search Results->Text as.
For a single instance, delete the line and undo it: Ctrl+DCtrl+Z. This is faster than the other answers, and worked when they failed (for some buggy JSP I had).