yescorp commented on issue #25279:
URL: https://github.com/apache/beam/issues/25279#issuecomment-1414952786

   Foldable block that is folded is no longer recognizable because of the 
unclosed multiline string. 
   Therefore, when we update the code inside `CodeController.setValue`, it is 
not the same as the text that is being edited.
   
   In `CodeController.setValue` we have:
   ```dart
   _updateCodeIfChanged(editResult.fullTextAfter);
   
   if (newValue.text != _code.visibleText) {
     // Manually typed in a text that has become a hidden range.
     newValue = newValue.replacedText(_code.visibleText);
   }
   ```
   
   Which changes selection according to 
   
   ```dart
   TextEditingValue replacedText(String newText) {
       if (newText == text) {
         return this;
       }
   
       final rangeAfter = newText.getChangedRange(
         text,
         attributeChangeTo: TextAffinity.upstream,
       );
   
       return TextEditingValue(
         text: newText,
         selection: TextSelection.collapsed(offset: rangeAfter.start),
       );
     }
   ```
   
   It seems useful in some cases, because just changing this led to failing 
test cases.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to