【问题标题】:pgAdmin 4 v3 Auto Indent not workingpgAdmin 4 v3 自动缩进不起作用
【发布时间】:2018-07-31 11:40:18
【问题描述】:
自从升级到 4.3 后,自动缩进不再工作(在查询工具选项卡中工作)。在一行代码的末尾按 enter 时,光标会出现在下一行的随机位置(有时正好在末尾),而不是正确的缩进位置。这非常令人沮丧,因为我必须在行首单击并自己正确缩进每一行。
我尝试过 Chrome 和 Edge,没有任何区别。我已经更改了选项卡大小和使用空格选项,但没有任何运气。我使用的是 Windows 10 专业版。
还有其他人有这个问题吗?
【问题讨论】:
标签:
windows
auto-indent
pgadmin-4
【解决方案1】:
更新!!!
此问题已在 pgAdmin 4 版本 4.3 中修复!
感谢 pgAdmin 团队!
注意:这仍然是 pgAdmin 4 版本 4.2 之前的问题
更新日期:2109 年 2 月 19 日
:(
/*
问题:
(Tested on Windows Server 2012 R2, Chrome and Firefox, pgAdmin 4 3.2)
Using nested functions in a variable assignment, or just in a SQL statement
causes multiple tabs to be added when hitting enter for a new line anywhere
later in your code.
If you uncomment the first line with nested functions (below), all
carriage returns lower in the code create new lines with
many unwanted tabs.
Uncomment the line below and hit enter at the end of the line,
or before another line of code.
*/
/*
x := upper(substr('取消注释以进行测试。在分号后按回车键。', 13));
*/
/*
我的解决方法是取消嵌套函数并使用多个语句。
注意:确保上面的违规行已被注释掉。
*/
x := substr('取消注释以进行测试。在分号后按回车键。', 13);
x := 上(x);
【解决方案2】:
已尝试您的建议,它确实有效。但是,我们必须注释掉整个有问题的行(即使用嵌套文本)才能使其工作,这似乎很奇怪。我和其他编辑没有这个问题。例如,在 SQL Developer 中输入相同的文本如下:
SELECT *
FROM employees
WHERE deptno IN (SELECT deptno FROM departments
WHERE loc = 'CHICAGO');
按回车键会将光标放在第二个 WHERE 下(与 Postgres 相同)。我用 Shift+Tab 将选项卡清除到第 1 列,然后我很好。每个新行,光标都在开头。这不适用于 Postgres。
我对这方面的很多东西还是陌生的。谢谢分享。