示例#1
0
文件: GapBuffer.cs 项目: devjerome/3P
 internal Enumerator(GapBuffer <T> buffer)
 {
     _gapBuffer = buffer;
     _index     = 0;
     _version   = _gapBuffer._version;
     _current   = default(T);
 }
示例#2
0
        /// <summary>
        /// Simulates the insertion of the whole text, use this to reset the lines info
        /// (when switching document for instance)
        /// </summary>
        internal void Reset()
        {
            _lastEncoding        = Npp.Encoding;
            _oneByteCharEncoding = _lastEncoding.Equals(Encoding.Default);

            // bypass the hard work for simple encoding
            if (_oneByteCharEncoding)
            {
                return;
            }

            _linesList = new GapBuffer <int> {
                0, 0
            };
            var scn = new SCNotification {
                linesAdded = SciGetLineCount() - 1,
                position   = 0,
                length     = SciGetLength()
            };

            scn.text = Npp.Sci.Send(SciMsg.SCI_GETRANGEPOINTER, new IntPtr(scn.position), new IntPtr(scn.length));
            OnInsertedText(scn);
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance
 /// </summary>
 public DocumentLines()
 {
     _linesList = new GapBuffer <int> {
         0, 0
     };
 }