XVimProject / XVim

Xcode plugin for Vim keybindings
MIT License
5.16k stars 596 forks source link

Review new command line implementation #173

Closed JugglerShu closed 12 years ago

JugglerShu commented 12 years ago

@tomlu , @dojoteef

I have just added new command line implementation in "ChangeCommandLine" branch. One command line view is shared by several editor view. This is kind of trial and currently it works fine.

I want you to review it.

The reason why I did this is just to make XVim looks fine. Command line view in each view is a little annoying for me. I think current view looks better than before.

The current problem is that one XVimWindow is shared by several DVTSourceTextView. XVimWindow is handling key events from multiple source views. This breaks 1 to 1 corresponding between them.

I'm going to make XVimEditorView which corresponds to DVTSourceTextView and make it have some properties(attributes) of DVTSourceTextView's additional information we want to keep with it.

So when firstResponder is changed the contents of status view will change (Currently there is no line or column number in status bar but we will make it ).

And also currentHandler should also be reset to normal evaluator when firstResponder is changed.

If you have any issues let me know especaily problems with keystroke handling and recordings.

Thanks

tomlu commented 12 years ago

Hi Shu, great work!

Issues I'm seeing at the moment are:

Vim uses two horizontal lines for its command line and one for its status bar. I think we could probably get away with using one horizontal line for the command line. All the information we're currently presenting (statusString, staticString, error, argumentString) can be fit into a single line. We currently don't present any status bar information, but as you say we will make it so.

I think I'll also implement guioptions to hide the scroll bars, since the horizontal scrollbar has reappeared.

JugglerShu commented 12 years ago

About status line :

I'm also thinking about where to put status line. What I'm thinking is current approach is not bad. ( I mean sharing one status line by multiple editors ) This depends on how they use status line. In Vim(gVim) status line is used as border between files and show some information. I do not customize the status line so what I see in status line is filename and insertion point and the position ratio.

Since Xcode has border between ediors we do not need it and filenames are shown upper area of each area. What we can show (as meaningful information) in status line by default is insertion point and position ratio. And these information are not necessary when its not active view I think.

If we really want to imitate Vim we need status line in each editors but as total user interface in Xcode current approach is also one option.

I'm not heavy Vim user so I do not know if this is good idea for all the vim users.

tomlu commented 12 years ago

A single status bar might look a little weird when you have vertical and horizontal splits, but it would probably work ok. Maybe try it in Vim and see how it works there?

In general I would like it if we could make the editor area as close to Vim as possible. In the end I would like fully-fledged commands for splitting and closing windows, moving the cursor between them, opening files in windows, and in general get rid of stuff like the scroll bars, ruler and everything else that just takes up space and is distracting.

JugglerShu commented 12 years ago

OK I understand what you are thinking. Thats more than what I first thought how XVim to be.

So I'm going to make status line per editor.

Maybe we can get rid of a bar at the top of editors( let us make guioptions for this too).

tomlu commented 12 years ago

I'll add it to my guioptions task. It will have to be an extension since I don't think Vim has anything that corresponds to it.

While I am at it I might look at customising the size of the left-hand side bar. If we put the line number in the status bar, we don't need line numbers. The only thing left that the bar is used for is breakpoints, which it seems oversized for.

tomlu commented 12 years ago

Fixed issues:

New issues:

tomlu commented 12 years ago

Verified fixed:

New issues:

JugglerShu commented 12 years ago

Thanks OK I'll add argumet area at the right side of the command line

tomlu commented 12 years ago

Cool, all fixed, great work!

In Vim the argument string is left aligned with a fixed length (that's how I implemented it for the old command line - I just gave it a fixed size). But I don't think that's a huge deal.

JugglerShu commented 12 years ago

OK. Ill merge it

tomlu commented 12 years ago

So I've been using the new command line for a day now and it looks really good. Closing.

dojoteef commented 12 years ago

Sorry, I've been a little busy lately so I haven't been keeping up. I just pulled the latest and the new command line and status are awesome! Great job!

JugglerShu commented 12 years ago

Thanks. If you are busy do not worry about this project. Just reviewing or using it is also really big help.

dojoteef commented 12 years ago

I enjoy working on it, so that's not a problem.