Sublime Forum

ST2 Misleading language detection (Undo formatting glitch)

#1

Let’s say if you had some code like this:

if (foo) {
	if (bar) {
		return 1;
	} else {
		return 2;
	}
} else {
	return 3;
}

When you undo it automatically turns into this:

if (foo) {}
  if (bar) {}
  return 1;
   else {}
  return 2;
  
 else {}
  return 3;

It even flashed each time with its original formatting when I undo, but it still automatically converts it into another kind of formatting.
I couldn’t even redo to turn it back because it just didn’t do anything. I just had to copy the broken code into a new tab and fixing it and try to remember what I’ve undone.

0 Likes

#2

I found out that it’s actually just PICO-8 package’s default settings which has been activated for some reason.
Could it be when switching to different tabs?

{
	"color_scheme": "Packages/PICO-8/PICO-8.tmTheme",
	"tab_size": 1,
	"translate_tabs_to_spaces": true,
	"detect_indentation": false,
	"font_face": "PICO-8",
	"font_options": [ "no_antialias" ],
	"line_padding_bottom": 1,
	"line_padding_top": 1,
	"highlight_line": true,
	"pico-8_path": "undefined"
}

If I could avoid this to happen again what should I do?
I do kind of want to delete this off-topic.

0 Likes