static public int[] LinesWithMarker(this ScintillaGateway document, int marker)
        {
            Application.DoEvents();

            int mask   = 1 << marker;
            var result = new List <int>();

            // int line = -1;
            // while (-1 != (line = document.MarkerNext(++line, mask)))
            //     result.Add(line);

            for (int line = 0; line < document.GetLineCount(); line++)
            {
                var markers = document.HasMarker(line);
                if ((markers & mask) != 0)
                {
                    result.Add(line);
                }
            }

            return(result.ToArray());
        }
Exemple #2
0
        static public int[] LinesWithMarker(this ScintillaGateway document, int marker)
        {
            Application.DoEvents();

            int mask   = 1 << marker;
            var result = new List <int>();

            // ideal solution but for unknown reason MarkerNext does not work reliably.
            // So resorting to line by line inefficient iterations.
            // int line = -1;
            // while (-1 != (line = document.MarkerNext(++line, mask)))
            //     result.Add(line);

            for (int line = 0; line < document.GetLineCount(); line++)
            {
                var markers = document.HasMarker(line);
                if ((markers & mask) != 0)
                {
                    result.Add(line);
                }
            }

            return(result.ToArray());
        }