Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Modification de l'indentation automatique du code

New Here ,
Jan 15, 2021 Jan 15, 2021

Bonjour tout le monde.

 

Comment puis-je modifier le format d'indentation automatique du code qu'on obtient en passant par "Edition - Code - Appliquer le format source" ?

Je voudrai avoir une tabulation pour chaque balise avec la bonne indentation, au lieu des 2 espaces.

 

Merci d'avance.

755
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Adobe Employee , Jan 15, 2021 Jan 15, 2021

Hi @philippeh76967859 ,

 

Thanks for writing to us. You can modify the preference of Tab/Spaces indentation by setting Tabs in Indent dropdown under Code Format section of Preferences dialog. You will have to click on Apply button after making the change and Close the Preferences dialog. Please see if setting this resolved the issue for you else we will further investigate the issue.

 

Code FormatCode Format

 

Have a pleasant day!

 

Regards,

Nayan

Dreamweaver Team

Translate
Community Expert , Jan 15, 2021 Jan 15, 2021

Hello @philippeh76967859,

Go to Preferences > Code Format.

Check the box to Indent and select Tab from the drop-down list.

Post back if you need more help.

 

Translate
Adobe Employee ,
Jan 15, 2021 Jan 15, 2021

Hi @philippeh76967859 ,

 

Thanks for writing to us. You can modify the preference of Tab/Spaces indentation by setting Tabs in Indent dropdown under Code Format section of Preferences dialog. You will have to click on Apply button after making the change and Close the Preferences dialog. Please see if setting this resolved the issue for you else we will further investigate the issue.

 

Code FormatCode Format

 

Have a pleasant day!

 

Regards,

Nayan

Dreamweaver Team

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2021 Jan 15, 2021

Hello @philippeh76967859,

Go to Preferences > Code Format.

Check the box to Indent and select Tab from the drop-down list.

Post back if you need more help.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2021 Jan 18, 2021

Tank you for your reponses.

 

Et comment garder le format des IF ?

J'ai l'habitude d'utiliser ce format :

if (condition)

{

}

else

{

}

 

Est-ce que c'est possible ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2021 Jan 18, 2021

En fait, je voudrai que " { " soit sur la ligne suivante.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 19, 2021 Jan 19, 2021

Hi @philippeh76967859 ,

 

We can try to have braces in the next line by setting the below entry for js section in .jsbeautifyrc file. Please find the steps in the below KB article for setting up the file.

 

https://helpx.adobe.com/dreamweaver/user-guide.html/dreamweaver/using/format-code.ug.html

 

Include the below statement in JS section and save the file. You will have to re-launch Dw for applying these changes on performing code format.

 

"brace_style": "expand"

 

Please see if the above resolves the issue else we will further look into the issue and try fixing the same on your machine.

 

Thanks,

Nayan

Dreamweaver Team

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 27, 2021 Jan 27, 2021

J'ai créé le fichier .jsbeautifyrc et je l'ai mis à la racine de mon site, mais ça ne change rien.

En JS, les " { " ne sont toujours pas à la ligne suivante.

Voila ce que j'ai :

    if ($('#L_Utilisateur').prop('selectedIndex') == 0) {
        G_REP_TEMP = G_REP_TEMP0 + "PHH/";
    } else {
        if ($('#L_Utilisateur').prop('selectedIndex') == 1) {
            G_REP_TEMP = G_REP_TEMP0 + "OB/";
        } else {
            alert("Impossible de récuipérer l'utilisateur." + "\r\n" + "Traitement impossible.");
        };
    };

et je voudrai avoir :

    if ($('#L_Utilisateur').prop('selectedIndex') == 0) 
	{
        G_REP_TEMP = G_REP_TEMP0 + "PHH/";
    } else 
	{
        if ($('#L_Utilisateur').prop('selectedIndex') == 1) 
		{
            G_REP_TEMP = G_REP_TEMP0 + "OB/";
        } else 
		{
            alert("Impossible de récuipérer l'utilisateur." + "\r\n" + "Traitement impossible.");
        };
    };

Est-ce que c'est possible ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 27, 2021 Jan 27, 2021
LATEST

Ha si, mince, ne pas tenir compte de mon précédent message, ça a bien fonctionné.

Le fichier avait une extension.

Par contre, est-ce qu'il serait possible de ne pas le faire pour les fonctions et garder

function toto() {

...

...

...

}

 

?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 19, 2021 Jan 19, 2021

Donc, il fausdra reprendre ce fichier pour chaque site ???

C'est lourd.
J'espère qu'une solution sera rapidement trouvé interne à DW.

Ce logiciel devient de plus en plus une usine à gaz et c'est bien dommage.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines