summaryrefslogtreecommitdiff
path: root/gtkdoc-fixxref.in
diff options
context:
space:
mode:
authorDexter Chua <dalcde@yahoo.com.hk>2015-05-26 13:29:36 +0100
committerStefan Sauer <ensonic@users.sf.net>2015-05-29 14:19:23 +0200
commit263b2084530d9e79574274273e49a04102214bdb (patch)
tree2b1374c1304294da287a6057d66359c81eb68ed3 /gtkdoc-fixxref.in
parent257affe63dd0ec260d18620edffdf6a3b8f2ad04 (diff)
downloadgtk-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-xgtkdoc-fixxref.in5
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/&lt;/</g;
$source =~ s/&gt;/>/g;