From 59a853a86eb2e1a2ef45e4a104ee030723c99bdd Mon Sep 17 00:00:00 2001 From: Qiming Zhao Date: Thu, 20 Feb 2025 22:53:18 +0800 Subject: [PATCH] fix(locations): consider unicode on jump --- src/__tests__/handler/locations.test.ts | 4 ++-- src/handler/locations.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/__tests__/handler/locations.test.ts b/src/__tests__/handler/locations.test.ts index c1a080c176c..937d0052899 100644 --- a/src/__tests__/handler/locations.test.ts +++ b/src/__tests__/handler/locations.test.ts @@ -278,10 +278,10 @@ describe('locations', () => { expect(res).toEqual([ { name: 'foo', - cmd: 'silent keepjumps call cursor(3, 1)', + cmd: 'silent keepjumps call coc#cursor#move_to(2, 0)', filename: 'test://bar' }, - { name: 'foo', cmd: 'silent keepjumps call cursor(2, 1)', filename: '/foo' } + { name: 'foo', cmd: 'silent keepjumps call coc#cursor#move_to(1, 0)', filename: '/foo' } ]) }) }) diff --git a/src/handler/locations.ts b/src/handler/locations.ts index 6364e7cef93..37d834bbf09 100644 --- a/src/handler/locations.ts +++ b/src/handler/locations.ts @@ -136,7 +136,7 @@ export default class LocationsHandler { const filename = parsedURI.scheme == 'file' ? parsedURI.fsPath : parsedURI.toString() return { name: word, - cmd: `silent keepjumps call cursor(${location.range.start.line + 1}, ${location.range.start.character + 1})`, + cmd: `silent keepjumps call coc#cursor#move_to(${location.range.start.line}, ${location.range.start.character})`, filename, } })