Small fix in findProblemCloseToCursor
This commit fixes finding problem close to current cursor. Old version has wrong behavior:
- Place following code to some source file (line numbers is for example):
1: void test()
2: {
3:
4: int x = 1;
5:
6: }
- Built-in parser will produce error (warning) about unused variable and highlights 'x' character in line 4.
- Place cursor to line 4 and press 'Alt'. Error popup will be shown - OK.
- Place cursor to line 3 or 5 and press 'Alt'. Error popup will NOT be shown - wrong.
Such behavior is caused by incorrect usage of error range and current position. In the presented example we will always return non-whitespace text between cursor and error range.
The patch fixes this by "catching" analyzed text between current cursor and the error LINE bound instead RANGE bound.