vim-matchup icon indicating copy to clipboard operation
vim-matchup copied to clipboard

[Feature request] Add support for java language

Open letientai299 opened this issue 8 years ago • 1 comments
trafficstars

Please (or how do I) add support for java keyword language:

  • if/else
  • do/while
  • switch/case/default

letientai299 avatar Nov 13 '17 08:11 letientai299

Like in the SQL case, I cannot think of a way to handle this correctly with the current implementation using b:match_words regular expressions. The reason is there needs to be a definite end word. Sequences of matching words must come as begin:middle*:end, otherwise there is no way to know where to stop searching. Consider:

switch(x) {
  case 1: break;
   switch(x) {
     case 2: break;
     default: break;
   } 
   {  case 3: break;   }     // allowed in C
}

I would somehow have to skip over the nested switch and hit case 3. Thus, this will have to wait until smarter "ending" is implemented. I think it should be possible after making changes intended for python support.

andymass avatar Nov 22 '17 15:11 andymass