gpt4 book ai didi

c# - scintilla.NET 书签 API

转载 作者:太空宇宙 更新时间:2023-11-03 16:18:57 24 4
gpt4 key购买 nike

如何使用书签并在其中导航而不迷失在索引中?!

这是书签代码片段:

private void btnBM(object sender, EventArgs e)
{
Line currentLine = scintilla1.Lines.Current;
if (scintilla1.Markers.GetMarkerMask(currentLine) == 0)
{
currentLine.AddMarker(0);
}
else
{
currentLine.DeleteMarker(0);
}
}

我想清除上一个指标,并在下一个书签上放置一个指标,也向下滚动以专注于下一个我试过:

      scintilla1.Indicators[2].Search(scintilla1.GetRange(),scintilla1.GetRange(scintilla1.CurrentPos)).ClearIndicator(2);
Range R;
R = scintilla1.Markers.FindPreviousMarker().Range; <-- Causes crashes bcoz of index
scintilla1.Indicators[2].Style = IndicatorStyle.Box;
scintilla1.Indicators[2].Color = Color.DarkGoldenrod;
R.SetIndicator(2);

最佳答案

我是这样做的,代码如下:

   private void button20_Click_1(object sender, EventArgs e)
{
scintilla1.GetRange().ClearIndicator(2);
scintilla1.Indicators[2].Style = IndicatorStyle.Box;
scintilla1.Indicators[2].Color = Color.Cyan;
try
{
Line next = scintilla1.Markers.FindNextMarker(); //replace with previous to get the previous on the control bookmark

scintilla1.Caret.Position = next.EndPosition;
next.Range.SetIndicator(2);
scintilla1.Caret.Goto(next.EndPosition);
scintilla1.Focus();
}
catch (Exception ex)
{
MessageBox.Show("No more marks.. " + ex.Message);
}
}

关于c# - scintilla.NET 书签 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14717383/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com