rc modeline: fix error trying to write readonly global variable
When running modeline-parse on this file: # kakoune: filetype=ledger:indentwidth=4 I get this error from dash (and a similar one from bash): sh: 53: readonly: key: is read only This is because the readonly variable "key" is used elsewhere, both times as global. Fix this by making both variables local. While at it, remove an unused variable. Fixes #4478
This commit is contained in:
parent
287217b987
commit
62bd1af3f0
|
@ -16,9 +16,8 @@ define-command -hidden modeline-parse-impl %{
|
||||||
|
|
||||||
# Translate a vim option into the corresponding kakoune one
|
# Translate a vim option into the corresponding kakoune one
|
||||||
translate_opt_vim() {
|
translate_opt_vim() {
|
||||||
key="$1"
|
local key="$1"
|
||||||
value="$2"
|
local value="$2"
|
||||||
tr=""
|
|
||||||
|
|
||||||
case "${key}" in
|
case "${key}" in
|
||||||
so|scrolloff)
|
so|scrolloff)
|
||||||
|
@ -60,8 +59,8 @@ define-command -hidden modeline-parse-impl %{
|
||||||
|
|
||||||
# Pass a few whitelisted options to kakoune directly
|
# Pass a few whitelisted options to kakoune directly
|
||||||
translate_opt_kakoune() {
|
translate_opt_kakoune() {
|
||||||
readonly key="$1"
|
local readonly key="$1"
|
||||||
readonly value="$2"
|
local readonly value="$2"
|
||||||
|
|
||||||
case "${key}" in
|
case "${key}" in
|
||||||
scrolloff|tabstop|indentwidth|autowrap_column|eolformat|filetype|BOM|spell_lang);;
|
scrolloff|tabstop|indentwidth|autowrap_column|eolformat|filetype|BOM|spell_lang);;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user