skip to Main Content

how can I align statements as follows:

const val KEY_UPLOAD_NATIONAL_CARD_1 = "national_card_page_1_img_url"
const val KEY_UPLOAD_NATIONAL_CARD_2 = "national_card_page_2_img_url"
const val KEY_UPLOAD_PROFILE_PIC     = "profile_pic_url"

instead of:

const val KEY_UPLOAD_NATIONAL_CARD_1 = "national_card_page_1_img_url"
const val KEY_UPLOAD_NATIONAL_CARD_2 = "national_card_page_2_img_url"
const val KEY_UPLOAD_PROFILE_PIC = "profile_pic_url"

2

Answers


  1. Reformat Code… (Ctrl+Alt+L / Cmd+Alt+L) It works not only for Kotlin Android Studio but also for any language supported by the IDE.

    Login or Signup to reply.
  2. Simple answer: You can’t.

    Aside from the "Reformat Code" shortcut that @Muhammad Ammar already answered, there are no options to align special lines of code to a special char or a special line column.

    How would the IDE know which lines to include? How would the IDE know which character or line to choose that it should align to? Of course, it could be implemented somehow, but this is such a specific feature that I doubt it will ever come.

    Maybe you are lucky and there exists a plugin or you could roll up your sleeves and implement such a plugin yourself.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search