Skip to content

Commit

Permalink
Fix typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jan 5, 2024
1 parent 632a09e commit 202464d
Show file tree
Hide file tree
Showing 38 changed files with 106 additions and 106 deletions.
2 changes: 1 addition & 1 deletion build/mingw/build.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@ECHO OFF
@rem used for GitHub Actions
@rem need adjust path for MSYS2, mingw64, mingw32 and llvm-mingw for local use.
@rem adjust path for MSYS2, mingw64, mingw32 and llvm-mingw for local use.

SETLOCAL ENABLEEXTENSIONS
CD /D %~dp0
Expand Down
8 changes: 4 additions & 4 deletions metapath/src/Helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2224,8 +2224,8 @@ UINT_PTR CALLBACK OpenSaveFileDlgHookProc(HWND hwnd, UINT umsg, WPARAM wParam, L
// me a line if you use them!
//
// 1.0 29.06.2000 Initial version
// 1.1 01.07.2000 The window retains it's place in the Z-order of windows
// when minimized/hidden. This means that when restored/shown, it doen't
// 1.1 01.07.2000 The window retains its place in the Z-order of windows
// when minimized/hidden. This means that when restored/shown, it doesn't
// always appear as the foreground window unless we call SetForegroundWindow
//
// Copyright 2000 Matthew Ellis <[email protected]>
Expand Down Expand Up @@ -2279,7 +2279,7 @@ static void GetTrayWndRect(LPRECT lpTrayRect) {
appBarData.cbSize = sizeof(appBarData);
if (SHAppBarMessage(ABM_GETTASKBARPOS, &appBarData)) {
// We know the edge the taskbar is connected to, so guess the rect of the
// system tray. Use various fudge factor to make it look good
// system tray. Use various fudge factors to make it look good
switch (appBarData.uEdge) {
case ABE_LEFT:
case ABE_RIGHT:
Expand Down Expand Up @@ -2311,7 +2311,7 @@ static void GetTrayWndRect(LPRECT lpTrayRect) {
// on the 3rd party shell's Shell_TrayWnd doing the same, in fact, we can't
// rely on it being any size. The best we can do is just blindly use the
// window rect, perhaps limiting the width and height to, say 150 square.
// Note that if the 3rd party shell supports the same configuraion as
// Note that if the 3rd party shell supports the same configuration as
// explorer (the icons hosted in NotifyTrayWnd, which is a child window of
// Shell_TrayWnd), we would already have caught it above
hShellTrayWnd = FindWindowEx(NULL, NULL, L"Shell_TrayWnd", NULL);
Expand Down
6 changes: 3 additions & 3 deletions scintilla/include/LaTeXInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern "C" {
#endif

// most system already has an easy way to input Emoji, disable this to reduce binary size.
#define NP2_ENABLE_LATEX_LIKE_EMOJI_INPUT 0
#define NP2_ENABLE_LATEX_LIKE_EMOJI_INPUT 1

//++Autogenerated -- start of section automatically generated
// LaTeX input sequences based on Julia version 1.10.0 (Monday 25 December 2023),
Expand Down Expand Up @@ -56,9 +56,9 @@ extern const char * const EmojiInputSequenceString;
/*!
* @brief Get Unicode UTF-16 characters for LaTeX or Emoji input sequence.
* example: \sum to U+2211 ∑, \:smile: to U+1F604 😄 and \gvertneqq to U+2269 + U+FE00 ≩︀.
* @param sequence The input sequence withou the prefix '\'.
* @param sequence The input sequence without the prefix '\'.
* sequence[0] == ':' indicates Emoji, the suffix ':' is optional (but must be counted into length when included).
* @param length Length for the input sequence withou the prefix '\'.
* @param length Length for the input sequence without the prefix '\'.
* @return Returns the corresponding Unicode characters or zero when the input sequence is not found.
*/
uint32_t GetLaTeXInputUnicodeCharacter(const char *sequence, size_t length);
Expand Down
4 changes: 2 additions & 2 deletions scintilla/include/SciLexer.iface
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ val SCE_LISP_KEYWORD=
#val SCE_FORTH_STRING=10
#val SCE_FORTH_LOCALE=11
# Lexical states for SCLEX_MATLAB
lex MatLab=SCLEX_MATLAB SCE_MAT_
lex Matlab=SCLEX_MATLAB SCE_MAT_
val SCE_MAT_DEFAULT=
val SCE_MAT_COMMENT=
val SCE_MAT_COMMENTBLOCK=
Expand Down Expand Up @@ -1241,7 +1241,7 @@ val SCE_YAML_DOCUMENT=20
#val SCE_ERLANG_MODULES=23
#val SCE_ERLANG_MODULES_ATT=24
#val SCE_ERLANG_UNKNOWN=31
# Lexical states for SCLEX_OCTAVE are identical to MatLab
# Lexical states for SCLEX_OCTAVE are identical to Matlab
#lex Octave=SCLEX_OCTAVE SCE_MAT_
# Lexical states for SCLEX_MSSQL
#lex MSSQL=SCLEX_MSSQL SCE_MSSQL_
Expand Down
6 changes: 3 additions & 3 deletions scintilla/include/Scintilla.iface
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## First line may be used for shbang
## First line may be used for shebang

## This file defines the interface to Scintilla

## Copyright 2000-2003 by Neil Hodgson <[email protected]>
## The License.txt file describes the conditions under which this software may be distributed.

## A line starting with ## is a pure comment and should be stripped by readers.
## A line starting with #! is for future shbang use
## A line starting with #! is for future shebang use
## A line starting with # followed by a space is a documentation comment and refers
## to the next feature definition.

Expand Down Expand Up @@ -2331,7 +2331,7 @@ enu CaretPolicy=CARET_
# often dependent on that line.
val CARET_SLOP=0x01
# If CARET_STRICT is set, the policy is enforced... strictly.
# The caret is centred on the display if slop is not set,
# The caret is centered on the display if slop is not set,
# and cannot go in the UZ if slop is set.
val CARET_STRICT=0x04
# If CARET_JUMPS is set, the display is moved more energetically
Expand Down
2 changes: 1 addition & 1 deletion scintilla/include/ScintillaTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ inline ModificationFlags &operator|=(ModificationFlags &self, ModificationFlags
return self;
}

// Functions to manipulate fields from a Update
// Functions to manipulate fields from an Update

constexpr Update operator|(Update a, Update b) noexcept {
return static_cast<Update>(static_cast<int>(a) | static_cast<int>(b));
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexers/LexAsm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ constexpr bool IsAsmNumber(int ch, int chPrev) noexcept {
"Directives",
"Directive operands",
"Extended instructions",
"Directives for foldig start",
"Directives for fold start",
"Directives for fold end",
"GNU Assembler directives ",
0
Expand Down
18 changes: 9 additions & 9 deletions scintilla/lexers/LexAutoIt3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool GetSendKey(const char *szLine, char *szKey) noexcept {
} else if (nFlag && (cTemp != '}')) {
// Save second portion into var...
szSpecial[nSpecPos++] = cTemp;
// check if Second portion is all numbers for repeat fuction
// check if Second portion is all numbers for repeat function
if (!IsADigit(cTemp)) {
nSpecNum = false;
}
Expand All @@ -117,7 +117,7 @@ bool GetSendKey(const char *szLine, char *szKey) noexcept {

}

// Routine to check the last "none comment" character on a line to see if its a continuation
// Routine to check the last "none comment" character on a line to see if it's a continuation
bool IsContinuationLine(LexAccessor &styler, Sci_Line szLine) noexcept {
const Sci_Position nsPos = styler.LineStart(szLine);
Sci_Position nePos = styler.LineStart(szLine + 1) - 2;
Expand Down Expand Up @@ -229,7 +229,7 @@ void ColouriseAU3Doc(Sci_PositionU startPos, Sci_Position length, int initStyle,
}
case SCE_AU3_OPERATOR:
{
// check if its a COMobject
// check if it's a COMobject
if (sc.chPrev == '.' && IsAu3WordChar(sc.ch)) {
sc.SetState(SCE_AU3_COMOBJ);
} else {
Expand Down Expand Up @@ -335,7 +335,7 @@ void ColouriseAU3Doc(Sci_PositionU startPos, Sci_Position length, int initStyle,
}
case SCE_AU3_VARIABLE:
{
// Check if its a COMObject
// Check if it's a COMObject
if (sc.ch == '.' && !IsADigit(sc.chNext)) {
sc.SetState(SCE_AU3_OPERATOR);
} else if (!IsAu3WordChar(sc.ch)) {
Expand Down Expand Up @@ -384,7 +384,7 @@ void ColouriseAU3Doc(Sci_PositionU startPos, Sci_Position length, int initStyle,
if (GetSendKey(s, sk)) {
sc.ChangeState(SCE_AU3_STRING);
}
// if single char between {?} then its ok as sendkey for a single character
// if single char between {?} then it's ok as sendkey for a single character
else if (sk[0] != '\0' && sk[1] == '\0') {
sc.ChangeState(SCE_AU3_SENT);
}
Expand Down Expand Up @@ -414,7 +414,7 @@ void ColouriseAU3Doc(Sci_PositionU startPos, Sci_Position length, int initStyle,
sc.ChangeState(SCE_AU3_STRING);
sc.SetState(SCE_AU3_STRING);
}
// If invalid character found then assume its a regular string
// If invalid character found then assume it's a regular string
if (nState == 0) {
sc.ChangeState(SCE_AU3_STRING);
sc.SetState(SCE_AU3_STRING);
Expand Down Expand Up @@ -522,7 +522,7 @@ void ColouriseAU3Doc(Sci_PositionU startPos, Sci_Position length, int initStyle,
if (GetSendKey(s_save, sk)) {
sc.ChangeState(SCE_AU3_STRING);
}
// if single char between {?} then its ok as sendkey for a single character
// if single char between {?} then it's ok as sendkey for a single character
else if (sk[0] != '\0' && sk[1] == '\0') {
sc.ChangeState(SCE_AU3_SENT);
}
Expand Down Expand Up @@ -596,7 +596,7 @@ void FoldAU3Doc(Sci_PositionU startPos, Sci_Position length, int, LexerWordList,
char chPrev = ' ';
while (startPos < endPos) {
const char ch = styler[startPos];
// get the syle for the current character neede to check in comment
// get the style for the current character need to check in comment
const int stylech = styler.StyleAt(startPos);
// get first word for the line for indent check max 9 characters
if (FirstWordStart && (!(FirstWordEnd))) {
Expand Down Expand Up @@ -652,7 +652,7 @@ void FoldAU3Doc(Sci_PositionU startPos, Sci_Position length, int, LexerWordList,
if (szKeywordlen > 0 && (!(chPrev == '_')) &&
((!(IsStreamCommentStyle(style)) || foldInComment))) {
szKeyword[szKeywordlen] = '\0';
// only fold "if" last keyword is "then" (else its a one line if)
// only fold "if" last keyword is "then" (else it's a one line if)
if (StrEqual(szKeyword, "if") && ThenFoundLast) {
levelNext++;
}
Expand Down
8 changes: 4 additions & 4 deletions scintilla/lexers/LexCPP.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Notepad2.
// See License.txt for details about distribution and modification.
//! Lexer for C/C++, Rescouce Script, Objective C/C++, IDL/ODL
//! Lexer for C/C++, Resource Script, Objective C/C++, IDL/ODL

#include <cassert>
#include <cstring>
Expand All @@ -25,7 +25,7 @@ using namespace Lexilla;
namespace {

#define LEX_CPP 0 // C/C++
#define LEX_RC 1 // Resouce Script
#define LEX_RC 1 // Resource Script
#define LEX_OBJC 2 // Objective C/C++

struct EscapeSequence {
Expand Down Expand Up @@ -170,7 +170,7 @@ void ColouriseCppDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
while (sc.More()) {

if (sc.atLineStart) {
// Reset states to begining of colourise so no surprises
// Reset states to beginning of colourise so no surprises
// if different sets of lines lexed.
visibleChars = 0;
docTagType = 0;
Expand Down Expand Up @@ -935,7 +935,7 @@ void FoldCppDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, Lexe
}

if (style == SCE_C_OPERATOR && !(IsCppInDefine(styler, i))) {
// maybe failed in multi-line define section, MFC's afx.h is a example
// maybe failed in multi-line define section, MFC's afx.h is an example
if (ch == '{' && !(lineCurrent > 0 && visibleChars == 0 && IsOpenBraceLine(styler, lineCurrent))) {
levelNext++;
} else if (ch == '}') {
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexers/LexHTML.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ void ColouriseHyperTextDoc(Sci_PositionU startPos, Sci_Position length, int init
continue;
}

// decide what is the current state to print (depending of the script tag)
// decide what is the current state to print (depending on the script tag)
StateToPrint = statePrintForState(state, inScriptType);

// handle script folding
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexers/LexPerl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ void ColourisePerlDoc(Sci_PositionU startPos, Sci_Position length, int initStyle

// Backtrack to beginning of style if required...
// If in a long distance lexical state, backtrack to find quote characters.
// Includes strings (may be multi-line), numbers (additional state), format
// Includes strings (maybe multi-line), numbers (additional state), format
// bodies, as well as POD sections.
if (initStyle == SCE_PL_HERE_Q
|| initStyle == SCE_PL_HERE_QQ
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexlib/DocUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ constexpr size_t maxHtmlVoidTagLen = CStrLen("basefont");
constexpr const char *htmlVoidTagList =
// void elements
" area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr "
// end tag may omittd
// end tag can be omitted
" p ";

// based on CommonMark Spec 6.6 Raw HTML
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexlib/WordList.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ bool WordList::InListAbbreviated(const char *s, const char marker) const noexcep
return false;
}

/** similar to InListAbbreviated, but word s can be a abridged version of a keyword.
/** similar to InListAbbreviated, but word s can be an abridged version of a keyword.
* eg. the keyword is defined as "after.~:". This means the word must have a prefix (begins with) of
* "after." and suffix (ends with) of ":" to be a keyword, Hence "after.field:" , "after.form.item:" are valid.
* Similarly "~.is.valid" keyword is suffix only... hence "field.is.valid" , "form.is.valid" are valid.
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexlib/WordList.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class WordList final {
//--Autogenerated -- end of section automatically generated

private:
// Each word contains at least one character - a empty word acts as sentinel at the end.
// Each word contains at least one character - an empty word acts as sentinel at the end.
char **words = nullptr;
char *list = nullptr;
//range_t len = 0;
Expand Down
4 changes: 2 additions & 2 deletions scintilla/scripts/Face.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def ReadFromFile(self, name):
"Category": currentCategory, "Comment": currentComment
}
if currentCategory != 'Deprecated' and value in self.values:
raise Exception("Duplicate value " + value + " " + name + " on line:" + str(lineno))
raise Exception(f"Duplicate value {value} {name} on line: {lineno}")
self.values[value] = 1
self.order.append(name)
currentComment = []
Expand All @@ -116,7 +116,7 @@ def ReadFromFile(self, name):
"Category": currentCategory, "Comment": currentComment
}
if value in self.events:
raise Exception("Duplicate event " + value + " " + name + " on line:" + str(lineno))
raise Exception(f"Duplicate event {value} {name} on line: {lineno}")
self.events[value] = 1
self.order.append(name)
elif featureType == "cat":
Expand Down
6 changes: 3 additions & 3 deletions scintilla/scripts/FileGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def UpdateLineInFile(path, linePrefix, lineReplace):
UpdateFile(path, contents)

def ReadFileAsList(path):
"""Read all the lnes in the file and return as a list of strings without line ends.
"""Read all the lines in the file and return as a list of strings without line ends.
"""
with open(path, "r", encoding="utf-8") as f:
return [line.rstrip('\n') for line in f]
Expand Down Expand Up @@ -229,9 +229,9 @@ def FindSectionInList(lines, markers):
state = 3
# Check that section was found
if start < 0:
raise Exception("Could not find start marker(s) |" + markers[0] + "|" + markers[1] + "|")
raise Exception(f"Could not find start marker(s) | {markers[0]} | {markers[1]} |")
if end < 0:
raise Exception("Could not find end marker " + markers[2])
raise Exception(f"Could not find end marker {markers[2]}")
return slice(start, end)

def ReplaceREInFile(path, match, replace, count=1):
Expand Down
44 changes: 22 additions & 22 deletions scintilla/scripts/GenerateGraphemeBreak.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ def buildGraphemeClusterBoundary():
current = GraphemeBreakProperty(j)
print('same row and column:', prev.name, current.name)

def findLongestCharacterSquence(path):
longestSquenceCount = 0
longestSquenceBytes = 0
def findLongestCharacterSequence(path):
longestSequenceCount = 0
longestSequenceBytes = 0
version, propertyList = readUnicodePropertyFile(path)
for codeList in propertyList.values():
for squence in codeList:
character = ''.join(chr(code) for code in squence)
assert len(squence) == len(character)
longestSquenceCount = max(longestSquenceCount, len(squence))
longestSquenceBytes = max(longestSquenceBytes, len(character.encode('utf-8')))
for sequence in codeList:
character = ''.join(chr(code) for code in sequence)
assert len(sequence) == len(character)
longestSequenceCount = max(longestSequenceCount, len(sequence))
longestSequenceBytes = max(longestSequenceBytes, len(character.encode('utf-8')))

print(path, 'longest character squence:', longestSquenceCount, longestSquenceBytes)
return longestSquenceCount, longestSquenceBytes
print(path, 'longest character sequence:', longestSequenceCount, longestSequenceBytes)
return longestSequenceCount, longestSequenceBytes

def testGraphemeBreak(path, graphemeBreakTable):
opportunity = '×÷'
Expand All @@ -103,21 +103,21 @@ def testGraphemeBreak(path, graphemeBreakTable):
if not line or line[0] == '#':
continue

squence = line.split('#', 2)[0].split()
sequence = line.split('#', 2)[0].split()
# break at the start and end of text
assert squence[0] == allow, (lineno, squence)
assert squence[-1] == allow, (lineno, squence)
for index in range(1, len(squence) - 2, 2):
ch = squence[index]
offcial = squence[index + 1]
chNext = squence[index + 2]
assert sequence[0] == allow, (lineno, sequence)
assert sequence[-1] == allow, (lineno, sequence)
for index in range(1, len(sequence) - 2, 2):
ch = sequence[index]
official = sequence[index + 1]
chNext = sequence[index + 2]
prop = GraphemeBreakProperty(graphemeBreakTable[int(ch, 16)])
propNext = GraphemeBreakProperty(graphemeBreakTable[int(chNext, 16)])
value = opportunity[(graphemeClusterBoundary[prop] >> propNext) & 1]
totalCount += 1
if value != offcial:
if value != official:
failCount += 1
print(f'test fail on line {lineno}: {ch} {offcial} {chNext} => {prop.name} {value} {propNext.name}')
print(f'test fail on line {lineno}: {ch} {official} {chNext} => {prop.name} {value} {propNext.name}')
print(f'{path} total test: {totalCount}, failed test: {failCount}')

def updateGraphemeBreakTable(headerFile, sourceFile):
Expand All @@ -135,7 +135,7 @@ def updateGraphemeBreakTable(headerFile, sourceFile):

# https://www.unicode.org/emoji/charts/full-emoji-modifiers.html
# https://www.unicode.org/Public/emoji/latest/emoji-zwj-sequences.txt
longestSquenceCount, longestSquenceBytes = findLongestCharacterSquence('emoji-zwj-sequences.txt')
longestSequenceCount, longestSequenceBytes = findLongestCharacterSequence('emoji-zwj-sequences.txt')
buildGraphemeClusterBoundary()

valueMap = {
Expand All @@ -157,8 +157,8 @@ def updateGraphemeBreakTable(headerFile, sourceFile):

output.append('')
output.append(f'constexpr int maxUnicodeGraphemeBreakCharacter = {hex(len(graphemeBreakTable))};')
output.append(f'constexpr int longestUnicodeCharacterSquenceCount = {longestSquenceCount};')
output.append(f'constexpr int longestUnicodeCharacterSquenceBytes = {longestSquenceBytes};')
output.append(f'constexpr int longestUnicodeCharacterSequenceCount = {longestSequenceCount};')
output.append(f'constexpr int longestUnicodeCharacterSequenceBytes = {longestSequenceBytes};')

output.append('')
output.append('constexpr uint16_t graphemeClusterBoundary[] = {')
Expand Down
Loading

0 comments on commit 202464d

Please sign in to comment.