-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search addon is off on lines containing emojis #1103
Labels
Milestone
Comments
Tyriar
changed the title
Find addon is off on lines containing emojis
Search addon is off on lines containing emojis
Nov 2, 2017
The error most likely comes from https://github.com/xtermjs/xterm.js/blob/master/src/addons/search/SearchHelper.ts#L117 I suppose a quick fix could look like: private _findInLine(term: string, line: number): ISearchResult {
const lowerStringLine = this._terminal.buffer.translateBufferLineToString(line, true).toLowerCase()
const lowerTerm = term.toLowerCase()
const searchIndex = lowerStringLine.indexOf(lowerTerm)
if (searchIndex >= 0) {
// ⬇️
for (let i = 0; i < searchIndex; i++) {
const current_char_width = this._terminal.buffer.lines[line][i][CHAR_DATA_WIDTH_INDEX]
if (this._terminal.buffer.lines[line][CHAR_DATA_WIDTH_INDEX] === 0)
searchIndex--
else if (this._terminal.buffer.lines[line][CHAR_DATA_WIDTH_INDEX] === 2)
searchIndex--
}
// ⬆️
return {
term,
col: searchIndex,
row: line,
}
}
} I wish I could do more, but this addon has no tests. |
Tyriar
added a commit
to Tyriar/xterm.js
that referenced
this issue
Jan 16, 2018
Tyriar
added a commit
to Tyriar/xterm.js
that referenced
this issue
Jan 16, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VS Code issue: microsoft/vscode#37440
The text was updated successfully, but these errors were encountered: