yoshiki / yaml-mode

The emacs major mode for editing files in the YAML data serialization format.
GNU General Public License v3.0
487 stars 132 forks source link

Allow page navigation #110

Closed canatella closed 11 months ago

canatella commented 11 months ago

I have some YAML files which supports multiple documents.

Emacs support navigating between page using C-x [ and C-x ] which maps to backward-page and forward-page. This commit sets page-delimiter to the YAML document delimiter --- to map Emacs notion of page to YAML documents.

syohex commented 11 months ago

The specification says as below.

ns-ns-document-header | ::= | ns-ns-document-start( s-char+ c-ns-directive )*

Shouldn't we consider directives?

canatella commented 11 months ago

Ah yes, didn't catch that. I'll update using "^---\\([ \t].*\\)\n"

canatella commented 11 months ago

Alright, updated the PR, tested against

---

--- %YAML:1.0

...
outside document
--- %YAML:1.0 %FOO:BAR

---  %YAML:1.0  %FOO:BAR