Sublime Forum

(SOLVED) Indents broken? Deleting spaces sometimes other times deleting indents

#1

Indents not working as I believe they should be. All settings are default.

I want sublime to always delete indents never spaces if that makes any sense.

0 Likes

#2

Are you mixing spaces and tabs as indentation? What’s the indentation settings that ST’s using (shown in the bottom-right corner)?

By the way, without "draw_white_space": "all",, it’s hard to see what you are deleting/inserting…

0 Likes

#3

Thanks for the reply! I turned on "draw_white_space": "all", thanks for that I think that alone helps a bit. My tab size is set to the default I believe of 4. So it seems when I hit tab sometimes it is just inserting spaces for some reason. Pasted my user settings below, maybe one of these is causing this that I’m just not aware of?

{
“draw_white_space”: “all”,
“always_show_minimap_viewport”: false,
“auto_find_in_selection”: true,
“bold_folder_labels”: false,
“caret_style”: “wide”,
“close_windows_when_empty”: false,
“color_scheme”: “Packages/Material Theme/schemes/Material-Theme-Palenight.tmTheme”,
“copy_with_empty_selection”: false,
“create_window_at_startup”: false,
“detect_indentation”: true,
“dictionary”: “Packages/Language - English/en_GB.dic”,
“drag_text”: false,
“file_exclude_patterns”:
[
“.DS_Store”
],
“folder_exclude_patterns”:
[
“.bundle”,
“.git”,
“.hg”,
“.sass-cache”,
“.svn”,
“bin”,
“CVS”,
“tmp”
],
“font_face”: “Monaco”,
“font_options”:
[
“subpixel_antialias”
],
“font_size”: 10,
“highlight_line”: true,
“highlight_modified_tabs”: true,
“ignored_packages”:
[
“Vintage”
],
“indent_guide_options”:
[
“draw_normal”,
“draw_active”
],
“line_padding_bottom”: 3,
“line_padding_top”: 3,
“match_brackets_angle”: true,
“material_theme_accent_orange”: true,
“material_theme_compact_sidebar”: true,
“material_theme_panel_separator”: true,
“material_theme_small_tab”: true,
“overlay_scroll_bars”: “enabled”,
“save_on_focus_lost”: true,
“theme”: “Material-Theme-Palenight.sublime-theme”,
“trim_trailing_white_space_on_save”: true,
“word_wrap”: true
}

0 Likes

#4

Perhaps you have a package hooking the backspace key and that eats ST’s default method of removing an indent level.

Run sublime.log_commands(True) in the console, perform the actions again and check which command gets run.

0 Likes

#5

Results from console.

Is it weird for my indents to be like that though or is this a common thing?
I’m trying to switch from VS Code to Sublime, never ran into anything like this before.

sublime.log_commands(True)
command: drag_select {“event”: {“button”: 1, “x”: 584.343017578, “y”: 338.346923828}}
command: drag_select {“event”: {“button”: 1, “x”: 302.97265625, “y”: 320.275787354}}
command: move {“by”: “characters”, “forward”: false}
command: move {“by”: “characters”, “forward”: true}
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: insert_best_completion {“default”: “\t”, “exact”: false}
command: drag_select {“event”: {“button”: 1, “x”: 432.464355469, “y”: 285.282012939}}
command: reindent
command: insert_best_completion {“default”: “\t”, “exact”: false}
command: insert_best_completion {“default”: “\t”, “exact”: false}
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: reindent
command: insert_best_completion {“default”: “\t”, “exact”: false}
command: left_delete
command: insert_best_completion {“default”: “\t”, “exact”: false}
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: reindent
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: reindent
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: reindent
command: insert_best_completion {“default”: “\t”, “exact”: false}
command: left_delete
command: left_delete
command: left_delete
command: left_delete
command: left_delete

0 Likes

#6

Seems I’ve fixed the issue by setting indent to use spaces. Seems like that wouldn’t be the way to go about it but I think this will do. Thanks for the help guys!

0 Likes