Skip to content

Commit b856a5b

Browse files
committed
fix: output now follows the same font size as the editor
Resolves #223
1 parent d2b9cf4 commit b856a5b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1010

1111
- [[#220]](https://github.com/Roboroads/laravel-tinker/issues/220) Add context menu action in tinker consoles to run the console.
1212
- Replace JB run icon with a green tinker run icon.
13+
- [[#223]](https://github.com/Roboroads/laravel-tinker/issues/223) Editor font size is now used as font size for the tinker console.
1314

1415
## [2.5.0] - 2022-12-13
1516

src/main/kotlin/nl/deschepers/laraveltinker/toolwindow/TinkerOutputToolwindow.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
package nl.deschepers.laraveltinker.toolwindow
22

3+
import com.intellij.application.options.EditorFontsConstants
4+
import com.intellij.ide.ui.UISettings
5+
import com.intellij.openapi.editor.EditorSettings
36
import com.intellij.openapi.editor.HighlighterColors
7+
import com.intellij.openapi.editor.colors.EditorColorsManager
8+
import com.intellij.openapi.options.FontSize
49
import com.intellij.openapi.wm.ToolWindow
10+
import com.intellij.util.FontUtil
511
import nl.deschepers.laraveltinker.Strings
612
import nl.deschepers.laraveltinker.settings.GlobalSettingsState
713
import nl.deschepers.laraveltinker.util.HelperUtil
@@ -77,6 +83,7 @@ class TinkerOutputToolwindow(private val toolWindow: ToolWindow) {
7783

7884
private fun updateView() {
7985
val color = HelperUtil.colorToHex(HighlighterColors.TEXT.defaultAttributes.foregroundColor ?: Color.BLACK)
86+
val globalScheme = EditorColorsManager.getInstance().globalScheme
8087
val timeString =
8188
if (pluginSettings.showExecutionStarted)
8289
Strings.get("lt.started_at", outputTime)
@@ -98,11 +105,16 @@ class TinkerOutputToolwindow(private val toolWindow: ToolWindow) {
98105
word-wrap: break-word;
99106
color: $color;
100107
font-family: ${tinkerOutputToolWindowContent!!.font.family};
108+
font-size: ${globalScheme.editorFontSize}pt;
109+
}
110+
pre, code {
111+
font-family: '${globalScheme.editorFontName}';
112+
font-size: ${globalScheme.editorFontSize}pt;
101113
}
102114
.output {
103115
padding: 5px;
104116
${if (pluginSettings.useWordWrapping) "padding-left: 10px;" else ""}
105-
${if (pluginSettings.useWordWrapping) "text-indent: -5px;" else ""}
117+
${if (pluginSettings.useWordWrapping) "text-indent: -5px;" else ""}
106118
}
107119
.header {
108120
font-weight: bold;

0 commit comments

Comments
 (0)