Skip to content

Commit

Permalink
edit: fix definition of "sword" (shell words)
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jan 22, 2021
1 parent 4d3c595 commit f923388
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
4 changes: 2 additions & 2 deletions GNUmakefile
Expand Up @@ -3,9 +3,9 @@
all:
.PHONY: all

# check GNU Makefile
# check GNU Make
ifeq ($(.FEATURES),)
$(error Sorry, please use a newer version of gmake (GNU Makefile).)
$(error Sorry, please use a newer version of gmake (GNU Make).)
endif

# check gawk
Expand Down
9 changes: 5 additions & 4 deletions memo/ChangeLog.md
Expand Up @@ -6,22 +6,23 @@
## New features

- complete/mandb: support mandb in FreeBSD `#D1432` 6c54f79
- decode (`ble-decode-kbd`): support various specifications of key sequences `#D1439` 0000000
- decode (`ble-decode-kbd`): support various specifications of key sequences `#D1439` 0f01cab

## Changes

- syntax: exclude <code>\\ + LF</code> at the word beginning from words (motivated by cmplstofB) `#D1431` 67e62d6
- complete: do not quote `:` and `=` in non-filename completions generated by progcomp (reported by 3ximus) `#D1434` d82535e
- edit: preserve the state of `READLINE_{LINE,POINT,MARK}` `#D1437` 0000000
- edit: preserve the state of `READLINE_{LINE,POINT,MARK}` `#D1437` 8379d4a

## Fixes

- term: fix a bug that VTE based terminals are not recognized `#D1427` 7e16d9d
- complete: fix a problem that candidates are not updated after menu-filter (reported by 3ximus) `#D1428` 98fbc1c
- complete/mandb: fix BS contamination used by nroff to represent bold (reported by rlnore) `#D1429` b5c875a
- edit: work around the wrong job information of Bash in trap handlers (reported by 3ximus) `#D1435` `#D1436` bc4735e
- edit (command-help): work around the Bash bug that tempenv vanishes with `builtin eval` `#D1438` 0000000
- global: suppress missing locale errors `#D1440` 0000000
- edit (command-help): work around the Bash bug that tempenv vanishes with `builtin eval` `#D1438` 8379d4a
- global: suppress missing locale errors (reported by 3ximus) `#D1440` 4d3c595
- edit (sword): fix definition of `sword` (shell words) `#D1441` 0000000

## Internal changes and fixes

Expand Down
19 changes: 19 additions & 0 deletions note.txt
Expand Up @@ -1200,6 +1200,16 @@ bash_tips
ToDo
-------------------------------------------------------------------------------

2021-01-08

* syntax: 算術式の quote が変である

x echo $((a['$hello'])) の $hello は展開対象なのに着色されない。
x ((a["$index"])) がエラー着色になっている
x bash-5.1 からは (()) でも ' は quote ではない。

更に言うと a['...'] の ' は a が連想配列の時には必ずしもエラーではない。

2020-12-19

* bug-bash: jobs in trap handlers
Expand Down Expand Up @@ -3707,6 +3717,15 @@ bash_tips
Done (実装ログ)
-------------------------------------------------------------------------------

2021-01-22

* edit (sword): fix definition of sword [#D1441]
https://github.com/akinomyoga/ble.sh/issues/83#issuecomment-764893198

この質問で具体的に各単語がどのような定義になっているのか説明しようとして
コードを参照した時に気づいた。sed によって & が置換前の文字列に展開されて、
変な事になっていたのが原因。

2021-01-17

* LC_CTYPE の切り替えエラーが出る (reported by 3ximus) [#D1440]
Expand Down
4 changes: 2 additions & 2 deletions src/decode.sh
Expand Up @@ -335,9 +335,9 @@ ble-decode-kbd/.initialize
## キー列を指定します。TYPE はキー列の解釈方法を指定します。
## TYPE の値に応じて VALUE には以下の物を指定します。TYPE の既定値は kbd です。
## kspecs ... kspecs を指定します。
## keyseq ... bash bind の keyseq を指定します
## keys ... キーコードの整数列を指定します
## chars ... 文字コードの整数列を指定します。
## key ... キーコードの整数列を指定します
## keyseq ... bash bind の keyseq を指定します
## raw ... バイト列を直接文字列として指定します。
##
## @var[out] ret
Expand Down
2 changes: 1 addition & 1 deletion src/edit.sh
Expand Up @@ -3966,7 +3966,7 @@ function ble/widget/word.setup-uword {
WSEP="${IFS:-$' \t\n'}"; WSET="^$WSEP"
}
function ble/widget/word.setup-sword {
WSEP=$'|%WSEP%;()<> \t\n'; WSET="^$WSEP"
WSEP=$'|&;()<> \t\n'; WSET="^$WSEP"
}
function ble/widget/word.setup-fword {
WSEP="/${IFS:-$' \t\n'}"; WSET="^$WSEP"
Expand Down

0 comments on commit f923388

Please sign in to comment.