Excerpts from Krzysztof Goj's message of Wed Dec 03 04:31:37 +0100 2008:
> I've done some work on Yi this night. It's divided in 3 'darc sends':
>  - minor_tweaks -- lacking key bindings; One nice patch per feature;
> just commit it

Thanks! Applied.

>  - eol_normal_mode -- Fixes normal mode to work more like Vim's.
>    The only obvious problem with this one big patch is that it fixes
> several things at once.

Indeed prefer more atomic patches. Applied.

>  - enter_autoindent - This one is rather hackish; It makes new lines
> (via enter in insert and 'o'/'O' in normal mode)
>    indented like previous ones. It probably needs more work before
> committing, but i post it here,
>    because I've found it very helpful at dogfooding (using Yi do
> actually develop it).

Not applied, since I would prefer to cleanly offer the option without making
it the default (autoindent).

The first step could be to define it as function that takes the vim keymap
and extend it for autoindentation. This may need for a hook in the
main keymap though.

> It's almost dawn, so it's quite probable that I made lots of stupid
> mistakes; My Yi works better than ever, though.

:)

Here is some reviews.

> Wed Dec  3 04:10:45 CET 2008  Krzysztof Goj <[EMAIL PROTECTED]>
>   * Behaviour at end of line (BIG PATCH)
>    - Doesn't allow to go to EOL in normal mode
>    - Does allow it in other (visual, insert, replace) modes
>    - Corrected D, and '$' command
>    - cursor moves left after leaving insert and replace mode

[...]

> hunk ./Yi/Keymap/Vim.hs 110
>  
>       -- | Replace mode is like insert, except it performs writes, not inserts
>       rep_mode :: VimMode
> -     rep_mode = write (setStatus ("-- REPLACE --", defaultStyle)) >> many 
> rep_char >> leave
> +     rep_mode = write (setStatus ("-- REPLACE --", defaultStyle)) >> many 
> rep_char >> leave >> (write leftB)

Unneeded parens.

> +     vis_move :: VimMode
> +     vis_move = gen_cmd_move >>= write . viMove . snd

For some reasons when I tried to make this change, I
didn't take care of making only one write. This was probably the
performance problem I had.

> hunk ./Yi/Keymap/Vim.hs 125
> -
> +     

Trailing white-spaces

> hunk ./Yi/Keymap/Vim.hs 127
> -     core_vis_mode selectionStyle = do
> -       write $ do withBuffer0 $ setDynamicB $ selectionStyle
> -                  setStatus $ (msg selectionStyle, defaultStyle)
> -       many (cmd_move <|>
> +     core_vis_mode selStyle = do
> +       write $ do withBuffer0 $ setDynamicB $ selStyle
> +                  setStatus $ (msg selStyle, defaultStyle)
> +       many (vis_move <|>

Look at "darcs replace" it would have made the patch clearer.

> +     viMoveToNthEol :: Int -> BufferM ()
> +     viMoveToNthEol n = (replicateM_ n $ moveB Line Forward)

Unneeded parens

[...]

> -         ,(char 'D',      withEditor . cut Exclusive . (Replicate $ Move 
> Line Forward))
> +         ,(char 'D',      withEditor . cut Exclusive . ArbMove . 
> viMoveToNthEol)

I trust you on this.

[...]

> -                 char 'C'     ?>> beginIns self $ cut Exclusive viMoveToEol, 
> -- alias of "c$"
> +                 char 'C'     ?>> beginIns self $ cut Exclusive viMoveToEol, 
> -- alias of "c$" FIXME

Why?

> -ins_mode self = write (setStatus ("-- INSERT --", defaultStyle)) >> many 
> (v_ins_char self <|> kwd_mode) >> leave
> +ins_mode self = write (setStatus ("-- INSERT --", defaultStyle)) >> many 
> (v_ins_char self <|> kwd_mode) >> leave >> (write leftB)

Unneeded parens

* Vim: ctrl+u, ctrl+d scrolling

OK

* Vim visual mode: 's' is synonym to 'c'

OK

* Ctrl+p, Ctrl+n in Ex mode

OK

* Ctrl+h in Ex mode

OK

* Ctrl+h in insert and replace mode; Ctrl+w in replace mode

OK

-- 
Nicolas Pouillard aka Ertai

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to