cking
V2EX  ›  Java

IDEA 关于折叠换行的问题(强迫症!)

  •  
  •   cking · May 11, 2019 · 4383 views
    This topic created in 2750 days ago, the information mentioned may be changed or developed.

    这是我同事格式化后的代码,可明显的看见括号里面的参数存在换行的现象 IDEA 图 1

    然后我想要的格式是这样的 IDEA 图 1

    大致意识就是将已经换行的代码重新换为一行,因为这个看起来是在是很不舒服...

    然后我经过大量的搜索后发现了 Ctrl+Shift+J 这个快捷键,但是这种方式只能选择某一行进行, 我需要的效果是在 Ctrl+alt+L 格式化代码的时候随便将这个快捷键进行.这样的话就可以得到非常美观简洁的代码了

    6 replies  •  2019-05-27 21:37:30 +08:00
    theliang
    theliang
    May 11, 2019
    1
    这个我倒是配置过,不知道回复楼层怎么发图片?
    theliang
    theliang
    May 11, 2019❤️2
    3


    这两条都配置下
    registerrr
    registerrr
    May 11, 2019
    4
    应该是行长超过宽度界线了,然后自动换行了.试试把宽度界线设置长一点.
    不过一行代码两屏才能显示完你难道也不换行吗?把界限设置到一个适合你的长度试试.
    hhhsuan
    hhhsuan
    May 12, 2019 via Android
    5
    楼主的意思应该是把已经换行的代码全部 undo 成一行 ,据我所知,好像 idea 没有这样的功能。
    cking
    cking
    OP
    May 27, 2019
    6
    @hhhsuan 对的 就是你这个意思
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2077 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 11:55 · PVG 19:55 · LAX 03:55 · JFK 06:55
    ♥ Do have faith in what you're doing.