Skip to content

Implementing a selections and other things #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

gibiansky
Copy link

This is a pretty big change (almost a rewrite), so no pressure to merge it. Feel free to test it and find edge cases where it doesn't work, in which case I can fix them. (If you use Vundle, you can just use Plugin 'gibiansky/vim-textobj-haskell' to do so.)

@gilligan
Copy link
Owner

There seem to be some issues still:

-- this is a comment
foobar [] = 42
foobar (x:xs) = x 
  1. vih or vah on the first line (comment) select the comment. Correct behavior would be no selection at all. In general leading or trailing comment lines should be ignored and only comments in between statements should be included.
  2. vah on the second line selects the first and second line. Correct behavior would be second and third line.
  3. vah on the third line selects the third line only. Correct behavior would again be to select lines 2-3.
-- this is a comment
foobar :: IO ()
foobar = do
    let x = "test1"
    let y = "test2"

    putStrLn x
    putStrLn y
  1. vah crashes with an index out of bounds exception. It works if I remove the type signature (vih works though).

Can you have a look at those issues ?

@gibiansky
Copy link
Author

Yup, I'll take a look. Although for (1), that is purposeful – I definitely think selecting comments should be possible. There are times when I wish to reformat those! (Such as keeping them within 80 or 100 characters.)

@gilligan
Copy link
Owner

gilligan commented Nov 1, 2014

Adding preliminary support for this was rather quick, did it in the select-a branch. It does need some cleaning up though. Still interested to see a fixed version of your fork though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants