Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G gtksourceview
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gtksourceview
  • Merge requests
  • !292

Adds support for Groff syntax.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Daniel Dias Rodrigues requested to merge nerun/gtksourceview:master into master Oct 17, 2022
  • Overview 3
  • Commits 1
  • Pipelines 4
  • Changes 1

This language-spec was written by Sciancisco in 2020 and was originally available at GitLab and GitHub Gist. I made some small updates to the file, recorded at the beginning of the file as a comment, just below the copyright.

My changes:

  • at <language>
    • name: the "G" of "Groff" was capitalized.
  • at <metadata>
    • mimetypes and globs: completely changed based upon All known MIME types and their filename patterns.
  • at <definitions><context>
    • comment-new and comment-old: the "." (dot) was included as part of the comment. Added "\.".

Known Bugs:

It works fine, but with a very small issue, noticed in bash.1.gz when opened in xed (gedit clone for Cinnamon):

  • starts at line 5932: .B isearch\-terminators (``C\-[C\-J'')
  • ends at line 6744: .B character\-search (C\-])

All the content between lines 5932-6744 are considered escape-bracket-parameter as in gross.lang, line 91:

91 <context id="escape-bracket-parameter" style-ref="escaped-character" class="no-spell-check">
92   <start>\\.[[]</start>
93   <end>[]]</end>
94 </context>

It occurs because in groff, anything between \*[ and ] (this * is also a regex, means any or no one) are readed as an escape sequence (see in GNU Groff).

In above example (bash.1.gz), the \-[ in (``C\-[C\-J'') matches the start of a escape sequence, while the ] in (C\-]) matches the end.

In other words, it's not exactly a bug. And it's very rare to happen. Basically it only occurs in quite complex roff documents.

Conclusion:

It works great in most documents, so I believe it's an excellent inclusion.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: master