Copy link to clipboard
Copied
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.
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 Format
Have a pleasant day!
Regards,
Nayan
Dreamweaver Team
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.
Copy link to clipboard
Copied
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 Format
Have a pleasant day!
Regards,
Nayan
Dreamweaver Team
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 ?
Copy link to clipboard
Copied
En fait, je voudrai que " { " soit sur la ligne suivante.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 ?
Copy link to clipboard
Copied
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() {
...
...
...
}
?
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now