@@ -228,11 +228,16 @@ def add_description(commit_msg):
228
228
return commit_msg
229
229
230
230
231
+ def custom_prompt_continuation (width , line_number , is_soft_wrap ):
232
+ text_continuation = " " * (width - 2 ) + "┃ "
233
+ return ANSI (Ansi .colour (Ansi .fg .bright_green , text_continuation ))
234
+
235
+
231
236
def add_body (commit_msg ):
232
237
if IS_BREAKING_CHANGE is None :
233
238
raise ValueError ("Global variable `IS_BREAKING_CHANGE` has not been set." )
234
239
235
- session = PromptSession ()
240
+ session = PromptSession (prompt_continuation = custom_prompt_continuation )
236
241
body_validator = BodyValidator (session , IS_BREAKING_CHANGE )
237
242
238
243
if IS_BREAKING_CHANGE :
@@ -242,7 +247,7 @@ def add_body(commit_msg):
242
247
"Press Esc before Enter to submit."
243
248
)
244
249
)
245
- text = Ansi .b_green ("Body (required): " )
250
+ text = Ansi .b_green ("Body (required) ┃ " )
246
251
else :
247
252
Ansi .print_info (
248
253
wrap_width (
@@ -252,7 +257,7 @@ def add_body(commit_msg):
252
257
]
253
258
)
254
259
)
255
- text = Ansi .b_green ("Body (optional): " )
260
+ text = Ansi .b_green ("Body (optional) ┃ " )
256
261
257
262
c_body = session .prompt (ANSI (text ), validator = body_validator )
258
263
c_body = c_body .strip () # remove leading/trailing whitespace
@@ -305,14 +310,11 @@ def add_footer(commit_msg):
305
310
)
306
311
)
307
312
308
- def footer_prompt_continuation (width , line_number , is_soft_wrap ):
309
- return " " * (width - 2 ) + "| "
310
-
311
- text = Ansi .b_green ("Footer (optional): " )
313
+ text = Ansi .b_green ("Footer (optional) ┃ " )
312
314
session = PromptSession (
313
315
completer = FooterCompleter (),
314
316
multiline = False ,
315
- prompt_continuation = footer_prompt_continuation ,
317
+ prompt_continuation = custom_prompt_continuation ,
316
318
)
317
319
c_footer = session .prompt (ANSI (text ), validator = FooterValidator (session )).strip ()
318
320
0 commit comments