【问题标题】:why the lines of my html and css files got shuffled in sublime text editor?为什么我的 html 和 css 文件的行在 sublime 文本编辑器中被打乱了?
【发布时间】:2020-08-17 04:35:53
【问题描述】:

我正在使用 sublime 文本编辑器进行 Web 开发编码。最近,当我编辑代码时,所有文件行都像代码中的那样被打乱了。即使使用所有以前的 html 和 css 文件,我的所有文件都会发生这种情况。任何可以帮助我恢复正确顺序的人。我不想手动操作,因为文件太大,无法再次编辑。

                <div ><input type="password" name="password" placeholder="password" class="input"></div>
                <div ><input type="submit" name="login" value="Submit" class="input button"></div>
                <div ><input type="text" name="username" placeholder="username" class="input"></div>
            </form>
            <a href="register.html">Sign Up
            <form >
        </div>
        </div>
        <div class="container">
        <div class="heading"><h1>Login</h1></div>
        <div>Not a member?
    </div>
    <div class="login-form">
    <link rel="stylesheet" type="text/css" href="style.css">
    <title>Login</title>
<!DOCTYPE html>
</body>
</head>
</html>
<body>
<head>
<html>

【问题讨论】:

  • 您的代码是否使用了版本控制系统 (VCS),例如 Git?
  • 看起来您在文件内容上使用了sort 命令(菜单中的Edit &gt; Sort Lines,命令面板中的Sort Lines,它也绑定到一个键)。在任何情况下,除非您有备份(例如将您的代码保存在 @Pablo 提到的 VCS 中),否则您别无选择,只能手动修复文件,这可能非常棘手或不可能。

标签: html css sublimetext3


【解决方案1】:

只需Ctrl+Shift+P(或在 MacOS 上为Command+Shift+P)打开工具托盘,输入 reindent ,然后选择 Indentation: Reindent Lines 。

【讨论】:

  • 不,它没有解决我的问题代码仍然失真
  • @YousraFarooq 为您的代码编辑器获取扩展 marketplace.visualstudio.com/… 让我知道它是否适合您。
猜你喜欢
  • 2016-10-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-10-29
  • 1970-01-01
  • 2017-01-21
  • 1970-01-01
  • 2021-01-31
相关资源
最近更新 更多