After once encouraging repentance in someone who was insisting that God had no problems with sexual activity outside of marriage, the person responded with, "God knows my heart, so I'm okay; you don't have to worry about me any more." Interestingly, it is true that God knew her heart; what is not true is that she knew God's or her own heart.
How many times have you heard someone bring out the foolish idea to "follow your heart"? Jesus tells us in many places that our hearts are filled with all kind of sinful desires (why would you want to follow that?). In yesterday's first reading for Mass from the book of Jeremiah we were told "The heart is deceitful above all things, and desperately corrupt, who can understand it?" The very next thing it tells us is "I the Lord search the mind and try the heart, to give to every man according to his ways, according to the fruit of his doings."
In other words, He knows our hearts (and judges us accordingly) but if we think we know our hearts then we are gravely mistaken. This passage is not an encouragement to feel comfortable because you like what you are doing, it is a warning that God knows what we are hiding. He knows how much we have compromised, and whether we are truly listening to Him when He speaks. He knows whether we have taken full advantage of His grace to repent.
You are never told in Scripture to, "listen to your heart" or "follow your heart". Rather, you are told to work to "purify your hearts" (James 4:8), and realize that they are very deceptive. Only if we truly subject our feelings and emotions to God will we love what is good and hate what is evil. Only then can we be confident when He judges our hearts that He will find them to be holy and devoted to Christ.