Allow custom extensions when editing (for easier syntax highlighting) (#1139)

* Create tests and steps for temporary filename suffix
* Have temporary filename suffix be -{template_filename} or .jrnl
* Finalize extension_editor_file
* Make suffix local variable in get_text_from_editor
This commit is contained in:
Karim Rahal 2021-01-02 23:23:15 +02:00 committed by GitHub
parent c47c1e209e
commit e9fd5cdc0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 1 deletions

View file

@ -44,3 +44,13 @@ Feature: Journals iteracting with the file system in a way that users can see
And we change directory to "features"
And we run "jrnl -n 1"
Then the output should contain "hello world"
Scenario: the temporary filename suffix should default to ".jrnl"
Given we use the config "editor.yaml"
When we run "jrnl --edit"
Then the temporary filename suffix should be ".jrnl"
Scenario: the temporary filename suffix should be "-{template_filename}"
Given we use the config "editor_markdown_extension.yaml"
When we run "jrnl --edit"
Then the temporary filename suffix should be "-extension.md"