Merge branch 'master' into fix-1749

This commit is contained in:
Prabhanjan S Koushik
2018-10-17 10:51:27 +05:30
committed by GitHub
3 changed files with 11 additions and 6 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ export class SearchHelper implements ISearchHelper {
/** /**
* Find the next instance of the term, then scroll to and select it. If it * Find the next instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing. * doesn't exist, do nothing.
* @param term Tne search term. * @param term The search term.
* @param searchOptions Search options. * @param searchOptions Search options.
* @return Whether a result was found. * @return Whether a result was found.
*/ */
@@ -63,7 +63,7 @@ export class SearchHelper implements ISearchHelper {
/** /**
* Find the previous instance of the term, then scroll to and select it. If it * Find the previous instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing. * doesn't exist, do nothing.
* @param term Tne search term. * @param term The search term.
* @param searchOptions Search options. * @param searchOptions Search options.
* @return Whether a result was found. * @return Whether a result was found.
*/ */
@@ -120,7 +120,7 @@ export class SearchHelper implements ISearchHelper {
* subsequent terminal lines if the text is wrapped. If the provided line number is part of a wrapped text line that * subsequent terminal lines if the text is wrapped. If the provided line number is part of a wrapped text line that
* started on an earlier line then it is skipped since it will be properly searched when the terminal line that the * started on an earlier line then it is skipped since it will be properly searched when the terminal line that the
* text starts on is searched. * text starts on is searched.
* @param term Tne search term. * @param term The search term.
* @param y The line to search. * @param y The line to search.
* @param searchOptions Search options. * @param searchOptions Search options.
* @return The search result if it was found. * @return The search result if it was found.
+2 -2
View File
@@ -10,7 +10,7 @@ import { ISearchAddonTerminal, ISearchOptions } from './Interfaces';
/** /**
* Find the next instance of the term, then scroll to and select it. If it * Find the next instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing. * doesn't exist, do nothing.
* @param term Tne search term. * @param term The search term.
* @param searchOptions Search options * @param searchOptions Search options
* @return Whether a result was found. * @return Whether a result was found.
*/ */
@@ -25,7 +25,7 @@ export function findNext(terminal: Terminal, term: string, searchOptions: ISearc
/** /**
* Find the previous instance of the term, then scroll to and select it. If it * Find the previous instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing. * doesn't exist, do nothing.
* @param term Tne search term. * @param term The search term.
* @param searchOptions Search options * @param searchOptions Search options
* @return Whether a result was found. * @return Whether a result was found.
*/ */
+6 -1
View File
@@ -129,12 +129,17 @@ export default class DynamicCharAtlas extends BaseCharAtlas {
return true; return true;
} }
// Exit early for uncachable glyphs
if (!this._canCache(glyph)) {
return false;
}
const glyphKey = getGlyphCacheKey(glyph); const glyphKey = getGlyphCacheKey(glyph);
const cacheValue = this._cacheMap.get(glyphKey); const cacheValue = this._cacheMap.get(glyphKey);
if (cacheValue !== null && cacheValue !== undefined) { if (cacheValue !== null && cacheValue !== undefined) {
this._drawFromCache(ctx, cacheValue, x, y); this._drawFromCache(ctx, cacheValue, x, y);
return true; return true;
} else if (this._canCache(glyph) && this._drawToCacheCount < FRAME_CACHE_DRAW_LIMIT) { } else if (this._drawToCacheCount < FRAME_CACHE_DRAW_LIMIT) {
let index; let index;
if (this._cacheMap.size < this._cacheMap.capacity) { if (this._cacheMap.size < this._cacheMap.capacity) {
index = this._cacheMap.size; index = this._cacheMap.size;