Small fix in findProblemCloseToCursor

Authored by antonanikin on Nov 2 2016, 2:26 AM.

Description

Small fix in findProblemCloseToCursor

This commit fixes finding problem close to current cursor. Old version has wrong behavior:

  1. Place following code to some source file (line numbers is for example):

1: void test()
2: {
3:
4: int x = 1;
5:
6: }

  1. Built-in parser will produce error (warning) about unused variable and highlights 'x' character in line 4.
  1. Place cursor to line 4 and press 'Alt'. Error popup will be shown - OK.
  2. 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.

Details

Committed
antonanikinNov 2 2016, 2:26 AM
Parents
R32:ffa898ee5036: Fix crash in PartDocument::isActive
Branches
Unknown
Tags
Unknown