Re: Fixed CSS's class name highlight was broken in some cases

2017-01-13 Fir de Conversatie Ryuichi Hayashida
2017年1月14日土曜日 5時53分05秒 UTC+9 Bram Moolenaar:
> Ryuichi Hayashida wrote:
> 
> > Hi Jules, Bram, and team
> > 
> > I found that highlight of CSS's class names is broken in below cases:
> > 
> > - class name is one character
> > - class name starts with under score
> > 
> > I fixed them. Please find attached css.vim.patch.
> > 
> > Repro: Execute below shell commands
> > 
> > -
> > 
> > $ cat <<-EOS > test.css
> > ._foo {
> >   margin: 0;
> > }
> > 
> > .a {
> >   margin: 0;
> > }
> > EOS
> > 
> > $ vim test.css
> > 
> > -
> 
> I believe a class name can also start with a dash:
> 
> .-foo {
>   margin: 0;
> }
> 
> The suggested pattern is:
> 
> -\=[_a-zA-Z][_a-zA-Z0-9-]*
> 
> -- 
> hundred-and-one symptoms of being an internet addict:
> 266. You hear most of your jokes via e-mail instead of in person.
> 
>  /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
> ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org///
>  \\\help me help AIDS victims -- http://ICCF-Holland.org///

Thank you for your review.
I confirmed that you're correct with CSS spec.

https://www.w3.org/TR/CSS21/grammar.html#scanner

> ident -?{nmstart}{nmchar}*

I fixed my patch and attached it to this mail.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim
index 3dc3f5c..a66cbdc 100644
--- a/runtime/syntax/css.vim
+++ b/runtime/syntax/css.vim
@@ -56,7 +56,7 @@ syn match cssSelectorOp2 "[~|^$*]\?=" contained
 syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
 
 " .class and #id
-syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" contains=cssClassNameDot
+syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot
 syn match cssClassNameDot contained '\.'
 
 try


Fixed CSS's class name highlight was broken in some cases

2017-01-13 Fir de Conversatie Ryuichi Hayashida
Hi Jules, Bram, and team

I found that highlight of CSS's class names is broken in below cases:

- class name is one character
- class name starts with under score

I fixed them. Please find attached css.vim.patch.

Repro: Execute below shell commands

-

$ cat <<-EOS > test.css
._foo {
  margin: 0;
}

.a {
  margin: 0;
}
EOS

$ vim test.css

-

My environment:

- macOS 10.12
- Vim 8.0-114 (MacVim)


Thanks,
Hayashida

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim
index 3dc3f5c..a66cbdc 100644
--- a/runtime/syntax/css.vim
+++ b/runtime/syntax/css.vim
@@ -56,7 +56,7 @@ syn match cssSelectorOp2 "[~|^$*]\?=" contained
 syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
 
 " .class and #id
-syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" contains=cssClassNameDot
+syn match cssClassName "\.[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot
 syn match cssClassNameDot contained '\.'
 
 try


Nested substitute() calls break highlights in Vim script

2017-01-08 Fir de Conversatie Ryuichi Hayashida
Hi Bram and all,

I found that syntax highlight in Vim script is broken in some situation.
When nested substitute() calls are in code, first one is highlighted as 
vimFuncName and second one is highlighted as vimSubst.

How to reproduce this is saving below code as blah.vim and open it in vim with 
:syntax enable.

function! F()
let foo = substitute(substitute('a', 'a', 'b', ''), 'b', 'c', '')
endfunction

substitute() causes this problem but empty() doesn't cause this problem. I'll 
attach a screenshot for this in this mail.
I tried to fix this. But syntax/vim.vim was generated by script and I could not 
find it. So I'm reporting it as issue here.

My environment is

- macOS 10.12
- Vim 8.0 (1-124)
- MacVim on terminal

Regards,
Hayashida

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 7.4.944

2015-11-29 Fir de Conversatie Ryuichi Hayashida
I think assertion message is very important reported when it fails.  Should 
message be customizable as many assertions in other languages?

  assertEqual({exp}, {act} [, {msg}])
  assertFalse({actual} [, {msg}])
  assertTrue({actual} [, {msg}])

This is used as below.

  assertTrue(check_something(label), 'something failed with ' . label)

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Backward reference fails in some cases

2013-10-10 Fir de Conversatie Ryuichi Hayashida
Hello.
I would report a bug of regexp.

* Problem

aba =~# '^\(.\+\).*\1$'

This expression is equivalent to 1 when 'regexpengine' is set to 1.
However, when it is set to 0 or 2, the expression is equivalent to 0.
Backward reference seems to fail.

Note that below expression gets 1 whatever the value of 'regexpengine' is.

aa =~# '^\(.\+\).*\1$'

* Environment
- Vim 7.4-45
- Ubuntu 12.04


Regards,
Hayashida Ryuichi

-- 
-- 
You received this message from the vim_dev maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
vim_dev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.