2929async def _display_content ( target : _parts .Target , content : str ) -> None :
3030 ''' Displays content in system pager. '''
3131 from .display import display_content
32+
3233 # Suffix from location for proper syntax highlighting.
3334 suffix = __ .Path ( target .part .location ).suffix or '.txt'
3435 display_content ( content , suffix = suffix )
@@ -61,6 +62,7 @@ async def _display_differences(
6162async def _edit_content ( target : _parts .Target , content : str ) -> str :
6263 ''' Edits content in system editor. '''
6364 from .edit import edit_content
65+
6466 # Suffix from location for proper syntax highlighting.
6567 suffix = __ .Path ( target .destination ).suffix or '.txt'
6668 return edit_content ( content , suffix = suffix )
@@ -70,6 +72,7 @@ def _prompt_action(
7072 target : _parts .Target , content : str , protect : bool
7173) -> str :
7274 from readchar import readkey
75+
7376 from .exceptions import UserOperateCancellation
7477 menu = _produce_actions_menu ( target .part , content , protect )
7578 print ( f"\n { menu } > " , end = '' )
@@ -153,8 +156,8 @@ def _calculate_differences(
153156 original : __ .Absential [ str ] = __ .absent ,
154157) -> list [ str ]:
155158 ''' Generates unified diff between contents. '''
156- from patiencediff import (
157- unified_diff , PatienceSequenceMatcher ) # pyright: ignore
159+ from patiencediff import PatienceSequenceMatcher # pyright: ignore
160+ from patiencediff import unified_diff # pyright: ignore
158161 from_lines = (
159162 original .split ( '\n ' ) if not __ .is_absent ( original ) else [ ] )
160163 to_lines = revision .split ( '\n ' )
0 commit comments