fix various typos and grammar errors in comments (#834)

This commit is contained in:
Hrvoje Šimić 2016-10-10 12:26:47 +02:00 committed by Timothy
parent 4d8cf7ba9a
commit 7e71bf356b
13 changed files with 40 additions and 33 deletions

View file

@ -74,7 +74,7 @@ exports.subscribe = function (fn) {
exports.init = function () { exports.init = function () {
// for backwards compatibility with hyperterm // for backwards compatibility with hyperterm
// (prior to the renme), we try to rename // (prior to the rename), we try to rename
// on behalf of the user // on behalf of the user
try { try {
statSync(pathLegacy); statSync(pathLegacy);

View file

@ -34,7 +34,7 @@ app.config = config;
app.plugins = plugins; app.plugins = plugins;
app.getWindows = () => new Set([...windowSet]); // return a clone app.getWindows = () => new Set([...windowSet]); // return a clone
// function to retrive the last focused window in windowSet; // function to retrieve the last focused window in windowSet;
// added to app object in order to expose it to plugins. // added to app object in order to expose it to plugins.
app.getLastFocusedWindow = () => { app.getLastFocusedWindow = () => {
if (!windowSet.size) { if (!windowSet.size) {
@ -160,8 +160,8 @@ app.on('ready', () => installDevExtensions(isDev).then(() => {
} }
// app.windowCallback is the createWindow callback // app.windowCallback is the createWindow callback
// that can be setted before the 'ready' app event // that can be set before the 'ready' app event
// and createWindow deifinition. It's exeuted in place of // and createWindow deifinition. It's executed in place of
// the callback passed as parameter, and deleted right after. // the callback passed as parameter, and deleted right after.
(app.windowCallback || fn)(win); (app.windowCallback || fn)(win);
delete (app.windowCallback); delete (app.windowCallback);
@ -207,7 +207,7 @@ app.on('ready', () => installDevExtensions(isDev).then(() => {
}); });
// TODO: this goes away when we are able to poll // TODO: this goes away when we are able to poll
// for the title ourseleves, instead of relying // for the title ourselves, instead of relying
// on Session and focus/blur to subscribe // on Session and focus/blur to subscribe
rpc.on('focus', ({uid}) => { rpc.on('focus', ({uid}) => {
const session = sessions.get(uid); const session = sessions.get(uid);
@ -400,7 +400,7 @@ app.on('open-file', (event, path) => {
} else if (!lastWindow && {}.hasOwnProperty.call(app, 'createWindow')) { } else if (!lastWindow && {}.hasOwnProperty.call(app, 'createWindow')) {
app.createWindow(callback); app.createWindow(callback);
} else { } else {
// if createWindow not exists yet ('ready' event was not fired), // If createWindow doesn't exist yet ('ready' event was not fired),
// sets his callback to an app.windowCallback property. // sets his callback to an app.windowCallback property.
app.windowCallback = callback; app.windowCallback = callback;
} }

View file

@ -167,7 +167,7 @@ export function sendSessionData(uid, data) {
type: SESSION_USER_DATA, type: SESSION_USER_DATA,
data, data,
effect() { effect() {
// If no uid is passed, data is sended to the active session. // If no uid is passed, data is sent to the active session.
const targetUid = uid || getState().sessions.activeUid; const targetUid = uid || getState().sessions.activeUid;
rpc.emit('data', {uid: targetUid, data}); rpc.emit('data', {uid: targetUid, data});
} }

View file

@ -212,7 +212,7 @@ export function showPreferences() {
rpc.once('session data', () => { rpc.once('session data', () => {
dispatch(sendSessionData( dispatch(sendSessionData(
uid, uid,
// Leading space prevents command to be store in shell history // Leading space prevents command to be stored in shell history
[' echo Attempting to open ~/.hyper.js with your \$EDITOR', // eslint-disable-line no-useless-escape [' echo Attempting to open ~/.hyper.js with your \$EDITOR', // eslint-disable-line no-useless-escape
' echo If it fails, open it manually with your favorite editor!', ' echo If it fails, open it manually with your favorite editor!',
' bash -c \'exec env ${EDITOR:=' + editorFallback + '} ~/.hyper.js\'', ' bash -c \'exec env ${EDITOR:=' + editorFallback + '} ~/.hyper.js\'',

View file

@ -40,6 +40,7 @@ export default class Component extends React.Component {
if (c) { if (c) {
// we compute the global name from the given // we compute the global name from the given
// css class and we prepend the component name // css class and we prepend the component name
//
// it's important classes never get mangled by // it's important classes never get mangled by
// uglifiers so that we can avoid collisions // uglifiers so that we can avoid collisions
const component = this.constructor.name const component = this.constructor.name

View file

@ -167,6 +167,7 @@ export default class SplitPane extends Component {
// this shim is used to make sure mousemove events // this shim is used to make sure mousemove events
// trigger in all the draggable area of the screen // trigger in all the draggable area of the screen
//
// this is not the case due to hterm's <iframe> // this is not the case due to hterm's <iframe>
shim: { shim: {
position: 'fixed', position: 'fixed',

View file

@ -7,7 +7,7 @@ hterm.defaultStorage = new lib.Storage.Memory();
// Provide selectAll to terminal viewport // Provide selectAll to terminal viewport
hterm.Terminal.prototype.selectAll = function () { hterm.Terminal.prototype.selectAll = function () {
// We need to clear dom range to reset anchorNode // We need to clear the DOM range to reset anchorNode
selection.clear(this); selection.clear(this);
selection.all(this); selection.all(this);
}; };
@ -207,7 +207,7 @@ hterm.Terminal.prototype.onMouse_ = function (e) {
return oldOnMouse.call(this, e); return oldOnMouse.call(this, e);
}; };
// sine above we're no longer relying on `preventDefault` // since above we're no longer relying on `preventDefault`
// to avoid selections, we use css instead, so that // to avoid selections, we use css instead, so that
// focus is not lost, but selections are still not possible // focus is not lost, but selections are still not possible
// when the appropiate VT mode is set // when the appropiate VT mode is set

View file

@ -90,7 +90,7 @@ const reducer = (state = initial, action) => {
case CONFIG_RELOAD: // eslint-disable-line no-case-declarations case CONFIG_RELOAD: // eslint-disable-line no-case-declarations
const {config} = action; const {config} = action;
state_ = state state_ = state
// we unset the user font size override if the // unset the user font size override if the
// font size changed from the config // font size changed from the config
.merge((() => { .merge((() => {
const ret = {}; const ret = {};
@ -183,7 +183,7 @@ const reducer = (state = initial, action) => {
break; break;
case SESSION_RESIZE: case SESSION_RESIZE:
// We only care about the sizes // only care about the sizes
// of standalone terms (i.e. not splits): // of standalone terms (i.e. not splits):
if (!action.isStandaloneTerm) { if (!action.isStandaloneTerm) {
break; break;
@ -233,7 +233,7 @@ const reducer = (state = initial, action) => {
break; break;
} }
// we ignore activity markers that are within // ignore activity markers that are within
// proximity of a resize event, since we // proximity of a resize event, since we
// expect to get data packets from the resize // expect to get data packets from the resize
// of the ptys as a result // of the ptys as a result
@ -294,8 +294,7 @@ const reducer = (state = initial, action) => {
break; break;
} }
// we check that if any of the font size values changed // Show a notification if any of the font size values have changed
// we show a notification
if (CONFIG_LOAD !== action.type) { if (CONFIG_LOAD !== action.type) {
if (state_.fontSize !== state.fontSize || if (state_.fontSize !== state.fontSize ||
state_.fontSizeOverride !== state.fontSizeOverride) { state_.fontSizeOverride !== state.fontSizeOverride) {

14
lib/utils/effects.js vendored
View file

@ -1,9 +1,11 @@
// simple redux middleware that executes /**
// the `effect` field if provided in an action * Simple redux middleware that executes
// since this is preceded by the `plugins` * the `effect` field if provided in an action
// middleware, it allows authors to interrumpt, * since this is preceded by the `plugins`
// defer or add to existing side effects at will * middleware. It allows authors to interrupt,
// as the result of an action being triggered * defer or add to existing side effects at will
* as the result of an action being triggered.
*/
export default () => next => action => { export default () => next => action => {
const ret = next(action); const ret = next(action);

View file

@ -1,10 +1,14 @@
// Based on https://github.com/kevva/executable /*
// Since this module doesn't expose the function to check stat mode only, * Based on https://github.com/kevva/executable
// his logic is pasted here. * Since this module doesn't expose the function to check stat mode only,
// Opened an issue and a pull request about it, * his logic is pasted here.
// to maybe switch to module in the future: *
// Issue: https://github.com/kevva/executable/issues/9 * Opened an issue and a pull request about it,
// PR: https://github.com/kevva/executable/pull/10 * to maybe switch to module in the future:
*
* Issue: https://github.com/kevva/executable/issues/9
* PR: https://github.com/kevva/executable/pull/10
*/
export function isExecutable(fileStat) { export function isExecutable(fileStat) {
if (process.platform === 'win32') { if (process.platform === 'win32') {

View file

@ -1,7 +1,7 @@
/** /**
* Keyboard event keyCodes have proven to be really unreliable. * Keyboard event keyCodes have proven to be really unreliable.
* This util function will cover most of the edge cases where * This util function will cover most of the edge cases where
* String.fromCharCode() will not work * String.fromCharCode() doesn't work.
*/ */
const _toAscii = { const _toAscii = {
@ -54,7 +54,7 @@ const _arrowKeys = {
/** /**
* This fn takes a keyboard event and returns * This fn takes a keyboard event and returns
* the character that was pressed. This fn * the character that was pressed. This fn
* purposely doens't take into account if the alt/meta * purposely doesn't take into account if the alt/meta
* key was pressed. * key was pressed.
*/ */
export default function fromCharCode(e) { export default function fromCharCode(e) {

View file

@ -38,7 +38,7 @@ let termGroupPropsDecorators;
let propsDecorators; let propsDecorators;
let reducersDecorators; let reducersDecorators;
// the fs locations where usr plugins are stored // the fs locations where user plugins are stored
const {path, localPath} = plugins.getBasePaths(); const {path, localPath} = plugins.getBasePaths();
const clearModulesCache = () => { const clearModulesCache = () => {
@ -52,7 +52,7 @@ const clearModulesCache = () => {
// clear require cache // clear require cache
for (const entry in window.require.cache) { for (const entry in window.require.cache) {
if (entry.indexOf(path) === 0 || entry.indexOf(localPath) === 0) { if (entry.indexOf(path) === 0 || entry.indexOf(localPath) === 0) {
// `require` is webpacks', `window.require`, electron's // `require` is webpacks', `window.require` is electron's
delete window.require.cache[entry]; delete window.require.cache[entry];
} }
} }

View file

@ -1,4 +1,4 @@
// clear selection range of current selected term view // Clear selection range of current selected term view
// Fix event when terminal text is selected and keyboard action is invoked // Fix event when terminal text is selected and keyboard action is invoked
exports.clear = function (terminal) { exports.clear = function (terminal) {
terminal.document_.getSelection().removeAllRanges(); terminal.document_.getSelection().removeAllRanges();