Skip to content

Commit

Permalink
fix: output now follows the same font size as the editor
Browse files Browse the repository at this point in the history
Resolves #223
  • Loading branch information
Roboroads committed Dec 14, 2022
1 parent d2b9cf4 commit b856a5b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

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

## [2.5.0] - 2022-12-13

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package nl.deschepers.laraveltinker.toolwindow

import com.intellij.application.options.EditorFontsConstants
import com.intellij.ide.ui.UISettings
import com.intellij.openapi.editor.EditorSettings
import com.intellij.openapi.editor.HighlighterColors
import com.intellij.openapi.editor.colors.EditorColorsManager
import com.intellij.openapi.options.FontSize
import com.intellij.openapi.wm.ToolWindow
import com.intellij.util.FontUtil
import nl.deschepers.laraveltinker.Strings
import nl.deschepers.laraveltinker.settings.GlobalSettingsState
import nl.deschepers.laraveltinker.util.HelperUtil
Expand Down Expand Up @@ -77,6 +83,7 @@ class TinkerOutputToolwindow(private val toolWindow: ToolWindow) {

private fun updateView() {
val color = HelperUtil.colorToHex(HighlighterColors.TEXT.defaultAttributes.foregroundColor ?: Color.BLACK)
val globalScheme = EditorColorsManager.getInstance().globalScheme
val timeString =
if (pluginSettings.showExecutionStarted)
Strings.get("lt.started_at", outputTime)
Expand All @@ -98,11 +105,16 @@ class TinkerOutputToolwindow(private val toolWindow: ToolWindow) {
word-wrap: break-word;
color: $color;
font-family: ${tinkerOutputToolWindowContent!!.font.family};
font-size: ${globalScheme.editorFontSize}pt;
}
pre, code {
font-family: '${globalScheme.editorFontName}';
font-size: ${globalScheme.editorFontSize}pt;
}
.output {
padding: 5px;
${if (pluginSettings.useWordWrapping) "padding-left: 10px;" else ""}
${if (pluginSettings.useWordWrapping) "text-indent: -5px;" else ""}
${if (pluginSettings.useWordWrapping) "text-indent: -5px;" else ""}
}
.header {
font-weight: bold;
Expand Down

0 comments on commit b856a5b

Please sign in to comment.