File: vim_manager.h

package info (click to toggle)
codelite 14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 112,816 kB
  • sloc: cpp: 483,662; ansic: 150,144; php: 9,569; lex: 4,186; python: 3,417; yacc: 2,820; sh: 1,147; makefile: 52; xml: 13
file content (75 lines) | stat: -rw-r--r-- 1,938 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef __VIM_MANAGER_H__
#define __VIM_MANAGER_H__

#include <wx/stc/stc.h>
#include "vimCommands.h"
#include "ieditor.h"
#include "event_notifier.h"
#include "macros.h"
#include "imanager.h"
#include "globals.h"
#include "codelite_events.h"
#include <wx/kbdstate.h>
#include "VimSettings.h"
/*Experimental*/
#include <list>

/**
 * @brief This Class is used to intercet the key event end rederect them
 * to perform vi-key-bindings.
 */

class VimManager : public wxEvtHandler
{

public:
    /*ctr-distr ... */
    VimManager(IManager* manager, VimSettings& settings);
    virtual ~VimManager();
    void SettingsUpdated();

protected:
    void OnEditorChanged(wxCommandEvent& event);
    void OnEditorClosing(wxCommandEvent& event);
    void OnWorkspaceClosing(wxCommandEvent& event);
    void OnAllEditorsClosing(wxCommandEvent& event);
    void OnCharEvt(wxKeyEvent& event);
    void OnKeyDown(wxKeyEvent& event);
    wxString get_current_word();
    void DoCleanup(bool unbind = true);
    void DoBindEditor(IEditor* editor);
    void setUpVimBar();
    void setUpVimBarPos();
    // Internals
    void CloseCurrentEditor();
    void SaveCurrentEditor();

    void UpdateOldEditorState();
    void SaveOldEditorState();
    void DeleteClosedEditorState();
    void DeleteAllEditorState();

    void updateCarret();
    void updateMessageModus();
    void updateVimMessage();
    
private:
    wxStatusBar* status_vim;
    VimSettings& m_settings;
    IEditor* m_editor;
    wxStyledTextCtrl* m_ctrl;
    VimCommand m_currentCommand; /*!< command currenly */
    VimCommand m_lastCommand;    /*!< last command performed */
    wxString m_tmpBuf;           /*!< tmporary buffer (of inserted text) */
    IManager* m_mgr;
    int m_caretInsertStyle;
    int m_caretBlockStyle;
    std::vector<VimBaseCommand*> m_editorStates;
	
    void IssueCommand();
    void updateView();
    void RepeatCommand();
};

#endif // __VIM_MANAGER_H__