From 68485be048772dae6b6ac133efa1eebae4d9d824 Mon Sep 17 00:00:00 2001 From: Mateusz Drewniak Date: Sat, 15 Jul 2023 11:36:41 +0200 Subject: [PATCH] Update the setup-go action in CI --- .github/workflows/test.yml | 4 ++-- CHANGELOG.md | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e71cb7e..d279c86c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: go: ['1.19', '1.20'] steps: - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} id: go @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: '1.20' id: go diff --git a/CHANGELOG.md b/CHANGELOG.md index e0c16452..816fa3ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,17 +29,18 @@ This release aims to make the code a bit cleaner, fix a couple of bugs and provi - `prompt.Lexer`, `prompt.Token`, `prompt.SimpleToken`, `prompt.EagerLexer`, `prompt.LexerFunc` -- new syntax highlighting functionality - `prompt.ExecuteOnEnterCallback` -- new dynamic Enter functionality (decide whether to insert a newline and indent or execute the input) -- `_example/bang-executor` -- a sample program which uses the new `ExecuteOnEnterCallback`. Pressing Enter will insert a newline unless the input ends with an exclamation point `!` (then it gets executed). -- `_example/even-lexer` -- a sample program which shows how to use the new lexer feature. It implements a simple lexer which colours every character with an even index green. +- examples: + - `_example/bang-executor` -- a sample program which uses the new `ExecuteOnEnterCallback`. Pressing Enter will insert a newline unless the input ends with an exclamation point `!` (then it gets executed). + - `_example/even-lexer` -- a sample program which shows how to use the new lexer feature. It implements a simple lexer which colours every character with an even index green. ### Changed - Update Go from 1.16 to 1.19 -- The cursor can move in 2D. +- The cursor can move in 2D (left-right, up-down) - The Up arrow key will jump to the line above if the cursor is beyond the first line, but it will replace the input with the previous history entry if it's on the first line (like in Ruby's irb) - The Down arrow key will jump to the line below if the cursor is before the last line, but it will replace the input with the next history entry if it's on the last line (like in Ruby's irb) - Tab will insert a single indentation level when there are no suggestions -- Shift + Tab will delete a single indentation level when there are no suggestions and the line before the cursors consists only of indentation (spaces) +- Shift + Tab will delete a single indentation level when there are no suggestions and the line before the cursor consists only of indentation (spaces) - Make `Completer` optional when creating a new `prompt.Prompt`. Change the signature of `prompt.New` from `func New(Executor, Completer, ...Option) *Prompt` to `func New(Executor, ...Option) *Prompt` - Make `prefix` optional in `prompt.Input`. Change the signature of `prompt.Input` from `func Input(string, ...Option) string` to `func Input(...Option) string`. - Rename `prompt.ConsoleParser` to `prompt.Reader` and make it embed `io.ReadCloser` @@ -77,9 +78,9 @@ This release aims to make the code a bit cleaner, fix a couple of bugs and provi ### Fixed - Make pasting multiline text work properly -- Make pasting text with tabs work properly (tabs get replaced with spaces) +- Make pasting text with tabs work properly (tabs get replaced with indentation -- spaces) - Introduce `strings.ByteNumber`, `strings.RuneNumber`, `strings.StringWidth` to reduce the ambiguity of when to use which of the three main units used by this library to measure string length and index parts of strings. Several subtle bugs (using the wrong unit) causing panics have been fixed this way. -- Remove a `/dev/tty` leak in `PosixReader` (old `PosixParser`) +- Remove a `/dev/tty` leak in `prompt.PosixReader` (old `prompt.PosixParser`) ### Removed