Merge 3ea524179d
into 09f4e7e932
This commit is contained in:
commit
aade7f7544
|
@ -115,7 +115,7 @@ class AutocompleteParser : Parser
|
||||||
{
|
{
|
||||||
if (!currentIs(tok!"{"))
|
if (!currentIs(tok!"{"))
|
||||||
return null;
|
return null;
|
||||||
if (current.index > cursorPosition)
|
if (cursorPosition != -1 && current.index > cursorPosition)
|
||||||
{
|
{
|
||||||
BlockStatement bs = allocator.make!(BlockStatement);
|
BlockStatement bs = allocator.make!(BlockStatement);
|
||||||
bs.startLocation = current.index;
|
bs.startLocation = current.index;
|
||||||
|
@ -126,7 +126,7 @@ class AutocompleteParser : Parser
|
||||||
immutable start = current.index;
|
immutable start = current.index;
|
||||||
auto b = setBookmark();
|
auto b = setBookmark();
|
||||||
skipBraces();
|
skipBraces();
|
||||||
if (tokens[index - 1].index < cursorPosition)
|
if (cursorPosition != -1 && tokens[index - 1].index < cursorPosition)
|
||||||
{
|
{
|
||||||
abandonBookmark(b);
|
abandonBookmark(b);
|
||||||
BlockStatement bs = allocator.make!BlockStatement();
|
BlockStatement bs = allocator.make!BlockStatement();
|
||||||
|
@ -142,7 +142,7 @@ class AutocompleteParser : Parser
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t cursorPosition;
|
long cursorPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SimpleParser : Parser
|
class SimpleParser : Parser
|
||||||
|
|
Loading…
Reference in New Issue