Line warp / soft wrap

Hello,
I love phpStorm.
But the wrapping seems very complicated for me when editing php-files.
Isn´t there any possibility for a "normal" line-wrap,
that means, that after reaching e.g. 120 characters, after the end of a word the next line is choosen AND doing an "intelligent" intend for e.g. 4 characters and so on.
When I use soft wrapping and so on, a lot of adventurous stuff is happening, but all I want is a sinple "next line and intend.".

Do I miss something?

Thanks a lot, Adrian.

8 comments

Type "right margin" in Settings search -> Code Style|General|Wrap when typing reaches right margin will be 1st hit

0

Yes, I know, but I would like the next line to be intended beginning at the same position or more to the right than the first line, like:

1.      sdfhksjhf sdhfkahf sdkhfka shfakh safhl
               fhsakjhfkshfkhafkhfk shfakl sahfkhsaf hsaklfjh
               hfsdkjahf jkshdfajkh jksahf kjsafhklh

Now it is:
1.          sdfjhadk ksjhfkaj kjsdafh skadfhl
ksjahfkj sakhf shfalk

Is there a possibility for that?

Thank you!

0

Hi Adrian,

Can you provide more detais on what type of data you're working with? Basically, 'Wrap when typing reaches right margin' emulates pressing <enter> when line is too long. So, that behavior is affected by the language of the target document, code style settings, 'smart indent' setting etc.

Denis

0

Hi Denis,
the thing is, sometimes it works, sometimes it doesnt.
I am working on php files, e.g.:

switch ($athlete_friendstatus) {
    case 0:
        $myagRegister->get__register_link_send_friendinvitation($brd_pages, $register_top,
$register_top_link, $register_top_status, false);
        break;
    case 1:

As you see, when I use soft-wrap, the line wraps after '$rgister_top,' to a new line, but the next line, starting with '$register_top_link' does not intend. I would like it to be intendet starting for example under the $myagRegister of the first line, or maybe under 'agRegister'.

The second question is:
Is it possible to activate "soft-wrap" in the menu as a default. I always have to activate it again when I open new or reopen existing documents.

Thank you, phpStorm is great!

Adrian.

0
  1. 'Use soft wraps in the editor' - check it on to have soft wraps turned on by default;
  2. 'Use custom soft wrap indent' - define it to any meaningful number of visual columns to use during the indentation (e.g. '2');


Hint: every time you're asking yourself whether there is an option for particular feature you can open settings dialog and just start typing keyword (e.g. 'soft' for 'soft wraps'). Menu list will be filtered and target settings will be highlighted.

Denis

0

Hi Denis,
hey, I havnt seen that options and now it is working perfectly.
Thank you very much and sorry for my "stupid" questions.

Sincerely, Adrian.

0

I consider that to be not your fault but ours, i.e. the setting's usage is not intuitive enough :)

Denis

0

I would have a sugsetion how it would be nice:

You have 3 options (Maybe a drop down menu):

'soft wrap', 'soft wrap: indentation +n column', soft wrap: indentation +n indent levels'

1 Soft wrap:
nothing to change

2 Soft Wrap: Indentation +n Column
same as current soft wrap and "use originial lines indent...."

3 Soft Wrap: indentation +n indent levels
same as "Soft Wrap: Indentation +n Column", but instead of a number of characters to indent more then the last line, you use the existing indenting style of the current language and multiply it by 1, 1.5, 2.

This third option, would have this behaviour:
example 1: language indent indent: 2 spaces -> soft wrap indent of 1.5 = 3 spaces
example 2: language indent 4 spaces -> soft wrap indent of 2 = 8 spaces
example 3: language indent tabs (8) -> softwrap indent of 1 = 8 space

The difference of this third method would be, the amount of indentation a wrapped line gets, would be depending on the amount of indentation a normal line gets.

Why?
When I edit a file with 2 spaces indenting it's a lot to indent wrapped lines by 12 spaces (this is my current setting). 3 spaces is not OK for files with tabs (8) or 4 spaces.

now:

my short line:
- my short line
- my very long line my very long line my very long line my very long line my
very long linemy very long line my very long line
- my short line
my other line:
- asdf

new:

my short line:
- my short line
- my very long line my very long line my very long line my very long line my
very long linemy very long line my very long line
- my short line
my other line:
- asdf
0

Please sign in to leave a comment.