Jan 28, 2025
- Experimental change: The value
-1 - (the byte position of the cursor)
is now given as the second parameter instead of-1
when calling theFindAllStringIndex
method of thePattern
field in the syntax highlighting structure.
Jan 23, 2025
- Improved processing time when the syntax highlighting evaluation function is slow by reducing the number of its calls
Jan 22, 2025
- Made the following changes for go-multiline-ny:
- Added a hook:
Editor.AfterCommand
, which is called after executing commands. - Exported previously unexported types and functions: NewEscapeSequenceId, EscapeSequenceId, HighlightToColoring, HighlightColorSequence, and ColorInterface.
- Added a hook:
Jan 18, 2025
- Fixed a panic in the syntax highlighting code when Japanese characters were entered using go-readline-skk.
- Deprecated the
GetKey
function. - Unexported the
GetKeys
andGetRawKey
functions.
Jan 12, 2025
- Introduced a new interface for syntax highlighting.
- Pattern specifies the range to which the highlight is applied. A
regexp.Regexp
is acceptable, but any type is sufficient as long as it hasFindAllStringIndex(string, int) [][]int
. Sequence
specifies the escape sequence to apply to thePattern
parts.DefaultColor
specifies the sequence used for parts where no highlight is applied.ResetColor
specifies the sequence used when completing the output of the input text.- The existing syntax highlighting interface,
Coloring
, is planned to be deprecated.
- Pattern specifies the range to which the highlight is applied. A
editor := &readline.Editor{
// :
Highlight: []readline.Highlight{
{Pattern: regexp.MustCompile("&"), Sequence: "\x1B[33;49;22m"},
{Pattern: regexp.MustCompile(`"[^"]*"`), Sequence: "\x1B[35;49;22m"},
{Pattern: regexp.MustCompile(`%[^%]*%`), Sequence: "\x1B[36;49;1m"},
{Pattern: regexp.MustCompile("\u3000"), Sequence: "\x1B[37;41;22m"},
},
ResetColor: "\x1B[0m",
DefaultColor: "\x1B[33;49;1m",
}
Jan 7, 2025
- Adjusted: Avoided double nesting of
bufio.Writer
. - Fixed: default color setting was incorrectly set to bold. #8
Thanks to @brammeleman
Nov 20, 2024
- Fix: in incremental search on UNIX-like platforms, Backspace-key
\x7F
did not work to remove the previous character (though Ctrl-H worked)
Nov 8, 2024
- Fix: some text was missing when pasting multi-lines using the terminal feature of Linux Desktop (for hymkor/go-multiline-ny v0.16.2)
Nov 4, 2024
- Enable to replace the function to predict (
(*Editor) Predictor = ...
)
Oct 6, 2024
- Implement the prediction like PowerShell 7
It is enabled with setting the escape sequences at starting and ending for drawing predicted text
editor := &readline.Editor{
PredictColor: [...]string{"\x1B[3;22;34m", "\x1B[23;39m"},
}
Oct 2, 2024
- Enable to replace the function to calcurate the width of Zero-Width-Join-Sequence for WindowsTerminal 1.22 (SetZWJSWidthGetter)
Jun 16, 2024
- Ctrl-P/N: save the modified entry when switching history, and restore when switching again, until Enter is pressed
Apr 21, 2024
Apr 17, 2024
- Add constant: keys.ShiftTAB = "\x1B[Z"
- Simplify the terminal interface and implements (Compatibility around
ITty
is broken)
Feb 29, 2024
- "keys": Key name constants are now untyped (originally
keys.Code
)
Feb 27, 2024
- "completion": Append the value of CmdCompletion.Postfix or CmdCompletionOrList.Postfix instead of one space when there is only one candidate. (The default value is empty string)
Oct 08, 2023
- Fix: the color can not be changed where the charactor is not simple codepoint such as ZERO WIDTH JOIN SEQUENCE, VARIATION SELECTOR SEQUENCE...
Oct 06, 2023
- Just changed the version to v1.0.0
Oct 02, 2023
- Fix: Coloring.Next(CursorPositionDummyRune) was not called when the cursor is at the end of the string
- Add
(ColorSequence) Chain
that joins two instances ofColorSequence
Oct 01, 2023
- Implement
(ColorSequence) Add
Coloring.Next
recieves CursorPositionDummyRune(U+E000) on the cursor position now
Sep 29, 2023
- Remove the deprecated fields, methods and functions for v1.0.0
KeyGoFuncT
. UseGoCommand
insteadmoji.GetCharWidth
GetFunc
. Usenameutils.GetFunc
instead(*Editor) LineFeed
. use(*Editor) LineFeedWriter
instead(*Editor) Prompt
. use(*Editor) PromptWriter
instead(*Editor) GetBindKey
(*KeyMap) BindKeyFunc
. Usenameutils.BindKeyFunc()
instead(*KeyMap) BindKeyClosure
(*KeyMap) GetBindKey
(*KeyMap) BindKeySymbol
. Usenameutils.BindKeySymbol
instead
Sep 13, 2023
- Publish the function GetKey(tty)
- The parameter tty is expected to be set to a type of 'go-tty.TTY' or a compatible type. It must have methods: Raw(), ReadRune(), and Buffered().
- Set
Deprecated
comment on the fieldEditor.Prompt
Oct 28, 2023
- Even if
(*Editor) PromptWriter
outputsCtrl-H
orESC]...\007
, count the width of the prompt correctly now - Implement
(*Buffer) RepaintLastLine()
that outputs the last line of the prompt and user input-text. It outputs prompt in which\n
are replaced to\r
.
Jul 29, 2023
- Fix the literals that should be written as
\x
were0x
on keys/code.go - Fix cursor wouldn't appear on startup when called with cursor off
May 28, 2023
- Add new method:
(*KeyMap) Lookup
May 19, 2023
- Tab characters can now be represented by a few spaces up to every fourth position instead of ^I
May 16, 2023
- Add new method:
(*Editor) Init
- It replaces nil fields to default values.
When we refer Editor's fields before calling
(*Editor) Readline
, we have to call(*Editor) Init
explicitly.
- It replaces nil fields to default values.
When we refer Editor's fields before calling
May 15, 2023
- Fix: completion.File failed when the path did not contain a directory
May 15, 2023
- CmdCompletion and CmdCompletionOrList narrows down candidates now. So Completion interface side does not have to do
- Completion.List can now be omitted by setting basenames to nil
- completion.File: Fixed: filename completion did not match anyone when ./ is included in the path because the filepath package removes ./ in the path.
May 13, 2023
- Reimported an improved subset of nyagos completion as a subpackage
completion
- Rewrite
examples/example2.go
to use the sub-packagecompletion
- Add a field LineFeedWriter.
May 12, 2023
- Change the global sync.Mutex variable to a field in an
Editor
instance. In a command bound to a key, it was imposible to create a newEditor
instance and call(*Editor) ReadLine
. - Rename
(*Editor) loolup(KEY)
to look up a command mapped to a KEY from both instance's table and global table toLookUp
(exposed) (KeyMap) BindKey(KEY,nil)
now removes the function assigned to KEY- Implement
(c Cell) String
that behaves equivalently tob:=&strings.Builder{};c.Moji.WriteTo(b);b.String()
(*Buffer) GetKey
now calls(*Buffer).Out.Flush
, so the user no longer needs to callflush
explicitly.
May 8, 2023
- Reduced memory allocation counts for functions
StringToMoji
andGetStringWidth
- Implement a method
MojiCountInString
that counts the number ofMoji
in a string
May 7, 2023
- (#5) Fix Coloring is wrong on teraterm connecting to Ubuntu at executing
make demo
May 6, 2023
- Update go-tty to v0.0.5 for hymkor/go-multiline-ny#1
May 5, 2023
(*Editor)
: Add an new fieldPromptWriter func(io.Writer)(int,error)
May 1, 2023
- Remove
(*Buffer) Write
- Hide
(*Buffer) RefreshColor()
- Sub package:
tty10
: fix goroutine leak - Add type:
AnonymousCommand
andSelfInserter
Apr 28, 2023
- Create sub-package:
keys
that defines key codes - Rename
KeyGoFuncT
toGoCommand
- Rename
KeyFuncT
toCommand
- Hide
GetKey(ITty)
- Remove Key name constants:
K_mmmm
. Usekeys.*
- Remove Command name constants:
F_mmmm
. Use(Command) String()
method - Remove
(Result) String()
Apr 26, 2023
- Remove the fork version of go-tty and use the original one v0.0.4.
Because Windows Terminal's bug was fixed that is the reason to fork.
Test:- ① OK: CIRCLE DIGIT ONE: U+2460
- 👨🌾 OK: FARMER: MAN(U+1F468)+ZERO WIDTH JOINER(U+200D)+EAR OF RICE(U+1F33E)
- 邊󠄄 OK: KANJI with VARIATION SELECTOR(U+908A U+E0104)
- Add internal switch to use "golang.org/x/term" instead of "go-tty". Currently go-tty is used.
- Add internal switch to use "golang.org/x/text/width" instead of "go-runewidth". Currently go-runewidth is used.
- Remove the variable SurrogatePairOk. Use functions EnableSurrogatePair() and IsSurrogatePairEnabled()
- Remove the function NewDefaultTty(). Use golang.org/x/term or go-tty
Apr 14, 2023 ( Used in nyagos-4.4.13_2 )
- Fix: some constants for color were broken at v0.10.0
Apr 13, 2023
- Change type
Coloring
interface- Init and Next() returns ColorSequence(int64) instead of int32
- It can output
ESC[0m
now
Apr 10, 2023
- Fix: a trash text 'm' was printed when
Coloring.Init()
/Next()
returns 0
Apr 9, 2023
- Rename:
_Cell
(unexported type) toCell
(exported). A instance of Cell contains a set of code points (=Moji
) and color information (unexported) for one gryph. - Rename:
string2moji
(unexported function) toStringToMoji
(exported) that converts string to an array ofMoji
. A instance ofMoji
contains code points for one gryph.
Apr 2, 2023
- Fix: imcompatibility on v0.8.4
Restore the removed method(*KeyMap)GetBindKey(string)
because v0.8.4 failed to link on nyagos
Mar 25, 2023
- Fix: GetBindkey returned nil when key is in default state
Sep 24, 2022 ( Used in nyagos-4.4.13_0 )
- Sample color: vimbatch: change foreground color
ESC[37m
toESC[39m
Aug 12, 2022
- Reset color before printing the first character
Jun 25, 2022
- Fix: On Ctrl-E typed, sometimes non-space character remains on the cursor.
Apr 29, 2022
- Enable surrogate-pair on WezTerm
- Enable surrogate-pair, ZWJ,and VS on Contour Terminal
- Do not use BACKSPACE(
\b
) as output
Feb 26, 2022
- Coloring.Init() has to return default colors (This interface's compatibility is broken)
- Use
ESC[49m
(default bgcolor) instead ofESC[40m
Dec 29, 2021
- (#2,#3) Add flag: Editor.HistoryCycling
- Color: support Multi SelectGraphcReition Parameters (on v0.6.2)
- Implement short function SGR1,SGR2,SGR3,SGR4 for color setting
Thanks to @ram-on
Dec 10, 2021
- Support color.
Sep 12, 2021
- Change owner: zetamatta to nyaosorg
Aug 27, 2021
- (nyagos-412) The widths of Box Drawing (U+2500-257F) were incorrect on the legacy terminals (on not Winows Terminal in Windows10)
for East Asian Ambiguous Character ・ Issue #412 ・ zetamatta/nyagos
Jul 5, 2021
- Support Mathematical Bold Capital (U+1D400 - U+1D7FF) on the Windows Terminal
May 3, 2021
- Disable the surrogate-pair in the terminal of VisualStudioCode because it is not supported. This problem surfaces when we start VSCode from the WindowsTerminal.
Apr 14, 2021
- Support Emoji Moifier Sequence (skin tone) : something with 🏻(U+1F3FB)~ 🏿(U+1F3FF)
Apr 14, 2021
- Fix the problem the keyup code is entered which was pressed before calling .ReadLine method
Apr 14, 2021
- Support RAINBOW FLAG (U+1F3F3 U+200D U+1F308 🏳🌈)
Apr 14, 2021
- WAVING WHITE FLAG and its variations (U+1F3F3 & U+1F3F3 U+FE0F / 🏳 & 🏳️)
Apr 14, 2021
- Support REGIONAL INDICATOR (U+1F1E6 "🇦"..U+1F1FF "🇿" )
Feb 27, 2021
- Support editing COMBINING ENCLOSING KEYCAP after Variation Selector (#️⃣) in WindowsTerminal
Feb 27, 2021
Variation Selector Sequence can include ZeroWidthJoinerSequence for Emoji:WOMAN FACEPALMING
Feb 27, 2021
Fix: the view was broken when ANYONE + C-b + MANFARMER(or any ZeroWidthJoin Sequence) not via clipboard
Feb 17, 2021
Fix: CIRCLED DIGITS (e.g. ①) could not be input in WindowsTerminal 1.5
Feb 14, 2021
- include forked go-tty into internal directory
Feb 14, 2021
- Use the forked version of go-tty permanetly
Feb 11, 2021
- temporaly replace go-tty with forked version to support emoji in WindowsTerminal 1.5
- #1 Support Alt-/ key bind
Thanks to @masamitsu-murase
Jan 11, 2021
Support Variation Selectors
See also
Dec 13, 2020
Fix for 入力した文字がプロンプトにめり込む状態で CTRL+W で文字を消していくと Panic をおこして nyagos が落ちます ・ Issue #396 ・ zetamatta/nyagos
Nov 20, 2020
Use go-tty includingthe patch on Fix: the first key after terminal-window activated was input twice. by zetamatta ・ Pull Request #40 ・ mattn/go-tty
Nov 15, 2020
- Temporarily replace mattn/go-tty by zetamatta/go-tty for nyaosorg/nyagos#393
Nov 14, 2020
- Ctrl-Y: trim the last CRLF on pasting
Oct 23, 2020
- Incremental Search: compare case-insensitively
Oct 9, 2020
- Fix the cursor position broken on the unicode VARIATION SELECTOR-1..16
Oct 6, 2020
Support Zero-Width-Join Sequence.
Sep 29, 2020
Refer to https://github.com/mattn/go-tty/commit/b0f19ff1ae2faa49f3be9c0f304009b2cde03b97
Sep 27, 2020
Refer zetamatta/go-tty (fork of mattn/go-tty on Sep.22,2020 ) ( Revert to v0.1.5 )
Sep 27, 2020
Remove go-tty-fork2290922's go.mod / go.sum
Sep 27, 2020
Add TreatAmbiguousWidthAsNarrow And IsSurrogatePairOk again.
Sep 27, 2020
Embed fork of go-tty
Sep 23, 2020
Regard Ambiguous width character as 1 cell on Windows Terminal
Sep 23, 2020
Support surrogat pair
Sep 22, 2020
Use zetamatta/go-tty instead of mattn/go-tty temporary
May 24, 2020
Fix width of '<7F>' (when Ctrl-V and Ctrl-H are typed)
May 24, 2020
Support SurrogatePaired Letter on WindowsTerminal
Mar 21, 2020
Copy from github.com/zetamatta/nyagos/readline