PyCharm 智能缩进不起作用?
也许我误解了什么是智能缩进。当我输入:
urlpatterns = patterns('some_model.views',
按 Enter 后,下一行不会是人们期望的“智能缩进”的地方吗?就像现在一样,插入符号完全没有任何缩进。
Perhaps I misunderstand what smart indent is. When I type:
urlpatterns = patterns('some_model.views',
after pressing enter, would the next line not be a place one would expect a "smart indent"? As it is now, the caret is placed without any indentation at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您提供右括号时,智能缩进就会发生,也就是说
,如果您通常使用 autocomplete ,您应该自动获得带有两个括号的
patterns()
。插入符号将位于括号内,因此当您按enter
时,默认情况下会为您提供“智能缩进”。请注意,当您在 python 中使用字典或列表时也会出现这种情况。除非您的字典/列表也分别有结束
}
或]
,否则自动缩进将不会激活。The smart indent happens when you've provided the closing parenthesis, i.e.
That being said, if you're using autocomplete normally you should get
patterns()
with the both parenthesis automatically. The caret will be inside the parenthesis thus giving you the "smart indent" by default when you pressenter
.Note that this is also the case when you work with dictionaries or lists in python. The auto-indent will not activate unless you also have the closing
}
or]
for your dictionary/list respectively.我想答案一定是智能缩进此时不一致。
I suppose the answer would have to be that the smart indent is inconsistent at this point.