Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Fields authored Sep 7, 2024
2 parents 9cae1c1 + 8415827 commit a9dcfdf
Show file tree
Hide file tree
Showing 6 changed files with 5,775 additions and 5,786 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log

## Unreleased
## [v1.28.1](https://github.com/vscodevim/vim/tree/v1.28.1) (2024-09-07)

### Fixed

- Fixed `h` with unicode surrogate pairs ([@semicube](https://github.com/semicube)).

## [v1.28.0](https://github.com/vscodevim/vim/tree/v1.28.0) (2024-08-25)

### Added

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Vim",
"description": "Vim emulation for Visual Studio Code",
"icon": "images/icon.png",
"version": "1.27.3",
"version": "1.28.1",
"publisher": "vscodevim",
"galleryBanner": {
"color": "#e3f4ff",
Expand Down Expand Up @@ -1201,12 +1201,12 @@
"util": "0.12.5"
},
"devDependencies": {
"@types/diff": "5.2.1",
"@types/diff": "5.2.2",
"@types/diff-match-patch": "1.0.36",
"@types/glob": "8.1.0",
"@types/lodash": "4.17.7",
"@types/mocha": "10.0.7",
"@types/node": "20.16.1",
"@types/node": "20.16.5",
"@types/parsimmon": "1.10.9",
"@types/sinon": "17.0.3",
"@types/vscode": "1.74.0",
Expand Down
15 changes: 12 additions & 3 deletions src/actions/motion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,20 @@ class MoveLeft extends BaseMovement {
public override async execAction(position: Position, vimState: VimState): Promise<Position> {
const getLeftWhile = (p: Position): Position => {
const line = vimState.document.lineAt(p.line).text;
const newPosition = p.getLeft();
if (newPosition.character === 0) {
return newPosition;

if (p.character === 0) {
return p;
}
if (
isLowSurrogate(line.charCodeAt(p.character)) &&
isHighSurrogate(line.charCodeAt(p.character - 1))
) {
p = p.getLeft();
}

const newPosition = p.getLeft();
if (
newPosition.character > 0 &&
isLowSurrogate(line.charCodeAt(newPosition.character)) &&
isHighSurrogate(line.charCodeAt(newPosition.character - 1))
) {
Expand Down
3 changes: 1 addition & 2 deletions src/statusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ class StatusBarImpl implements vscode.Disposable {
}

if (vimState.macro) {
const macroText = 'Recording @' + vimState.macro.registerName;
text.push(macroText);
text.push('recording @' + vimState.macro.registerKey);
}

StatusBar.setText(vimState, text.join(' '));
Expand Down
7 changes: 7 additions & 0 deletions test/operator/surrogate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,11 @@ suite('surrogate-pair', () => {
keysPressed: 'i🐕🐕<ESC>',
end: ['🐕🐕|'],
});

newTest({
title: 'move left over cute dog',
start: ['|𩸽🐕', 'text'],
keysPressed: 'jlllkh',
end: ['|𩸽🐕', 'text'],
});
});
Loading

0 comments on commit a9dcfdf

Please sign in to comment.