Skip to content

Commit

Permalink
Spelling (yhirose#31)
Browse files Browse the repository at this point in the history
* spelling: attribute

Signed-off-by: Josh Soref <[email protected]>

* spelling: column

Signed-off-by: Josh Soref <[email protected]>

* spelling: linenoise

Signed-off-by: Josh Soref <[email protected]>

* spelling: platform

Signed-off-by: Josh Soref <[email protected]>

* spelling: position

Signed-off-by: Josh Soref <[email protected]>

* spelling: previous

Signed-off-by: Josh Soref <[email protected]>

Co-authored-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref and jsoref authored Nov 5, 2021
1 parent a927043 commit 4cd89ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cpp-linenoise
=============

Multi-platfrom (Unix, Windows) C++ header-only linenoise-based readline library.
Multi-platform (Unix, Windows) C++ header-only linenoise-based readline library.

This library gathered code from following excellent libraries, clean it up, and put it into a C++ header file for convenience.

* `linenoise.h` and `linenose.c` ([antirez/linenoise](https://github.com/antirez/linenoise))
* `linenoise.h` and `linenoise.c` ([antirez/linenoise](https://github.com/antirez/linenoise))
* `ANSI.c` ([adoxa/ansicon](https://github.com/adoxa/ansicon))
* `Win32_ANSI.h` and `Win32_ANSI.c` ([MSOpenTech/redis](https://github.com/MSOpenTech/redis))

Expand Down
32 changes: 16 additions & 16 deletions linenoise.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* linenoise.hpp -- Multi-platfrom C++ header-only linenoise library.
* linenoise.hpp -- Multi-platform C++ header-only linenoise library.
*
* All credits and commendations have to go to the authors of the
* following excellent libraries.
*
* - linenoise.h and linenose.c (https://github.com/antirez/linenoise)
* - linenoise.h and linenoise.c (https://github.com/antirez/linenoise)
* - ANSI.c (https://github.com/adoxa/ansicon)
* - Win32_ANSI.h and Win32_ANSI.c (https://github.com/MSOpenTech/redis)
*
Expand Down Expand Up @@ -372,7 +372,7 @@ inline void SendSequence(LPCWSTR seq)
inline void InterpretEscSeq(void)
{
int i;
WORD attribut;
WORD attribute;
CONSOLE_SCREEN_BUFFER_INFO Info;
CONSOLE_CURSOR_INFO CursInfo;
DWORD len, NumberOfCharsWritten;
Expand Down Expand Up @@ -463,34 +463,34 @@ inline void InterpretEscSeq(void)
{
if (grm.rvideo)
{
attribut = foregroundcolor[grm.foreground]
attribute = foregroundcolor[grm.foreground]
| backgroundcolor[grm.foreground];
if (grm.bold)
attribut |= FOREGROUND_INTENSITY | BACKGROUND_INTENSITY;
attribute |= FOREGROUND_INTENSITY | BACKGROUND_INTENSITY;
}
else
{
attribut = foregroundcolor[grm.background]
attribute = foregroundcolor[grm.background]
| backgroundcolor[grm.background];
if (grm.underline)
attribut |= FOREGROUND_INTENSITY | BACKGROUND_INTENSITY;
attribute |= FOREGROUND_INTENSITY | BACKGROUND_INTENSITY;
}
}
else if (grm.rvideo)
{
attribut = foregroundcolor[grm.background]
attribute = foregroundcolor[grm.background]
| backgroundcolor[grm.foreground];
if (grm.bold)
attribut |= BACKGROUND_INTENSITY;
attribute |= BACKGROUND_INTENSITY;
if (grm.underline)
attribut |= FOREGROUND_INTENSITY;
attribute |= FOREGROUND_INTENSITY;
}
else
attribut = foregroundcolor[grm.foreground] | grm.bold
attribute = foregroundcolor[grm.foreground] | grm.bold
| backgroundcolor[grm.background] | grm.underline;
if (grm.reverse)
attribut = ((attribut >> 4) & 15) | ((attribut & 15) << 4);
SetConsoleTextAttribute(hConOut, attribut);
attribute = ((attribute >> 4) & 15) | ((attribute & 15) << 4);
SetConsoleTextAttribute(hConOut, attribute);
return;

case 'J':
Expand Down Expand Up @@ -1885,7 +1885,7 @@ inline void refreshMultiLine(struct linenoiseState *l) {
int rows = (pcolwid+colpos+l->cols-1)/l->cols; /* rows used by current buf. */
int rpos = (pcolwid+l->oldcolpos+l->cols)/l->cols; /* cursor relative row. */
int rpos2; /* rpos after refresh. */
int col; /* colum position, zero-based. */
int col; /* column position, zero-based. */
int old_rows = (int)l->maxrows;
int fd = l->ofd, j;
std::string ab;
Expand Down Expand Up @@ -1933,7 +1933,7 @@ inline void refreshMultiLine(struct linenoiseState *l) {
/* Move cursor to right position. */
rpos2 = (pcolwid+colpos2+l->cols)/l->cols; /* current cursor relative row. */

/* Go up till we reach the expected positon. */
/* Go up till we reach the expected position. */
if (rows-rpos2 > 0) {
snprintf(seq,64,"\x1b[%dA", rows-rpos2);
ab += seq;
Expand Down Expand Up @@ -2071,7 +2071,7 @@ inline void linenoiseEditBackspace(struct linenoiseState *l) {
}
}

/* Delete the previosu word, maintaining the cursor at the start of the
/* Delete the previous word, maintaining the cursor at the start of the
* current word. */
inline void linenoiseEditDeletePrevWord(struct linenoiseState *l) {
int old_pos = l->pos;
Expand Down

0 comments on commit 4cd89ad

Please sign in to comment.