Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Tag Source": "Tag Source",
"Autocompletion": "Autocompletion",
"Related Tags": "Related Tags",
"Display": "Display"
"Display": "Display",
"AutoFormatter": "AutoFormatter"
}
}
4 changes: 4 additions & 0 deletions locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
"manual": "Manual"
}
},
"AutocompletePlus_AutoFormatter_UseTrailingComma": {
"name": "Use Trailing Comma",
"tooltip": "When enabled, ensures all lines end with a trailing comma.\nWhen disabled, removes trailing commas."
},
"AutocompletePlus_AutoFormatter_EnableAutoFormat": {
"name": "Enable Auto Format"
}
Expand Down
3 changes: 2 additions & 1 deletion locales/ja/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Tag Source": "タグソース",
"Autocompletion": "オートコンプリート",
"Related Tags": "関連タグ",
"Display": "表示"
"Display": "表示",
"AutoFormatter": "自動フォーマット"
}
}
3 changes: 2 additions & 1 deletion locales/zh-TW/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Tag Source": "標籤來源",
"Autocompletion": "自動完成",
"Related Tags": "相關標籤",
"Display": "顯示"
"Display": "顯示",
"AutoFormatter": "自動格式化"
}
}
4 changes: 4 additions & 0 deletions locales/zh-TW/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
"manual": "手動"
}
},
"AutocompletePlus_AutoFormatter_UseTrailingComma": {
"name": "在行末添加逗號",
"tooltip": "啟用時,確保所有行都以逗號結尾。\n停用時,移除結尾逗號。"
},
"AutocompletePlus_AutoFormatter_EnableAutoFormat": {
"name": "啟用自動格式化"
}
Expand Down
3 changes: 2 additions & 1 deletion locales/zh/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Tag Source": "标签来源",
"Autocompletion": "自动完成",
"Related Tags": "相关标签",
"Display": "显示"
"Display": "显示",
"AutoFormatter": "自动格式化"
}
}
4 changes: 4 additions & 0 deletions locales/zh/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
"manual": "手动"
}
},
"AutocompletePlus_AutoFormatter_UseTrailingComma": {
"name": "在行末添加逗号",
"tooltip": "启用时,确保所有行都以逗号结尾。\n禁用时,移除结尾逗号。"
},
"AutocompletePlus_AutoFormatter_EnableAutoFormat": {
"name": "启用自动格式化"
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-autocomplete-plus"
description = "Autocomplete and Related Tag display for ComfyUI"
version = "1.7.2"
version = "1.8.0"
license = {file = "LICENSE"}
dependencies = ["",]

Expand Down
4 changes: 2 additions & 2 deletions web/js/auto-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export function formatPromptText(text) {
// Rejoin cleaned tags with ", "
let formattedLine = cleanedTags.join(', ');

// Add a trailing comma and space if the line contains valid tags
if (formattedLine.length > 0) {
// Add a trailing comma and space if the setting is enabled and line contains valid tags
if (formattedLine.length > 0 && settingValues.useTrailingComma) {
formattedLine += ', ';
}

Expand Down
11 changes: 11 additions & 0 deletions web/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,17 @@ app.registerExtension({
},

// --- Auto format settings ---
{
id: id + '.AutoFormatter.UseTrailingComma',
name: 'Use Trailing Comma',
tooltip: 'When enabled, ensures all lines end with a trailing comma.\nWhen disabled, removes trailing commas.',
type: 'boolean',
defaultValue: false,
category: [name, 'AutoFormatter', 'Use Trailing Comma'],
onChange: (newVal, oldVal) => {
settingValues.useTrailingComma = newVal;
},
},
{
id: id + '.AutoFormatter.Trigger',
name: 'Auto Format Trigger',
Expand Down
1 change: 1 addition & 0 deletions web/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const settingValues = {
// Auto format settings
enableAutoFormat: true,
autoFormatTrigger: 'auto', // Options: 'auto' (format on blur + shortcut), 'manual' (shortcut only)
useTrailingComma: false, // Whether to add comma at the end of each line


// Internal logic settings
Expand Down
Loading