public
Fork of olsonjeffery/boolangstudio
Description: Boo language integration for Visual Studio 2008
Homepage: http://www.codeplex.com/BooLangStudio
Clone URL: git://github.com/jagregory/boolangstudio.git
boolangstudio / Source / BooLangService / HandleSmartIndentAction.cs
100644 34 lines (27 sloc) 0.814 kb
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
using BooLangService;
using Microsoft.VisualStudio.TextManager.Interop;
 
namespace Boo.BooLangService
{
    public class HandleSmartIndentAction
    {
        private readonly IVsTextView view;
        private readonly ILineIndenter indenter;
 
        public HandleSmartIndentAction(ISource source, IVsTextView view)
        {
            this.view = view;
            this.indenter = new LineIndenter(source, view);
        }
 
        public HandleSmartIndentAction(IVsTextView view, ILineIndenter indenter)
        {
            this.view = view;
            this.indenter = indenter;
        }
 
        public bool Execute()
        {
            int line, col;
 
            view.GetCaretPos(out line, out col);
 
            indenter.SetIndentationForNextLine(line);
 
            return false;
        }
    }
}