summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Lang/Cpp/CppDocGen.ts4
-rw-r--r--src/test/CppTests/Con-AndDestructor.test.ts2
2 files changed, 4 insertions, 2 deletions
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);
}
diff --git a/src/test/CppTests/Con-AndDestructor.test.ts b/src/test/CppTests/Con-AndDestructor.test.ts
index 6bf3242..7858c30 100644
--- a/src/test/CppTests/Con-AndDestructor.test.ts
+++ b/src/test/CppTests/Con-AndDestructor.test.ts
@@ -15,6 +15,8 @@ import TestSetup from "./TestSetup";
suite("C++ - Con- and Destructor Tests", () => {
const testSetup: TestSetup = new TestSetup("void foo();");
+ testSetup.cfg.generateSmartText = false;
+
// Tests
test("Normal Constructor", () => {
const result = testSetup.SetLine("Foo(int a);").GetResult();