Repository: sharkdp/bat (language: rust)

Issue:
Name of man pages with dots is not fully highlighted
# Description
Names like `pacman.conf` or `systemd-system.conf` does not get highlighted correctly, only the part after the dot is highlighted.

![image](https://user-images.githubusercontent.com/56427890/104198492-de65c980-5458-11eb-8371-3e4096219b15.png)

Command used to produce the image above:

```bash
MANPAGER="sh -c 'col -bx | bat -l man -p'" man systemd
```

# Expected result
The whole name (e.g: `systemd-system.conf`) is highlighted instead of just the part after the dot.

# Environment
`bat` is installed using the package in Arch official repo.

`info.sh` output:

```
system
------

**$ uname -srm**
Linux 5.9.14-arch1-1 x86_64

**$ lsb_release -a**
LSB Version:	1.4
Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling
Codename:	n/a

bat
---

**$ bat --version**
bat 0.17.1

**$ env**
PAGER=less

bat_config
----------

bat_wrapper
-----------

No wrapper script for 'bat'.

bat_wrapper_function
--------------------

No wrapper function for 'bat'.

No wrapper function for 'cat'.

tool
----

**$ less --version**
less 563 (PCRE regular expressions)
```


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3abfdec70b..4f5d3bd1a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@
 - If plain mode is set and wrap is not explicitly opted in, long lines will no be truncated, see #1426
 - If `PAGER` (but not `BAT_PAGER` or `--pager`) is `more` or `most`, silently use `less` instead to ensure support for colors, see #1063 (@Enselic)
 - If `PAGER` is `bat`, silently use `less` to prevent recursion. For `BAT_PAGER` or `--pager`, exit with error, see #1413 (@Enselic)
+- Manpage highlighting fix, see #1511 (@keith-hall)
 
 ## Other
 
diff --git a/assets/syntaxes/02_Extra/Manpage.sublime-syntax b/assets/syntaxes/02_Extra/Manpage.sublime-syntax
index d92eea227c..b50dc19d92 100644
--- a/assets/syntaxes/02_Extra/Manpage.sublime-syntax
+++ b/assets/syntaxes/02_Extra/Manpage.sublime-syntax
@@ -59,12 +59,19 @@ contexts:
       escape: '(?={{section_heading}})'
 
   function-call:
-    - match: '\b([A-Za-z0-9_\-]+)(\()([^)]*)(\))'
+    - match: '\b([A-Za-z0-9_\-]+\.)?([A-Za-z0-9_\-]+)(\()([^)]*)(\))'
       captures:
         1: entity.name.function.man
-        2: keyword.operator.man
-        3: constant.numeric.man
-        4: keyword.operator.man
+        2: entity.name.function.man
+        3: keyword.operator.man
+        4: constant.numeric.man
+        5: keyword.operator.man
+
+  env-var:
+    - match: '(\$)(?!\d)(\w+)\b'
+      captures:
+        1: punctuation.definition.variable.man
+        2: constant.other.man
 
   options:
     # command-line options like --option=value, --some-flag, or -x
@@ -86,6 +93,7 @@ contexts:
           pop: true
     - include: function-call
     - include: c-code
+    - include: env-var
 
   expect-command-line-option:
     - match: '[A-Za-z0-9-]+'


Test patch:
diff --git a/assets/syntaxes/02_Extra/syntax_test_man.man b/assets/syntaxes/02_Extra/syntax_test_man.man
index ee8bada31e..792c02a0aa 100644
--- a/assets/syntaxes/02_Extra/syntax_test_man.man
+++ b/assets/syntaxes/02_Extra/syntax_test_man.man
@@ -149,3 +149,14 @@ EXAMPLE
            #define POLLIN_SET  (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN |
                                 EPOLLHUP | EPOLLERR)
 #                                                  ^ source.c meta.preprocessor.macro meta.group punctuation.section.group.end
+
+ENVIRONMENT
+       $SYSTEMD_LOG_LEVEL
+#      ^ punctuation.definition.variable
+#       ^^^^^^^^^^^^^^^^^ constant.other
+           systemd reads the log level from this environment variable. This
+           can be overridden with --log-level=.
+
+SEE ALSO
+       The systemd Homepage[11], systemd-system.conf(5), locale.conf(5)
+#                                ^^^^^^^^^^^^^^^^^^^ entity.name.function