syntax higlighting sometimes off

6 views
Skip to first unread message

Nathan Huesken

unread,
Oct 2, 2009, 8:15:34 AM10/2/09
to exVim
Hi,

Sometimes (and I am pretty sure this is since I installed exVim) when
I open a hxx file, the syntax highlighting seems to be off. When I
scroll up in the file, it is syntax highlighet up to a certain
point ...

I solve this by turning syntax higlighting off and on again.

Is there a less anoying solution?

Thanks!
Nathan

Nathan Huesken

unread,
Oct 2, 2009, 11:02:06 AM10/2/09
to exVim
I have something to add:

This happend when I use the quickfix window (with :cw, :cn) adter
issuing a :make

Regards,
Nathan

On Oct 2, 2:15 pm, Nathan Huesken <nathan.hues...@googlemail.com>
wrote:

Wu Jie

unread,
Oct 2, 2009, 9:53:17 PM10/2/09
to exVim
strange, I can't reproduce this in my PC. only hxx file have this
problem?
I will try to reproduce it in Linux later.

On Oct 2, 11:02 pm, Nathan Huesken <nathan.hues...@googlemail.com>

Nathan Huesken

unread,
Oct 3, 2009, 6:58:56 AM10/3/09
to exVim
Hmm. I had another look. I can reproduce it like this:
start gvim
open an vimentry file
open a C++ file (hxx, cc ... no matter what the file ending is)
syntax higlighting is only on up to a certain point in the file.

When I open the file directly, without first opening the vimentry,
syntax highlighting works completly!

Regards,
Nathan

Wu Jie

unread,
Oct 3, 2009, 9:35:58 PM10/3/09
to exVim
I doubt it relate with the exact code. Could you provide me the source
code with the syntax highlight problem? I doubt if would relate with
exMacroHighlight.

Can you write

exec 'ExmhHL 0'

in your .vimrc at the beginning, and check those source file? If that
is the problem, I doubt I have to read the source code to find out
which case lead to the syntax error.

On Oct 3, 6:58 pm, Nathan Huesken <nathan.hues...@googlemail.com>

Nathan Huesken

unread,
Oct 4, 2009, 4:22:04 AM10/4/09
to exVim
I am not sure, if I put:

exec 'ExmhHL 0'

into my .vimrc, vim does not like it (not an editor command).
If I do <leader>ad after vim started, the problems go away ...
I am not sure if I can give you the source, if you still need it I can
try to generate an example file.

Regards,
Nathan

Nathan Huesken

unread,
Oct 4, 2009, 5:08:33 AM10/4/09
to exVim
Hi,

OK, here is a example file, where highlighting fails.
The last line, that is correctly highlighted is line 35 ...

#include "svhandler.hxx"
#include <float.h>
#include <vector>
#include <math.h>
#include <assert.h>
#include <boost/iterator/counting_iterator.hpp>

using namespace boost;

using namespace std;

template<class T>
struct Vector
{
Vector()
{
m_features=0;
m_label=0;
}
void cleanup()
{
if(m_features)
delete [] m_features;
m_features=0;
}
int GetLabel()
{return m_label;}
bool Unused()
{return m_features==0;}
void SetData(const vector<T>& data,int label)
{
cleanup();
m_label=label;
m_features=new T[data.size()];
for(int i=0;i<data.size();++i)
m_features[i]=data[i];
}
T* m_features;
int m_label;
};

int main()
{
cout<<"Hello world"<<endl;
}

On Oct 4, 10:22 am, Nathan Huesken <nathan.hues...@googlemail.com>

Wu Jie

unread,
Oct 4, 2009, 10:18:32 PM10/4/09
to exVim
The highlight in my PC is totally correct. And based on the code, I
can see it doesn't relate with exMacroHighlight cause there is no
macro define and macro condition in the code.

I try this in both Linux and Windows PC, and the result still the
same.
Can you remove files in
.vim/after/syntax/

Cause that is the most scripts in exVim to affect syntax highlight of
c/cpp and other language.

After that if the highlight error still exists, try remove
.vim/plugin/exMacroHighlight.vim

This will uninstall the exMacroHighlight plugin. After remove this, it
may show some error message when you start up exVim. Skip that and
check if syntax highlight still be incorrect.


Any progress, let me know.


On Oct 4, 5:08 pm, Nathan Huesken <nathan.hues...@googlemail.com>

Nathan Huesken

unread,
Oct 5, 2009, 9:45:52 AM10/5/09
to exVim
Removing the syntax directory did not help at all.
Removing the exMacroHighlight plugin helped!

Wu Jie

unread,
Oct 6, 2009, 8:28:32 PM10/6/09
to exVim
I test this in Linux, it works with exMacroHighlight.
Did you set something before in exMacroHighlight? you can use \aa to
check the macro highlight settings.

On Oct 5, 9:45 pm, Nathan Huesken <nathan.hues...@googlemail.com>

Nathan Huesken

unread,
Oct 8, 2009, 2:56:33 AM10/8/09
to exVim
Hi,

No, I did not set anything. And when I press \aa, an empty sidebar
opens ...

Georges

unread,
Oct 9, 2009, 9:24:27 AM10/9/09
to exVim
Hi,

I have exactly the same problem. If I open my project.vimentry file
and open a big file from the Project window, the syntax highlighting
is off after a certain point, this is really the case with every long
file. turning syntax highlighting off then on again fixes the problem
for the file but the syntax coloring in the project window is wrong.

<leader>ad solves the problem.

Wu Jie

unread,
Oct 12, 2009, 12:01:17 AM10/12/09
to exVim
Hi,
I will try some way to reproduce, but currently in my Windows and
Linux PC, it all works correctly.
Can you try this in different OS and give some reports ? thanks for
your replay.

Georges

unread,
Oct 16, 2009, 8:40:50 AM10/16/09
to exVim
I'm using it in windows under cygwin, so the UNIX Vim build.
Will try to use it under different OS

Georges

unread,
Oct 20, 2009, 6:11:25 AM10/20/09
to exVim
I tested it on Linux (Fedora 11), and got the same error for the
sample file nathan sent. The error looks like here:
void SetData(const vector<T>& data,int label)
{
cleanup();
m_label=label;
m_features=new T[data.size()];
for(int i=0;i<data.size();++i) <<<<< the 0
m_features[i]=data[i];
}

the 0 is getting interpreted as exElifDisable, so if you change the 0
to 2(or any number different from 0 or 1) for example, everything
works great.
Message has been deleted

Wu Jie

unread,
Oct 21, 2009, 12:32:57 PM10/21/09
to exVim
Aha! I just got the problem.
When I disable the syntax file I write in vimfiles/after/syntax/c.vim,
then everything shows wrong like you describe above. So I doubt you
two never install the exVim/vimfiles/after/syntax directory into the
right place.
Basically it should be in ".vim/after/syntax".
Or may be you have your own vim after directory, which will take over
the one in .vim/after.

Can you check this and tell me the result ??

Georges

unread,
Oct 22, 2009, 12:39:18 PM10/22/09
to exVim
Great one!! yes this was the problem. I have my vim installed in:
/usr/local/share/vim/vim72
I had put the after folder in there so:
/usr/local/share/vim/vim72/after

But it didn't pick it up (why is this btw?) so I had to move it to my
~/.vim/after
Is there any other folder like this that I have to move to ~/.vim?

Thanks,
Georges

Wu Jie

unread,
Oct 22, 2009, 11:07:52 PM10/22/09
to exVim
Ok! I'm happy to here that.
So the problem is in after/syntax there have some definition let the
exMacroHighlight shows normal code correctly, but if this files
missing, those syntax highlight will be NONE. Let's why you loose your
syntax highlight in somewhere.

Basically, the whole content in exDev/vim/vimfiles folder should be
move to your ~/.vim/, and this will be the default in later version of
exVim.

Georges

unread,
Oct 23, 2009, 4:09:06 AM10/23/09
to exVim
What I meant was a more general vim question. shouldn't files place
in /usr/local/share/vim/vim72 be treated exactly the same as the one
in ~/.vim/?
Which is why I was wondering why if I put them in /usr/local/share/vim/
vim72 they didn't get picked up?

Wu Jie

unread,
Oct 25, 2009, 10:18:13 PM10/25/09
to exVim
yeah, I'm curios of this,too. But I don't know why, yet.
I would try the best to seek the answer.
Reply all
Reply to author
Forward
0 new messages