On Tue, Sep 04, 2012 at 06:14:19PM +0200, Dominique Pellé wrote:
> Hi Simon
>
> I can see why you want to patch this, but I think that the patch should
> not be applied. It's a work around for a bug in Vim. It's also breaking
> indentation when using "set concealllevel=0" or when conceal feature
> is not enabled at compilation time.
>
> It's the same kind of patch that was already rejected. See:
>
> https://groups.google.com/forum/?fromgroups=#!topic/vim_dev/QowVzxfhgbM

Hello Dominique,

Thank you, I didn't know that. I saw a few similar changes in the
past so I thought it was fine.

> There is a patch pending which fixes those alignment issues among other
> problems (whether Vim uses conceal feature or not).

Thanks for pointing me to this patch. It fixes a few tab related
issues I just noticed (and tried to fix - you saved me some time,
thanks).

> The proposed patch has been available for a long time by the way
> without having been integrated in the official Mercurial repository.
> I understand that tests were requested for it, but I don't really see
> how it's possible to test it. Any chance to get it integrated anyway?
> I've been using it for a long time without problem.

I'd really like to get it integrated too, it fixed the issues I
was seeing.

It took me a while, but I created a testcase which checks the
output of Vim running with TERM=builting_dumb and it works fine
for me, but better solutions are welcome.

I'm not sure what's the best way to include it in Vim's testsuite
because, please help me with that part. At the moment I just
added it as test88.sh (see the patch) and updated the Makefile to
run it.

Regards,
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
From f466969557ebde58edd26e6e8a4174ea860f8f22 Mon Sep 17 00:00:00 2001
Message-Id: <f466969557ebde58edd26e6e8a4174ea860f8f22.1346796960.git.si...@ruderich.org>
From: Simon Ruderich <[email protected]>
Date: Wed, 5 Sep 2012 00:11:24 +0200
Subject: [PATCH] testdir: Add test88 to check +conceal with tabulators.

---
 src/testdir/Makefile   |   16 +++++++++++-
 src/testdir/test88-txt |    8 ++++++
 src/testdir/test88.ok  |   34 ++++++++++++++++++++++++++++
 src/testdir/test88.sh  |   58 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 114 insertions(+), 2 deletions(-)
 create mode 100644 src/testdir/test88-txt
 create mode 100644 src/testdir/test88.ok
 create mode 100755 src/testdir/test88.sh

diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 20d9781..52414ce 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -13,7 +13,7 @@ VIMPROG = ../vim
 
 SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test7.out test8.out test9.out test10.out test11.out \
-		test12.out  test13.out test14.out test15.out test17.out \
+		test12.out test13.out test14.out test15.out test17.out \
 		test18.out test19.out test20.out test21.out test22.out \
 		test23.out test24.out test25.out test26.out test27.out \
 		test28.out test29.out test30.out test31.out test32.out \
@@ -27,7 +27,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test69.out test70.out test71.out test72.out test73.out \
 		test74.out test75.out test76.out test77.out test78.out \
 		test79.out test80.out test81.out test82.out test83.out \
-		test84.out test85.out test86.out test87.out
+		test84.out test85.out test86.out test87.out test88.out \
 
 SCRIPTS_GUI = test16.out
 
@@ -60,6 +60,18 @@ test1.out: test1.in
 		echo; exit 1; fi"
 	-rm -rf X* viminfo
 
+test88.out: test88.sh test88-txt
+	-rm -rf $*.failed test.ok test.out X* viminfo
+	cp $*.ok test.ok
+	-./test88.sh $(VIMPROG)
+	@/bin/sh -c "if test -f test.out; then\
+		  if diff test.out $*.ok; \
+		  then mv -f test.out $*.out; \
+		  else echo $* FAILED >>test.log; mv -f test.out $*.failed; \
+		  fi \
+		else echo $* NO OUTPUT >>test.log; \
+		fi"
+
 .in.out:
 	-rm -rf $*.failed test.ok test.out X* viminfo
 	cp $*.ok test.ok
diff --git a/src/testdir/test88-txt b/src/testdir/test88-txt
new file mode 100644
index 0000000..08ef108
--- /dev/null
+++ b/src/testdir/test88-txt
@@ -0,0 +1,8 @@
+.concealed.     text
+|concealed|	text
+
+	.concealed.	text
+	|concealed|	text
+
+.a.	.b.	.c.	.d.
+|a|	|b|	|c|	|d|
diff --git a/src/testdir/test88.ok b/src/testdir/test88.ok
new file mode 100644
index 0000000..691b529
--- /dev/null
+++ b/src/testdir/test88.ok
@@ -0,0 +1,34 @@
+
+[1;1H
+[1;17H
+[1;20H
+[1;1H
+[2;1H
+[2;17H
+[2;20H
+[2;1H
+[3;1H
+[3;1H
+[4;8H
+[4;25H
+[4;28H
+[4;8H
+[5;8H
+[5;25H
+[5;28H
+[5;8H
+[6;1H
+[6;1H
+[7;1H
+[7;9H
+[7;17H
+[7;25H
+[7;27H
+[7;1H
+[8;1H
+[8;9H
+[8;17H
+[8;25H
+[8;26H
+[24;1H       
:q
+[24;1H  
diff --git a/src/testdir/test88.sh b/src/testdir/test88.sh
new file mode 100755
index 0000000..7443d01
--- /dev/null
+++ b/src/testdir/test88.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# Tests for correct display (cursor column position) with +conceal and
+# tabulators.
+
+# VIM - Vi IMproved	by Bram Moolenaar
+#
+# Do ":help uganda"  in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+# See README.txt for an overview of the Vim source code.
+
+
+# Check if +conceal is available.
+"$@" -c 'if has("conceal") | cq | endif' -c ':q!' >/dev/null
+if test $? -eq 0; then
+    cp test.ok test.out
+    exit 0
+fi
+
+
+(
+    # Mark beginning of test. Reduces the size of the diff.
+    echo ':redraw'
+
+    # We should end up in the same column when running these commands on the
+    # two lines.
+    echo -n 'ft'
+    echo -n '$'
+    echo -n '0j'
+    echo -n 'ft'
+    echo -n '$'
+    echo -n '0j0j'
+
+    # Same for next test block.
+    echo -n 'ft'
+    echo -n '$'
+    echo -n '0j'
+    echo -n 'ft'
+    echo -n '$'
+    echo -n '0j0j'
+
+    # And check W with multiple tabs and conceals in a line.
+    echo -n 'WWW'
+    echo -n '$'
+    echo -n '0j'
+    echo -n 'WWW'
+    echo -n '$'
+
+    echo ':q'
+
+) | TERM=builtin_dumb COLUMNS=80 LINES=24 "$@" \
+        -u NONE -U NONE \
+        -c 'set conceallevel=2 concealcursor=nc' \
+        -c 'syntax match test /|/ conceal' \
+        test88-txt \
+        | grep :redraw \
+        | sed '1s/^.*:redraw\r//; s//\n/g' \
+        > test.out
-- 
1.7.7.3

Attachment: pgpebyFBUbYDo.pgp
Description: PGP signature

Raspunde prin e-mail lui