Exemplo n.º 1
0
        /// <summary>
        /// Create the IVimBuffer with the given set of lines.  Note that we intentionally don't
        /// set the mode to Insert here because the given commands should work irrespective of the 
        /// mode
        /// </summary>
        /// <param name="lines"></param>
        private void Create(params string[] lines)
        {
            _textView = CreateTextView(lines);
            _buffer = Vim.CreateVimBuffer(_textView);
            _globalSettings = _buffer.GlobalSettings;
            _localSettings = _buffer.LocalSettings;

            var operations = CommonOperationsFactory.GetCommonOperations(_buffer.VimBufferData);
            _insertUtilRaw = new InsertUtil(_buffer.VimBufferData, operations);
            _insertUtil = _insertUtilRaw;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create the IVimBuffer with the given set of lines.  Note that we intentionally don't
        /// set the mode to Insert here because the given commands should work irrespective of the 
        /// mode
        /// </summary>
        /// <param name="lines"></param>
        private void Create(params string[] lines)
        {
            _textView = CreateTextView(lines);
            _textBuffer = _textView.TextBuffer;
            _vimBuffer = Vim.CreateVimBuffer(_textView);
            _globalSettings = _vimBuffer.GlobalSettings;
            _localSettings = _vimBuffer.LocalSettings;

            var operations = CommonOperationsFactory.GetCommonOperations(_vimBuffer.VimBufferData);
            _insertUtilRaw = new InsertUtil(_vimBuffer.VimBufferData, operations);
            _insertUtil = _insertUtilRaw;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create the IVimBuffer with the given set of lines.  Note that we intentionally don't
        /// set the mode to Insert here because the given commands should work irrespective of the
        /// mode. There are a few tests that rely on behavior from SelectionChangeTracker so they set
        /// the mode to Insert.
        /// </summary>
        /// <param name="lines"></param>
        protected virtual void Create(params string[] lines)
        {
            _textView       = CreateTextView(lines);
            _textBuffer     = _textView.TextBuffer;
            _vimBuffer      = Vim.CreateVimBuffer(_textView);
            _globalSettings = _vimBuffer.GlobalSettings;
            _localSettings  = _vimBuffer.LocalSettings;

            var operations = CommonOperationsFactory.GetCommonOperations(_vimBuffer.VimBufferData);
            var motionUtil = new MotionUtil(_vimBuffer.VimBufferData, operations);

            _insertUtilRaw = new InsertUtil(_vimBuffer.VimBufferData, motionUtil, operations);
            _insertUtil    = _insertUtilRaw;
        }
Exemplo n.º 4
0
 public static CommandUtil CreateCommandUtil(
     VimBufferData vimBufferData,
     IMotionUtil motionUtil       = null,
     ICommonOperations operations = null,
     IFoldManager foldManager     = null,
     InsertUtil insertUtil        = null)
 {
     motionUtil  = motionUtil ?? new MotionUtil(vimBufferData);
     operations  = operations ?? EditorUtil.FactoryService.CommonOperationsFactory.GetCommonOperations(vimBufferData);
     foldManager = foldManager ?? CreateFoldManager(vimBufferData.TextView, vimBufferData.StatusUtil);
     insertUtil  = insertUtil ?? new InsertUtil(vimBufferData, operations);
     return(new CommandUtil(
                vimBufferData,
                motionUtil,
                operations,
                foldManager,
                insertUtil));
 }
Exemplo n.º 5
0
 internal CommandUtil CreateCommandUtil(
     IVimBufferData vimBufferData,
     IMotionUtil motionUtil       = null,
     ICommonOperations operations = null,
     IFoldManager foldManager     = null,
     InsertUtil insertUtil        = null)
 {
     motionUtil  = motionUtil ?? new MotionUtil(vimBufferData, operations);
     operations  = operations ?? CommonOperationsFactory.GetCommonOperations(vimBufferData);
     foldManager = foldManager ?? VimUtil.CreateFoldManager(vimBufferData.TextView, vimBufferData.StatusUtil);
     insertUtil  = insertUtil ?? new InsertUtil(vimBufferData, operations);
     return(new CommandUtil(
                vimBufferData,
                motionUtil,
                operations,
                foldManager,
                insertUtil,
                _bulkOperations));
 }
Exemplo n.º 6
0
 internal CommandUtil CreateCommandUtil(
     IVimBufferData vimBufferData,
     IMotionUtil motionUtil = null,
     ICommonOperations operations = null,
     IFoldManager foldManager = null,
     InsertUtil insertUtil = null)
 {
     motionUtil = motionUtil ?? new MotionUtil(vimBufferData, operations);
     operations = operations ?? CommonOperationsFactory.GetCommonOperations(vimBufferData);
     foldManager = foldManager ?? VimUtil.CreateFoldManager(vimBufferData.TextView, vimBufferData.StatusUtil);
     insertUtil = insertUtil ?? new InsertUtil(vimBufferData, motionUtil, operations);
     var lineChangeTracker = new LineChangeTracker(vimBufferData);
     return new CommandUtil(
         vimBufferData,
         motionUtil,
         operations,
         foldManager,
         insertUtil,
         _vimEditorHost.BulkOperations,
         MouseDevice,
         lineChangeTracker);
 }
Exemplo n.º 7
0
 internal CommandUtil CreateCommandUtil(
     IVimBufferData vimBufferData,
     IMotionUtil motionUtil = null,
     ICommonOperations operations = null,
     IFoldManager foldManager = null,
     InsertUtil insertUtil = null)
 {
     motionUtil = motionUtil ?? new MotionUtil(vimBufferData, operations);
     operations = operations ?? CommonOperationsFactory.GetCommonOperations(vimBufferData);
     foldManager = foldManager ?? VimUtil.CreateFoldManager(vimBufferData.TextView, vimBufferData.StatusUtil);
     insertUtil = insertUtil ?? new InsertUtil(vimBufferData, operations);
     return new CommandUtil(
         vimBufferData,
         motionUtil,
         operations,
         foldManager,
         insertUtil,
         _bulkOperations);
 }
Exemplo n.º 8
0
        /// <summary>
        /// Create the IVimBuffer with the given set of lines.  Note that we intentionally don't
        /// set the mode to Insert here because the given commands should work irrespective of the 
        /// mode
        /// </summary>
        /// <param name="lines"></param>
        private void Create(params string[] lines)
        {
            _textView = EditorUtil.CreateTextView(lines);
            _buffer = EditorUtil.FactoryService.Vim.CreateVimBuffer(_textView);
            _globalSettings = _buffer.GlobalSettings;
            _localSettings = _buffer.LocalSettings;

            var operations = EditorUtil.FactoryService.CommonOperationsFactory.GetCommonOperations(_buffer.VimBufferData);
            _insertUtilRaw = new InsertUtil(_buffer.VimBufferData, operations);
            _insertUtil = _insertUtilRaw;
        }
Exemplo n.º 9
0
 internal CommandUtil CreateCommandUtil(
     IVimBufferData vimBufferData,
     IMotionUtil motionUtil = null,
     ICommonOperations operations = null,
     IFoldManager foldManager = null,
     InsertUtil insertUtil = null)
 {
     motionUtil = motionUtil ?? new MotionUtil(vimBufferData, operations);
     operations = operations ?? CommonOperationsFactory.GetCommonOperations(vimBufferData);
     foldManager = foldManager ?? VimUtil.CreateFoldManager(vimBufferData.TextView, vimBufferData.StatusUtil);
     insertUtil = insertUtil ?? new InsertUtil(vimBufferData, motionUtil, operations);
     var lineChangeTracker = new LineChangeTracker(vimBufferData);
     return new CommandUtil(
         vimBufferData,
         motionUtil,
         operations,
         foldManager,
         insertUtil,
         _vimEditorHost.BulkOperations,
         MouseDevice,
         lineChangeTracker);
 }