f41e8f8522
Fix get_caret_position to correctly return number of bytes from the beginning of the body to the current caret position and introduce the get_caret_offset function to return the number of bytes from the beginning of current line to the current caret position. Also the code of the numlines function was adjusted as the webkit_dom_range_to_string (used by both previously mentioned functions) is returning a text without new line characters, thus when counting the line number we cannot increase the counter if we hit a new line character.