diff options
| author | Igor Ramazanov <igor.ramazanov@protonmail.com> | 2025-02-12 23:46:00 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-12 23:46:00 +0000 |
| commit | b548d7c2b9c0e90249e956bbfdd78ff5fad3c2d5 (patch) | |
| tree | 097a077c569078e372abd6ddf596e56cf143c7ef | |
| parent | ce4dc805e375dbd8c0477ad5005c2110f83de2aa (diff) | |
| parent | 0a4bea856fe6ddd6420d6d7141b20eed8fe0bd25 (diff) | |
Merge branch 'mawww:master' into contrib/gendocs.sh
| -rw-r--r-- | README.asciidoc | 8 | ||||
| -rw-r--r-- | doc/pages/changelog.asciidoc | 6 | ||||
| -rw-r--r-- | doc/pages/commands.asciidoc | 3 | ||||
| -rw-r--r-- | doc/pages/keys.asciidoc | 7 | ||||
| -rw-r--r-- | rc/filetype/fennel.kak | 4 | ||||
| -rw-r--r-- | rc/filetype/forth.kak | 19 | ||||
| -rw-r--r-- | rc/filetype/wren.kak | 154 | ||||
| -rw-r--r-- | rc/tools/comment.kak | 5 | ||||
| -rw-r--r-- | rc/tools/git.kak | 16 | ||||
| -rw-r--r-- | src/commands.cc | 5 | ||||
| -rw-r--r-- | src/input_handler.cc | 8 | ||||
| -rw-r--r-- | src/main.cc | 3 | ||||
| -rw-r--r-- | src/register_manager.cc | 17 | ||||
| -rw-r--r-- | src/register_manager.hh | 7 | ||||
| -rw-r--r-- | test/tools/git/blame-jump-message/script | 2 |
15 files changed, 242 insertions, 22 deletions
diff --git a/README.asciidoc b/README.asciidoc index b10c3151..0989e33b 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -312,6 +312,14 @@ nix-env -iA nixpkgs.kakoune -------------------------------- ==== +[TIP] +.pkgsrc (NetBSD, SmartOS, macOS, Linux, etc) +==== +-------------------------------- +pkg_add kakoune +-------------------------------- +==== + Running ~~~~~~~ diff --git a/doc/pages/changelog.asciidoc b/doc/pages/changelog.asciidoc index f443f207..7d92fa42 100644 --- a/doc/pages/changelog.asciidoc +++ b/doc/pages/changelog.asciidoc @@ -6,10 +6,16 @@ released versions. == Development version * Expose env vars that are mentioned in the arguments passed to shell expansions + * Support for colored double underlines + * `git apply` can now operate on selected changes in the current buffer's file (useful for quick (un)staging and reverting) +* `prompt -history-register` switch to specify which register to use for + a prompt history. + + == Kakoune 2024.05.18 * Fixed tests on Alpine Linux and *BSD diff --git a/doc/pages/commands.asciidoc b/doc/pages/commands.asciidoc index 6b5a48e5..b0fb104e 100644 --- a/doc/pages/commands.asciidoc +++ b/doc/pages/commands.asciidoc @@ -319,6 +319,9 @@ but not really useful in that context. will have this command executed whenever the prompt content changes or the prompt is aborted, respectively. + The *-history-register <register-name>* switch selects which register + to use to load and store history for this prompt. + Completion support can be controlled with the same switches provided by the *define-command* command, see <<declaring-new-commands,Declaring new commands>>. diff --git a/doc/pages/keys.asciidoc b/doc/pages/keys.asciidoc index 6c9ace8b..f346887e 100644 --- a/doc/pages/keys.asciidoc +++ b/doc/pages/keys.asciidoc @@ -803,9 +803,10 @@ The following keys are recognized by this mode to help with editing select previous completion candidate *<c-r>*:: - insert then content of the register given by next key, if next key - has the Alt modifier, it will insert all values in the register - joined with spaces, else it will insert the main one + insert the content of the register given by next key, if next key has + the Alt modifier, it will insert all values in the register joined with + spaces, else it will insert the main one. if it has the Control modifier, + it will quote the inserted value(s). *<c-v>*:: insert next keystroke without interpreting it diff --git a/rc/filetype/fennel.kak b/rc/filetype/fennel.kak index 7b82a8e8..f49b2f7b 100644 --- a/rc/filetype/fennel.kak +++ b/rc/filetype/fennel.kak @@ -59,8 +59,8 @@ evaluate-commands %sh{ " } -add-highlighter shared/fennel/code/operator regex (\.|\?\.|\+|\.\.|\^|-|\*|%|/|>|<|>=|<=|=|\.\.\.|:|->|->>|-\?>|-\?>>) 0:operator -add-highlighter shared/fennel/code/value regex \b(false|nil|true|[0-9]+(:?\.[0-9])?(:?[eE]-?[0-9]+)?|0x[0-9a-fA-F])\b 0:value +add-highlighter shared/fennel/code/operator regex (\.|\?\.|\+|\^|-|\*|%|/|>|<|>=|<=|=|not=|:|->|->>|-\?>|-\?>>)\s+|\.\.\.? 0:operator +add-highlighter shared/fennel/code/value regex (\b(false|nil|true)\b|-?\b[0-9][_0-9]*(:?\.[_0-9]+)?(:?[eE]-?[_0-9]+)?|0x[0-9a-fA-F]\b) 0:value add-highlighter shared/fennel/code/function_declaration regex \((?:fn|lambda|λ)\s+([\S]+) 1:function add-highlighter shared/fennel/code/method_call regex (?:\w+|\$[0-9]{0,1}):(\S+)\b 1:function diff --git a/rc/filetype/forth.kak b/rc/filetype/forth.kak new file mode 100644 index 00000000..7ec77d4b --- /dev/null +++ b/rc/filetype/forth.kak @@ -0,0 +1,19 @@ +hook global BufCreate .+\.(fth|4th|fs|forth) %{ + set-option buffer filetype forth +} + +hook global WinSetOption filetype=forth %{ + require-module forth +} + +hook -group forth-highlight global WinSetOption filetype=forth %{ + add-highlighter window/forth ref forth + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/forth } +} + +provide-module forth %{ + +add-highlighter shared/forth regions +add-highlighter shared/forth/comment region '\(' '\)' fill comment + +} diff --git a/rc/filetype/wren.kak b/rc/filetype/wren.kak new file mode 100644 index 00000000..413cc556 --- /dev/null +++ b/rc/filetype/wren.kak @@ -0,0 +1,154 @@ +provide-module -override wren %§ + add-highlighter shared/wren regions + + add-highlighter shared/wren/line_comment region '//' '$' fill comment + add-highlighter shared/wren/block_comment region -recurse '/\*' '/\*' '\*/' fill comment + + add-highlighter shared/wren/raw_string region '"""' '(?<!\\)(?:\\\\)*"""' fill string + + add-highlighter shared/wren/string region '"' '(?<!\\)(\\\\)*"' group + add-highlighter shared/wren/string/ fill string + add-highlighter shared/wren/string/ regex '\\([0"\\%abefnrtv]|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})'0:value + add-highlighter shared/wren/string/ regex '(?<!\\)%\(.*?\)' 0:value + + add-highlighter shared/wren/code default-region group + + add-highlighter shared/wren/code/ regex '(?i)([a-z][\w_]*)\h*(?=[\(\{])' 1:function + add-highlighter shared/wren/code/ regex '(?i)([a-z][\w_]*)=\(.*?\)\h*(?=\{)' 1:function + add-highlighter shared/wren/code/ regex 'class\h+(?i)([a-z][\w_]*)\h*(?=\{)' 1:type + add-highlighter shared/wren/code/ regex 'construct\h+(?i)([a-z][\w_]*)\h*(?=\()' 1:meta + add-highlighter shared/wren/code/ regex 'var\h+(?i)([a-z][\w_]*)' 1:variable + + add-highlighter shared/wren/code/ regex '\b_[\w_]+' 0:variable + + add-highlighter shared/wren/code/ regex '\bimport\b' 0:meta + add-highlighter shared/wren/code/ regex '\b(true|false|null)\b' 0:value + add-highlighter shared/wren/code/ regex '\b(as|break|class|construct|continue|else|for|foreign|if|in|return|static|super|this|var|while)\b' 0:keyword + add-highlighter shared/wren/code/ regex '\b(Bool|Class|Fiber|Fn|List|Map|Null|Num|Object|Range|Sequence|String|System)\b' 0:+b@type + add-highlighter shared/wren/code/ regex '(-|!|~|\*|/|%|\+|\.\.\.?|<<|>>|&{1,2}|\^|\|{1,2}|[<>]=?)|\bis\b|[!=]?=|\?|:)' 0:operator + + add-highlighter shared/wren/code/ regex 'class\h+([A-Za-z][\w_]*)\h+(is\h+[A-Za-z][\w_]*)\h*(?=\{)' 1:type 2:attribute + + add-highlighter shared/wren/code/ regex '\b(?i)-?\d+\b' 0:value + add-highlighter shared/wren/code/ regex '\b-?0x(?i)[\da-f]+\b' 0:value + add-highlighter shared/wren/code/ regex '\b(?i)-?\d+\.\d+\b' 0:value + add-highlighter shared/wren/code/ regex '\b(?i)-?\d+\.\d+e[+-]?\d+\b' 0:value + + add-highlighter shared/wren/code/ regex '^\h*import\h*"(.*?)"' 1:module + + add-highlighter shared/wren/code/ regex '\bFn\.new\h*(?=[\{\(])' 0:+b@value + add-highlighter shared/wren/code/ regex '\bFiber\.new\h*(?=[\{\(])' 0:+b@value + add-highlighter shared/wren/code/ regex '\bFiber\.current\b' 0:+b@value + add-highlighter shared/wren/code/ regex '\bSystem\.clock\b' 0:+b@value + + add-highlighter shared/wren/code/ regex '\bFiber\.(yield|abort|suspend)\h*(?=[\{\(])' 0:+b@function + add-highlighter shared/wren/code/ regex '\bSystem\.((print|write)(All)?)\h*(?=[\{\(])' 0:+b@function + add-highlighter shared/wren/code/ regex '\bSystem\.gc\h*(?=\()' 0:+b@function + + add-highlighter shared/wren/code/ regex '\bList\.filled\h*(?=\()' 0:+b@function + add-highlighter shared/wren/code/ regex '\b(List|Map)\.new\h*(?=\()' 0:+b@value + + add-highlighter shared/wren/code/ regex '\bNum\.fromString\h*(?=\()' 0:+b@function + add-highlighter shared/wren/code/ regex \ + '\bNum\.(infinity|nan|pi|tau|largest|smallest|(min|max)SafeInteger)\b' 0:+b@value + + add-highlighter shared/wren/code/ regex '\bObject\.same\h*(?=\()' 0:+b@function + add-highlighter shared/wren/code/ regex '\bString\.from(Byte|CodePoint)\h*(?=\()' 0:+b@function + + declare-option str-list wren_static_words \ + 'import' 'true' 'false' 'null' 'as' 'break' 'class' 'construct' 'continue' 'else' 'for' 'foreign' 'if' 'in' 'return' 'static' 'super' 'this' \ + 'var' 'while' 'Bool' 'Class' 'Fiber' 'Fn' 'List' 'Map' 'Null' 'Num' 'Object' 'Range' 'Sequence' 'String' 'System' +§ + +hook global BufCreate (.*/)?.*\.wren %{ set-option buffer filetype wren } + +hook -group wren-highlight global WinSetOption filetype=wren %{ + require-module wren + add-highlighter window/wren ref wren + hook -once -always window WinSetOption filetype=.* %{ + remove-highlighter window/wren + } +} + +hook global WinSetOption filetype=wren %{ + require-module wren + + set-option window static_words %opt{wren_static_words} + + hook window ModeChange pop:insert:.* -group wren-trim-indent %{ try %{ execute-keys -draft xs^\h+$<ret>d } } + hook window InsertChar \n -group wren-indent wren-indent-on-new-line + hook window InsertChar \{ -group wren-indent wren-indent-on-opening-curly-brace + hook window InsertChar \} -group wren-indent wren-indent-on-closing-curly-brace + hook window InsertChar \n -group wren-comment-insert wren-insert-comment-on-new-line + hook window InsertChar \n -group wren-closing-delimiter-insert wren-insert-closing-delimiter-on-new-line +} + +define-command -hidden wren-indent-on-new-line %~ + evaluate-commands -draft -itersel %= + # preserve previous line indent + try %{ execute-keys -draft <semicolon>K<a-&> } + # cleanup trailing white spaces on the previous line + try %{ execute-keys -draft kx s \h+$ <ret>d } + try %< + try %{ # line comment + execute-keys -draft kx s ^\h*// <ret> + } catch %{ # block comment + execute-keys -draft <a-?> /\* <ret> <a-K>\*/<ret> + } + > catch %< + # indent after lines with an unclosed { or ( + try %< execute-keys -draft [c[({],[)}] <ret> <a-k> \A[({][^\n]*\n[^\n]*\n?\z <ret> j<a-gt> > + # deindent closing brace(s) when after cursor + try %[ execute-keys -draft x <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> ] + > + = +~ + +define-command -hidden wren-indent-on-opening-curly-brace %[ + # align indent with opening paren when { is entered on a new line after the closing paren + try %[ execute-keys -draft -itersel h<a-F>)M <a-k> \A\(.*\)\h*\n\h*\{\z <ret> s \A|.\z <ret> 1<a-&> ] +] + +define-command -hidden wren-indent-on-closing-curly-brace %[ + # align to opening curly brace when alone on a line + try %[ execute-keys -itersel -draft <a-h><a-k>^\h+\}$<ret>hms\A|.\z<ret>1<a-&> ] +] + +define-command -hidden wren-insert-comment-on-new-line %[ + evaluate-commands -no-hooks -draft -itersel %[ + # copy // comments prefix and following white spaces + try %{ execute-keys -draft <semicolon><c-s>kx s ^\h*\K/{2,}\h* <ret> y<c-o>P<esc> } + ] +] + +define-command -hidden wren-insert-closing-delimiter-on-new-line %[ + evaluate-commands -no-hooks -draft -itersel %[ + # Wisely add '}'. + evaluate-commands -save-regs x %[ + # Save previous line indent in register x. + try %[ execute-keys -draft kxs^\h+<ret>"xy ] catch %[ reg x '' ] + try %[ + # Validate previous line and that it is not closed yet. + execute-keys -draft kx <a-k>^<c-r>x.*\{\h*\(?\h*$<ret> j}iJx <a-K>^<c-r>x\)?\h*\}<ret> + # Insert closing '}'. + execute-keys -draft o<c-r>x}<esc> + # Delete trailing '}' on the line below the '{'. + execute-keys -draft xs\}$<ret>d + ] + ] + + # Wisely add ')'. + evaluate-commands -save-regs x %[ + # Save previous line indent in register x. + try %[ execute-keys -draft kxs^\h+<ret>"xy ] catch %[ reg x '' ] + try %[ + # Validate previous line and that it is not closed yet. + execute-keys -draft kx <a-k>^<c-r>x.*\(\h*$<ret> J}iJx <a-K>^<c-r>x\)<ret> + # Insert closing ')'. + execute-keys -draft o<c-r>x)<esc> + # Delete trailing ')' on the line below the '('. + execute-keys -draft xs\)\h*\}?\h*$<ret>d + ] + ] + ] +] diff --git a/rc/tools/comment.kak b/rc/tools/comment.kak index ae33b82a..23683a3b 100644 --- a/rc/tools/comment.kak +++ b/rc/tools/comment.kak @@ -75,6 +75,11 @@ hook global BufSetOption filetype=(html|xml) %{ set-option buffer comment_block_end '-->' } +hook global BufSetOption filetype=julia %{ + set-option buffer comment_block_begin '#=' + set-option buffer comment_block_end '=#' +} + hook global BufSetOption filetype=(erlang|latex|mercury) %{ set-option buffer comment_line '%' } diff --git a/rc/tools/git.kak b/rc/tools/git.kak index cf2f7319..5b46d2d8 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -308,6 +308,7 @@ define-command -params 1.. \ set-option buffer=$kak_bufname git_blame '' }" | kak -p ${kak_session} if ! stderr=$({ git blame --incremental "$@" <${blame_stdin} | perl -wne ' + BEGIN { use POSIX qw(strftime); sub quote { my $SQ = "'\''"; @@ -341,6 +342,7 @@ define-command -params 1.. \ $raw_blame = ""; $last_sent = $now; } + } $raw_blame .= $_; chomp; if (m/^([0-9a-f]+) ([0-9]+) ([0-9]+) ([0-9]+)/) { @@ -356,7 +358,12 @@ define-command -params 1.. \ $authors{$sha} = substr($_,7); $authors{$sha} = "Not Committed Yet" if $authors{$sha} eq "External file (--contents)"; } - if (m/^author-time ([0-9]*)/) { $dates{$sha} = strftime("%F %T", localtime $1) } + if (m/^author-time ([0-9]*)/) { $author_time = $1; } + if (m/^author-tz ([+-])(\d\d)/) { + my $sign = $1 eq "+" ? "-" : "+"; + local $ENV{"TZ"} = "UTC${sign}$2"; + $dates{$sha} = strftime("%F %T", localtime $author_time); + } END { send_flags(1); }' } 2>&1); then escape2() { printf %s "$*" | sed "s/'/''''/g"; } @@ -683,7 +690,12 @@ define-command -params 1.. \ } if (m/^filename /) { $old_filenames{$sha} = substr($_,9) } if (m/^author /) { $authors{$sha} = substr($_,7) } - if (m/^author-time ([0-9]*)/) { $dates{$sha} = strftime("%F", localtime $1) } + if (m/^author-time ([0-9]*)/) { $author_time = $1; } + if (m/^author-tz ([+-])(\d\d)/) { + my $sign = $1 eq "+" ? "-" : "+"; + local $ENV{"TZ"} = "UTC${sign}$2"; + $dates{$sha} = strftime("%F", localtime $author_time); + } if (m/^summary /) { $summaries{$sha} = substr($_,8) } END { if (@blame_index and not defined $target_in_blame) { diff --git a/src/commands.cc b/src/commands.cc index 0f892004..086097ec 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -2269,6 +2269,7 @@ const CommandDesc prompt_cmd = { { "shell-completion", { {}, "use shell command completion for prompt" } }, { "shell-script-completion", { ArgCompleter{}, "use shell command completion for prompt" } }, { "shell-script-candidates", { ArgCompleter{}, "use shell command completion for prompt" } }, + { "history-register", { ArgCompleter{}, "register to read and store history to, default to '_'"} }, { "on-change", { ArgCompleter{}, "command to execute whenever the prompt changes" } }, { "on-abort", { ArgCompleter{}, "command to execute whenever the prompt is canceled" } } }, ParameterDesc::Flags::None, 2, 2 @@ -2288,9 +2289,11 @@ const CommandDesc prompt_cmd = { const auto flags = parser.get_switch("password") ? PromptFlags::Password : PromptFlags::None; + auto history_register = RegisterManager::parse_register_name(parser.get_switch("history-register").value_or("_")); + context.input_handler().prompt( parser[0], initstr.str(), {}, context.faces()["Prompt"], - flags, '_', std::move(completer), + flags, history_register, std::move(completer), [command, on_change = parser.get_switch("on-change").value_or("").str(), on_abort = parser.get_switch("on-abort").value_or("").str(), diff --git a/src/input_handler.cc b/src/input_handler.cc index 0f2c8987..ea803217 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -764,15 +764,17 @@ public: on_next_key_with_autoinfo(context(), "register", KeymapMode::None, [this](Key key, Context&) { const bool joined = (bool)(key.modifiers & Key::Modifiers::Alt); - key.modifiers &= ~Key::Modifiers::Alt; + const bool quoted = (bool)(key.modifiers & Key::Modifiers::Control); + key.modifiers &= ~(Key::Modifiers::Alt | Key::Modifiers::Control); auto cp = key.codepoint(); if (not cp or key == Key::Escape) return; + auto* quoter = Kakoune::quoter(quoted ? Quoting::Kakoune : Quoting::Raw); m_line_editor.insert( - joined ? join(RegisterManager::instance()[*cp].get(context()), ' ', false) - : context().main_sel_register_value(String{*cp})); + joined ? join(RegisterManager::instance()[*cp].get(context()) | transform(quoter), ' ', false) + : quoter(context().main_sel_register_value(String{*cp}))); display(); m_line_changed = true; diff --git a/src/main.cc b/src/main.cc index ac9af4ca..9f479768 100644 --- a/src/main.cc +++ b/src/main.cc @@ -49,6 +49,7 @@ struct { "» kak_* appearing in shell arguments will be added to the environment\n" "» {+U}double underline{} support\n" "» {+u}git apply{} can stage/revert selected changes to current buffer\n" + "» {+u}prompt -history-register{} switch\n" }, { 20240518, "» Fix tests failing on some platforms\n" @@ -606,7 +607,7 @@ void register_options() " terminal_info_max_width int\n", UserInterface::Options{}); reg.declare_option("modelinefmt", "format string used to generate the modeline", - "%val{bufname} %val{cursor_line}:%val{cursor_char_column} {{context_info}} {{mode_info}} - %val{client}@[%val{session}]"_str); + "%val{bufname} %val{cursor_line}:%val{cursor_char_column} {{busy_indicator}} {{context_info}} {{mode_info}} - %val{client}@[%val{session}]"_str); reg.declare_option("debug", "various debug flags", DebugFlags::None); reg.declare_option("readonly", "prevent buffers from being modified", false); diff --git a/src/register_manager.cc b/src/register_manager.cc index b9d09a52..987849e1 100644 --- a/src/register_manager.cc +++ b/src/register_manager.cc @@ -70,7 +70,7 @@ const String& HistoryRegister::get_main(const Context&, size_t) return m_content.empty() ? String::ms_empty : m_content.front(); } -static const HashMap<StringView, Codepoint> reg_names { +static const HashMap<StringView, char> reg_names { { "slash", '/' }, { "dquote", '"' }, { "pipe", '|' }, @@ -83,18 +83,23 @@ static const HashMap<StringView, Codepoint> reg_names { { "colon", ':' } }; -Register& RegisterManager::operator[](StringView reg) const +char RegisterManager::parse_register_name(StringView reg) { if (reg.length() == 1) - return (*this)[reg[0_byte]]; + return reg[0_byte]; auto it = reg_names.find(reg); if (it == reg_names.end()) throw runtime_error(format("no such register: '{}'", reg)); - return (*this)[it->value]; + return it->value; +} + +Register& RegisterManager::operator[](StringView reg) const +{ + return (*this)[parse_register_name(reg)]; } -Register& RegisterManager::operator[](Codepoint c) const +Register& RegisterManager::operator[](char c) const { c = to_lower(c); auto it = m_registers.find(c); @@ -104,7 +109,7 @@ Register& RegisterManager::operator[](Codepoint c) const return *(it->value); } -void RegisterManager::add_register(Codepoint c, std::unique_ptr<Register> reg) +void RegisterManager::add_register(char c, std::unique_ptr<Register> reg) { auto& reg_ptr = m_registers[c]; kak_assert(not reg_ptr); diff --git a/src/register_manager.hh b/src/register_manager.hh index 9d843eff..6c7cf084 100644 --- a/src/register_manager.hh +++ b/src/register_manager.hh @@ -118,16 +118,17 @@ public: class RegisterManager : public Singleton<RegisterManager> { public: + static char parse_register_name(StringView reg); Register& operator[](StringView reg) const; - Register& operator[](Codepoint c) const; - void add_register(Codepoint c, std::unique_ptr<Register> reg); + Register& operator[](char c) const; + void add_register(char c, std::unique_ptr<Register> reg); CandidateList complete_register_name(StringView prefix, ByteCount cursor_pos) const; auto begin() const { return m_registers.begin(); } auto end() const { return m_registers.end(); } protected: - HashMap<Codepoint, std::unique_ptr<Register>, MemoryDomain::Registers> m_registers; + HashMap<char, std::unique_ptr<Register>, MemoryDomain::Registers> m_registers; }; } diff --git a/test/tools/git/blame-jump-message/script b/test/tools/git/blame-jump-message/script index 92b1f670..daf5e48c 100644 --- a/test/tools/git/blame-jump-message/script +++ b/test/tools/git/blame-jump-message/script @@ -1,5 +1,5 @@ expected_subject=$(cat <<'EOF' -2017-07-14 A U Thor "Don't break on single quotes or unbalanced {" +2017-07-13 A U Thor "Don't break on single quotes or unbalanced {" EOF ) expected_subject_json=\"$(printf '%s' "$expected_subject" | sed 's/"/\\"/g')\" |
