William Navaraj <williamnava...@gmail.com> added the comment:

The variation in the caret position was also due to the trailing spaces. This 
is now sorted in this solution with a factored out function to find out the 
correct offset.
https://github.com/python/cpython/compare/main...williamnavaraj:fix-issue-46275?expand=1

Tested against all of the following cases and it works great:

temp=f"blank ({foo()}"+f"blank ({foo(}"+f"blank ({foo()}"
temp=f"blank*{foo(*blank*foo()*blank*foo()}"+f"({foo(}"+f"blank ({foo(}"
a=foo)+foo()+foo()      
f"blank ({foo(blank ({foo()}) blank foo()})"   
temp=f"blank ({foo)foo2" 
temp=f"blank {foo)"
temp=f"blank {foo)"<Space double triple or more here>
temp=f"blank ({foo)blank ({foo()}) blank foo()})"  yetAnotherBlah
temp=f"blank ({foo)blank ({foo()}) blank foo()})"  
yetAnotherBlahWithFurtherSpacesAfter

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to