@@ -179,14 +179,14 @@ def identifier_resolver(m: Marker):
179
179
case (region , relindent ):
180
180
dest_indent = search_range .indent
181
181
content_range = restrict_search_range_for_marker (
182
- region , action , lines , search_range , identifier_resolver
182
+ region , action , lines , RangeSpec . EMPTY , identifier_resolver
183
183
)
184
184
content = content_range .read (lines )
185
185
count = dest_indent + (relindent or 0 )
186
- # TODO IndentationInfo.from_content(content) ?
187
- content = IndentationInfo .from_content (lines ).shift_indentation (
186
+ content = IndentationInfo .from_content (content ).shift_indentation (
188
187
content , count
189
188
)
189
+ content = (region , content )
190
190
case _:
191
191
match action :
192
192
case MoveClause (insert_position = region , relative_indentation = relindent ):
@@ -219,9 +219,13 @@ def _apply_action(self, action: EditingAction, lines: Sequence[str], range_spec:
219
219
range_spec .delete (lines )
220
220
221
221
case ReplaceClause () | InsertClause ():
222
- content = IndentationInfo .from_content (lines ).apply_relative_indents (
223
- content , range_spec .indent
224
- )
222
+ match content :
223
+ case (region , processed_content ):
224
+ content = processed_content
225
+ case str ():
226
+ content = IndentationInfo .from_content (lines ).apply_relative_indents (
227
+ content , range_spec .indent
228
+ )
225
229
226
230
range_spec .write (content , lines )
227
231
0 commit comments