【IDE】Idea 设置注释与代码对齐

为什么设置

通过快捷键ctrl + /ctrl + shift + /生成的注释左侧没有缩进(如下图),不与代码对齐

设置位置

在'Settings' > 'Editor' > 'Code Style' 中

  • 'Java' > 'Code Generation' 下,Comment Code 区域中取消选中Line comment at fi rst columnBlock comment at fi rst column
  • 'Java' > 'Wrapping and Braces'下,Keep when reformatting 中取消选中 Multiple expressions in one line
posted @ 2023-03-30 20:01  HypoPine  阅读(1614)  评论(0编辑  收藏  举报