mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-20 23:37:05 +01:00
Fix to cursor height for wrapped lines
Avoids issue caused by for non diff height styled lines
This commit is contained in:
@@ -269,7 +269,29 @@ var ICEcoder = {
|
||||
}
|
||||
// Set the cursor to text height, not line height
|
||||
setTimeout(function() {
|
||||
thisCM.setOption("cursorHeight",thisCM.defaultTextHeight() / thisCM.lineInfo(thisCM.getCursor().line).handle.height);
|
||||
var paneMatch;
|
||||
|
||||
// Loop through styles to check if we have to adjust cursor height
|
||||
for (var i=0; i<top.ICEcoder.renderLineStyle.length; i++) {
|
||||
|
||||
// We have no matching pane to start with
|
||||
paneMatch = false;
|
||||
|
||||
// Is the pane we need to set the cursor on this pane?
|
||||
if (
|
||||
(top.ICEcoder.renderLineStyle[i][0] != "diff" && cMinstance.indexOf("diff") == -1) ||
|
||||
(top.ICEcoder.renderLineStyle[i][0] == "diff" && cMinstance.indexOf("diff") > -1)
|
||||
)
|
||||
{paneMatch = true;}
|
||||
|
||||
// If the pane matches & also the line we're on is the line we have a style set for, set that cursor height
|
||||
if (paneMatch && thisCM.getCursor().line+1 == top.ICEcoder.renderLineStyle[i][1]) {
|
||||
thisCM.setOption("cursorHeight",thisCM.defaultTextHeight() / thisCM.lineInfo(thisCM.getCursor().line).handle.height);
|
||||
} else {
|
||||
thisCM.setOption("cursorHeight",1);
|
||||
}
|
||||
|
||||
}
|
||||
},0);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user