#KT-56701 fixed
it was calculated incorrectly on the last line that do not end with EOL. #KT-56649 fixed