misfo / jim

Vim mode for Ace (Github & Cloud9's editor)
http://misfo.github.com/jim
MIT License
65 stars 3 forks source link

* and # #19

Closed sourrust closed 13 years ago

sourrust commented 13 years ago

Took a stab at issue #16

misfo commented 13 years ago

This is great! Thanks for the pull!

There are a few small tweaks to the commit that I'll mention in the commit. And can you add some tests to the pull? Then I can merge this thing in! Thanks

misfo commented 13 years ago

I added a skeleton of test/ace/search.coffee in c365f9de2feba74cca4c

sourrust commented 13 years ago

Alright, all has been added except for boundaries regex for now.

misfo commented 13 years ago

Thanks. Looks good. I'll merge this in when I'm at a computer

sourrust commented 13 years ago

Actually forgot to compile to javascript on the last commit and * and # matched special characters so a bit of a change.

misfo commented 13 years ago

Is Vim not matching special characters for you? My pretty vanilla MacVim install matches big words (series of Non-blanks) when pressing * or #

On Aug 19, 2011, at 4:09 PM, sourrustreply@reply.github.com wrote:

Actually forgot to compile to javascript on the last commit and * and # matched special characters so a bit of a change.

Reply to this email directly or view it on GitHub: https://github.com/misfo/jim/pull/19#issuecomment-1856663

sourrust commented 13 years ago

If I put my cursor on a special character is skips to the closest word, but if there are no words it matchs the special character. But really if you have a word with a special next to it like word, would what it to include the comma? Btw I'm using MacVim as well and don't think I did anything special for this behavior.

misfo commented 13 years ago

Ok, cool. I'll double check that on mine. I probably am mistaken because that sounds right now that you mention it

On Aug 19, 2011, at 9:47 PM, sourrustreply@reply.github.com wrote:

If I put my cursor on a special character is skips to the closest word, but if there are no words it matchs the special character. But really if you have a word with a special next to it like word, would what it to include the comma? Btw I'm using MacVim as well and don't think I did anything special for this behavior.

Reply to this email directly or view it on GitHub: https://github.com/misfo/jim/pull/19#issuecomment-1858054

misfo commented 13 years ago

I merged created a new branch star-and-pound and merged your first three commits into it. After looking at the Vim documentation, it turns out that the search that Vim makes is either for a keyword (\w) or non-blanks (\S) depending on what's under the cursor and what's after it:

The word used for the
            search is the first of:
                1. the keyword under the cursor |'iskeyword'|
                2. the first keyword after the cursor, in the
                   current line
                3. the non-blank word under the cursor
                4. the first non-blank word after the cursor,
                   in the current line

I added a bunch of failing tests to the branch that test the search logic above. If you wanna do more work on it just checkout that branch. I'll be using those commits either way, so thanks for the pull!