Sublime Text 3: Error trying to parse settings, colons highlighted - sublimetext3

(English is not my native language so there might be mistakes here:)
I was trying to change the visual style of Sublime Text 3, I installed the "https://github.com/kkga/spacegray" but were stopped by an error. This was not the first time and have got this message before:
Error trying to parse settings: Unexpected character, expected a comma or closing bracket in Packages\User\Preferences.sublime-settings:19:1
As you can see it highlights the colon but can't fix it either way, every setting above the style are not in use now because it only accepts (and activates the style) if I cut out everything else like this:
I tried changing characters and finding answers for this problem but have been unsuccessful until now. My settings

The problem is that you are missing a comma there in line 18, it should be:
"word wrap": false,
That's why you get the parsing error, after each option there must be either a comma, indicating that there are more config parameters remaining, or a closing bracket }.
When adding new settings, make sure that all of them are separated by commas.

Related

How to detect multiline strings in VS Code Extension

I had been trying to match multiline string and character literals in VS Code, but there is no support for highlighting across more than one line using a regex. This is a known issue. At the bottom of the issue, it is told to use a semantic highlight provider.
VS Code's Semantic highlight guide gives a set number of tokens to semantically highlight. My main problem is that multiline strings are not detected as tokens in the first place, so they cannot be modified to change to the right color.
I am trying to match a BQN string: A BQN string is a double quote, followed by any number of non-quote characters including newlines, followed by another double quote. Double quotes inside a string are escaped by typing two quotes: "qu""ote" translates to qu"ote.
I'd like to know if there is a way to syntax highlight multiline strings via this method or any other method available to a VS Code extension. Help and examples are highly appreciated.

Indentation error, nothing done wrong [LP3THW, 35]

After slightly altering an exercise from LP3THW, I started to receive an indentation error when running the script for a second time in Powershell: "TabError: inconsistent use of tabs and spaces in indentation".
I set the editor to show the indents and it does show some space mixed up with tabs, even though I consistently use tabs only when I type. I tried indenting those specific lines several times and it doesn't work (they end up showing as dots, as for space, instead of arrows, as for tab).
Am I doing something wrong...?
(I'm using Python 3.8 in Windows 10)
(lines 9 to 15)
EDIT: I consulted the answer in
Convert tabs to spaces in Notepad++
in order to change the settings for Tab.
Don't know what originated the error in the first place, but the script works now

How to remove blank line in Sakura editor?

I need to prepare test data having around 10K lines with many blank lines, same has to be removed. Earlier I was using editplus (Text editor) and could able to solve very easily by using Find (Find text: "\n\n" Regular expression) and Replace (empty) option.
Here in this project I am using Sakura editor and tried the below option to remove blank lines but its not working.
Need to remove line 6 and 7.
Find text
\n\n
\r\n\r\n
[\r\n]+[\r\n]
More information about using of regular expression in sakura editor
Click here
PS: I have some restriction in my current project to download and install any other software/tools.
Any help is appreciated.
Finally found solution. Like to share with others.
In sakura editor, we can remove the empty lines by using find and replace option.
Find ^\r\n 【Option:Regular expression】 and replace
Explanation
^ Beginning of the line
\r carriage-return character
\n newline (line feed) character

"Unexpected trailing character" in sublime when trying to edit preferences

I'm trying to change my sublime theme/colour scheme and i get
'unexpected trailing characters'
When I try to save the /User/Preferences.sublime-settings with this config
{
"theme": "Afterglow-green.sublime-theme",
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme"
}
{
"tabs_small": true
}
I can't work out why I would be getting that message?
Your settings files in Sublime (all of them) need to be valid JSON. Yours should be as follows:
{
"theme": "Afterglow-green.sublime-theme",
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
"tabs_small": true
}
Note that everything is enclosed in one (and only one) outer dictionary, denoted by curly braces {}. There should also be a comma , at the end of every key: value pair, except for the last line. If there is only one line, don't use a comma.
Just out of interest, what is the "tabs_small" setting for? It's not one of Sublime's default settings.
The selected answer is correct, however this prompt can also occur during application startup.
If this error occurs when you're starting Sublime, navigate to C:/Users/{Your User}/AppData/Roaming/Sublime Text 3/Packages/User and open Plain text.sublime-settings.
The issue with JSON can be resolved here.

How to search for invisible control characters

I know there are some threads about this on stackoverflow but when i write ":set list" in the editor, it seems to display hidden characters but it doesnt display the hidden characters in the code we are having problems with.
Some times now we have had some invisible symbols in our code making if loops break, i dont know how the symbols get there except from that some wierd keyboard combination much have been accidentally typed in. The code itself looks correct but the invisible symbol breaks it.
I have searched online about this but all i can find seems to be the ":set list" command in vim in addition to have to change the color of the hidden characters, but while this seems to display some hidden characters it doesnt display the problematic ones. We are getting two symbols which looks like a cross and one looks like a pistol. We have also tried to add the "draw_white_space" setting in sublime text but this only seems to display, well, whitspace like it says but the result was shown on google for showing hiden characters so i gave it a try.
The only way we have been able to see where the symbols are is with the DiffMerge tool, we have not been able to see these symbols in any other editor but we have actually been able to copy the sign to its own file and grep through all the files with the -f grep option which works, but it would be easier to display the characters in vim but using a keybinding.
Does someone have any suggestions? This is causing us to use a lot more time debugging the code when the problems is an invisible symbol.
Try the following search command:
/[^ -~<09>]
(you get the <09> by pressing the tab key). Or if you want to get rid of those nasty tabs, just:
/[^ -~]
That will find and highlight any non-ASCII or control-ASCII character.
If you still have hidden characters out there, you can try this command before the search:
:set enc=latin1
That will prevent any weird Unicode character to show up in your code.

Resources