From 516675facd3c16bd2f42f78783a1da0f9c9e1866 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Thu, 1 Mar 2018 18:19:47 +0100 Subject: Dont select negative values --- src/Lang/Cpp/CppDocGen.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Lang/Cpp') diff --git a/src/Lang/Cpp/CppDocGen.ts b/src/Lang/Cpp/CppDocGen.ts index a7994eb..b825570 100644 --- a/src/Lang/Cpp/CppDocGen.ts +++ b/src/Lang/Cpp/CppDocGen.ts @@ -311,8 +311,8 @@ export class CppDocGen implements IDocGen { line = baseLine; character = baseCharacter; } - - const from: Position = new Position(line, character - this.smartTextLength - 1); + const start = character - this.smartTextLength - 1; + const from: Position = new Position(line, (start > 0 ? start : 0)); const to: Position = new Position(line, character); this.activeEditor.selection = new Selection(from, to); } -- cgit v1.2.3