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 commit-editor-app/src/components/validity-indicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<script lang="ts">
import { computed, defineComponent, inject, ref } from 'vue'
import { monaco } from '../lib/monaco'
import { isCommitMessageEmpty } from '../lib/message-empty-check'
import { TabStore, tabStoreSymbol } from '../stores/tab.store'
import Icon from './icon.vue'
import MonacoStyleTooltip from './monaco-style-tooltip.vue'
Expand Down Expand Up @@ -82,7 +83,7 @@ export default defineComponent({
).length ?? 0
)
const hasConfigError = computed(() => tabStore?.state.configErrors.length ?? 0 > 0)
const messageEmpty = computed(() => !tabStore?.state.commitMessage)
const messageEmpty = computed(() => isCommitMessageEmpty(tabStore?.state.commitMessage || ''))

const clickError = () => tabStore?.messageEditorNextMarkerActionTriggered()

Expand Down
9 changes: 9 additions & 0 deletions commit-editor-app/src/lib/message-empty-check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// TODO read comment character from config
export function isCommitMessageEmpty(
message: string,
commentCharacter = '#'
): boolean {
return !message
.split('\n')
.some((line) => !line.startsWith(commentCharacter) && line.trim())
}