崇高的文本新行失去缩进

sublime text new line loses indent

本文关键字:失去 缩进 新行 文本      更新时间:2023-11-02

我遇到了一个问题,导致我在精彩的文本中有很多额外的按键。当我创建几行新行时,缩进是正确的。然而,如果我向上箭头返回到这些新行,缩进就消失了,我回到了位置0(所有文件格式都会发生这种情况)。我做错了吗?这是故意的行为吗?我喜欢代码中的空白,所以这很痛苦。

重新创建:编写功能代码,例如

    function Bob(){
        | indent starts here
    }

一切都很好。然后我添加了几行新行,向上箭头回到中间,我得到了这个:

    function Bob(){
| indent starts here
| indent starts here
        | indent starts here
    }

我想要:

    function Bob(){
        | indent starts here
        | indent starts here
        | indent starts here
    }

除了改变我的编码风格之外,还有什么建议吗谢谢

编辑:显然这不是预期的行为。下面列出的首选项和插件,以防它们干扰。

用户偏好:

{
"auto_complete": true,
"auto_complete_with_fields": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"detect_indentation": true,
"draw_minimap_border": true,
"fade_fold_buttons": true,
"folder_exclude_patterns":
[
    ".svn",
    ".git",
    ".hg",
    "CVS",
    "tmp",
    ".tmp",
    ".bundle",
    ".sass-cache"
],
"highlight_modified_tabs": true,
"ignored_packages":
[
    "Vintage"
],
"line_padding_bottom": 1,
"line_padding_top": 1,
"soda_classic_tabs": true,
"tab_size": 4,
"theme": "Soda Light.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"word_wrap": true,
"wrap_width": 200
}

插件:

  • 埃米特
  • GitGutter
  • 程序包控制
  • PyV8
  • 萨斯
  • SFTP
  • 边栏增强功能
  • 主题-苏打水

将以下内容添加到您的首选项中,您应该已经设置好了:

"trim_automatic_white_space": false,

默认值为true,当设置时,它会修剪在将插入符号移出行时由auto_indent添加的空白。