mirror of
https://github.com/chylex/IntelliJ-Rainbow-Brackets.git
synced 2025-05-13 00:34:03 +02:00
Initial commit for 2020.2
This commit is contained in:
parent
99095f2f2f
commit
e2c9603c0e
.circleci
build.gradlegradle.propertiessrc/main/kotlin/com/github/izhangzhihao/rainbow/brackets/indents
@ -15,7 +15,7 @@ jobs:
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- 201-dependencies-{{ checksum "build.gradle" }}
|
||||
- 202-dependencies-{{ checksum "build.gradle" }}
|
||||
|
||||
- run: ./gradlew -v
|
||||
|
||||
@ -39,7 +39,7 @@ jobs:
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.gradle
|
||||
key: 201-dependencies-{{ checksum "build.gradle" }}
|
||||
key: 202-dependencies-{{ checksum "build.gradle" }}
|
||||
|
||||
- store_artifacts:
|
||||
path: ~/intellij-rainbow-brackets/build/distributions/
|
@ -46,10 +46,10 @@ def pluginsDependencies = ['java',
|
||||
'properties',
|
||||
'yaml',
|
||||
"org.jetbrains.kotlin:$kotlinVersion-release-IJ2020.1-1",
|
||||
'org.intellij.scala:2020.1.27',
|
||||
'Dart:201.6668.124',
|
||||
'org.jetbrains.plugins.ruby:201.6668.113',
|
||||
'com.jetbrains.php:201.6668.113'
|
||||
'org.intellij.scala:2020.2.5',
|
||||
'Dart:202.4357.23',
|
||||
'org.jetbrains.plugins.ruby:202.4357.23',
|
||||
'com.jetbrains.php:202.4357.23'
|
||||
]
|
||||
|
||||
intellij {
|
||||
|
@ -1,7 +1,7 @@
|
||||
group="com.github.izhangzhihao"
|
||||
name="Rainbow Brackets"
|
||||
org.gradle.parallel=true
|
||||
ideaVersion=IU-201.6668.121
|
||||
ideaVersion=IU-202-EAP-SNAPSHOT
|
||||
javaVersion=11
|
||||
kotlinVersion=1.3.71
|
||||
kotlinLanguageVersion=1.3
|
||||
|
@ -16,6 +16,7 @@ import com.intellij.openapi.editor.SoftWrap
|
||||
import com.intellij.openapi.editor.ex.EditorEx
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil
|
||||
import com.intellij.openapi.editor.impl.EditorImpl
|
||||
import com.intellij.openapi.editor.impl.view.EditorPainter
|
||||
import com.intellij.openapi.editor.impl.view.VisualLinesIterator
|
||||
import com.intellij.openapi.editor.markup.CustomHighlighterRenderer
|
||||
import com.intellij.openapi.editor.markup.HighlighterTargetArea
|
||||
@ -420,6 +421,7 @@ class RainbowIndentsPass internal constructor(
|
||||
maxY = min(maxY, clip.y + clip.height)
|
||||
}
|
||||
if (start.y >= maxY) return@renderer
|
||||
val targetX = Math.max(0, start.x + EditorPainter.getIndentGuideShift(editor))
|
||||
g.color = if (selected) {
|
||||
rainbowInfo.color
|
||||
} else {
|
||||
@ -443,7 +445,7 @@ class RainbowIndentsPass internal constructor(
|
||||
// 2. Show indent as is if it doesn't intersect with soft wrap-introduced text;
|
||||
val softWraps = editor.softWrapModel.registeredSoftWraps
|
||||
if (selected || softWraps.isEmpty()) {
|
||||
LinePainter2D.paint(g as Graphics2D, start.x + 2.toDouble(), start.y.toDouble(), start.x + 2.toDouble(), maxY - 1.toDouble())
|
||||
LinePainter2D.paint(g as Graphics2D, targetX.toDouble(), start.y.toDouble(), targetX.toDouble(), maxY - 1.toDouble())
|
||||
} else {
|
||||
var startY = start.y
|
||||
var startVisualLine = startPosition.line + 1
|
||||
@ -460,7 +462,7 @@ class RainbowIndentsPass internal constructor(
|
||||
val softWrap: SoftWrap = softWraps[it.startOrPrevWrapIndex]
|
||||
if (softWrap.indentInColumns < indentColumn) {
|
||||
if (startY < currY) {
|
||||
LinePainter2D.paint((g as Graphics2D), start.x + 2.toDouble(), startY.toDouble(), start.x + 2.toDouble(), currY - 1.toDouble())
|
||||
LinePainter2D.paint((g as Graphics2D), targetX.toDouble(), startY.toDouble(), targetX.toDouble(), currY - 1.toDouble())
|
||||
}
|
||||
startY = currY + lineHeight
|
||||
}
|
||||
@ -469,7 +471,7 @@ class RainbowIndentsPass internal constructor(
|
||||
it.advance()
|
||||
}
|
||||
if (startY < maxY) {
|
||||
LinePainter2D.paint((g as Graphics2D), start.x + 2.toDouble(), startY.toDouble(), start.x + 2.toDouble(), maxY - 1.toDouble())
|
||||
LinePainter2D.paint((g as Graphics2D), targetX.toDouble(), startY.toDouble(), targetX.toDouble(), maxY - 1.toDouble())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user