I'm using NetBeans IDE 8.2 as my C-code editor. Any text inside C-comments between '<' and '>' characters is highlighted (see image below). Does anyone know why?
There is no highlighting in my C-code; it only happens in the comment sections.
NetBeans highlights text between <> symbols because it interprets it as a doxygen formatting. See doxygen tag info.
For example:
Related
I am working on an application that supports the ability to launch an external editor on XML validation errors, where the validation error will include the specific line and character offset in the line the error occurs. For example, "74:62" represents the 74th line and 62nd character of that line, which is also said as, "line 74, column 62".
The problem I am having is that editors treat "column" differently. For Vim, column 62 is a character position. While in Oxygen XML Editor, Notepad++, and Emacs, column is a rendered position.
Why does this distinction matter? If the target line has tab characters, Notepad++ and Emacs "column" no longer represents character offset, and for those editors the cursor gets located differently: Notepad++ treats tab as 4 columns and Emacs as 8 (by default).
Here are the commands I use for each editor, where 'L' is the line number, 'C' is the column number, and 'FILE' is the file to open:
gvim "+call cursor(L,C)" FILE
oxygen FILE#line=L;column=C
notepad++ -nL -cC -lxml FILE
emacs +L:C FILE (See #Rorschach's answer below for method that does work)
For Notepad++ and Emacs, are there command-line invocations that will place the cursor at a character position relative to the line?
Edit
Oxygen XML Editor behaves as expected, where column parameter is interepreted as a character offset from line. See #Rorschach's answer below regarding Emacs, I do not have a solution for Notepad++.
As a workaround for different character display widths in emacs you could add a hook to run after the file loads.
# assuming there are some variables (eg. shell)
# holding the line/column as in the normal command
L=4
C=2
emacs --eval "(add-hook 'emacs-startup-hook (lambda () (goto-line $L) (forward-char $C)))" input_file.xml
I work for Oxygen XML Editor and as far as I know Oxygen places the caret at that specific character offset, so we do not use the visual tab width representation for anything in this context.
One thing you should be aware is that in Oxygen by default if you press the "Tab" key you actually insert 4 spaces, if you want to insert the "Tab" character instead, in the Preferences->"Editor / Format" page there is a setting named "Indent with tabs" which needs to be checked.
For whatever reason, VSCode is copying non-breaking spaces, when I copy/paste code with syntax highlighting. This is no problem as long as I work inside VSCode, but it's a nightmare when copy/pasting stuff in and out of VSCode.
I'm using MSWord with the "hidden characters" feature activated as an easy means to understand what is happening. I can reproduce it like this:
Create a new file (no extension, not saved) in VSCode, type some text, select
all and copy/paste in MSWord -> spaces are normal U+0020 spaces,
NO syntax highlighting was copied.
Save the file as a ".txt" file, select all and copy/paste in MSWord -> spaces are normal U+0020 spaces, NO syntax highlighting was copied.
Save as a python file ".py" (or Markdown, or HTML...), select all and copy/paste in MSWord -> spaces are non-breaking-spaces U+00A0 spaces, syntax highlighting was copied.
Save as a text file ".txt", select all and copy/paste in MSWord -> spaces are non-breaking-spaces U+00A0 spaces, syntax highlighting was copied.
Since a picture is better than 1000 words, here's the output from MSWord:
Any idea?
It seems that VSCode copy styled or unstyled content into the clipboard depending on the context. That may cause trouble when pasting into some kind of rich text editor.
In the settings JSON file add editor.copyWithSyntaxHighlighting set to false in order to disable this behaviour for good.
Note that there is still a separate command Copy With Syntax Highlighting in the pallete which you can bind to some other keys in case you need it. This one does not affected by the option above.
Refer to this PR https://github.com/microsoft/vscode/pull/54155
I just installed the latest Eclipse Neon, and latest PyDev on that. When opening a python file using the "Python Editor" provided, all lowercase "L"s are automatically displayed as uppercase whenever enclosed in quotes.
Opening the same file in another editor shows all L's as lowercase, so the issue in the Python Editor is purely visual, but it's certainly odd. I've tried turning off code completion and code analysis and it didn't help.
Has anyone else seen this weirdness and found a reason / fix?
Based on the screenshot, I'd say the issue isn't on the editor, but on the font you're using (the main difference from one case to the other is that by default, PyDev strings are italic and for some reason the font you've chosen shows lowercase l very close to L when italic -- although I think that the actual uppercase L is probably different from the lowercase l when italic too).
As for a solution, you can either not show the font as italic (in Preferences > PyDev > Editor > uncheck 'Italic' for Unicode and Bytes) or change the font you're using (in Preferences > General > Appearance > Colors and Fonts > Text Fond and Text Editor Block Selection Font).
It adds a character to each line on moving to next line.
Nothing is wrong. That's a visual display of the newline character.
To turn if off use "View -> Show Non-printable Characters"
I'm using Eclipse on Mac OSX and I randomly get character \160 (whatever that is) instead of a whitespace in my code.
From time to time when I compile I get this error:
java:74: illegal character: \160
if (c == '*' ||?c == '/')
when my code in Eclipse actually looks like:
if (c == '*' || c == '/')
This is annoying and usually resolved by deleting the supposed invisible ? and pressing spacebar once again in the editor.
I'm curious as to why this happens if anybody has an idea.
as #Hanynowsky mention it is related to a different encoding between the source you copied and the one from your file. I have not found any way to automatically removed the bogus mismatching characters, but you can actually see them in eclipse if you enable the editor to show whitespaces.
For doing that:
set Eclipse to "show whitespace characters" (option under Preferences -> General -> Editors -> Text Editors)
the bogus \160 character will appear as " ." even if your other spaces will appear as ".". So you just need to delete the " ." occurrences and you are good!
When you copy / paste a code from a website page into your IDE editor, you might get this error as the copied code has invisible unknown characters, usually white spaces.
Unfortunately I do not know of any solution bar to remove and re-ident every white spaces between your code's identifiers.