diff options
author | Dexter Chua <dalcde@yahoo.com.hk> | 2015-05-26 13:29:36 +0100 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2015-05-29 14:19:23 +0200 |
commit | 263b2084530d9e79574274273e49a04102214bdb (patch) | |
tree | 2b1374c1304294da287a6057d66359c81eb68ed3 /gtkdoc-fixxref.in | |
parent | 257affe63dd0ec260d18620edffdf6a3b8f2ad04 (diff) | |
download | gtk-doc-263b2084530d9e79574274273e49a04102214bdb.tar.gz |
fixxref: strip common indent when highlighting with vim
This is implemented for highlighting with highlight or source-highlight
but not when highlighting with vim. The exact same change is copied to
the HighlightSourceVim funcion
https://bugzilla.gnome.org/show_bug.cgi?id=749901
Diffstat (limited to 'gtkdoc-fixxref.in')
-rwxr-xr-x | gtkdoc-fixxref.in | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gtkdoc-fixxref.in b/gtkdoc-fixxref.in index b033a79..a6256dd 100755 --- a/gtkdoc-fixxref.in +++ b/gtkdoc-fixxref.in @@ -450,8 +450,11 @@ sub HighlightSourceVim { my ($type, $source) = @_; # chop of leading and trailing empty lines - $source =~ s/^[\s\n]+//gs; + $source =~ s/^\s*\n+//gs; $source =~ s/[\s\n]+$//gs; + # cut common indent + $source =~ m/^(\s*)/; + $source =~ s/^$1//gms; # avoid double entity replacement $source =~ s/</</g; $source =~ s/>/>/g; |