为了区分选择与未选择区域,,将已选择区域的文本背景色设置为浅蓝色是个很做法。
设置的路径在 Editor > Color Scheme > General > Editor > Selection background
下面以2018版的Goland为例,如图:
JetBrains出品的如phpStorm和webStorm等的设置也基本如此。
补充:Go语言:控制台输出有颜色的字
本方法只限用于 Windows系统
应用场景
需要输出大量信息的运行日志(一般是服务器,Windows系统的)
某类客户端的调试界面(一般是游戏,特别是有第三方模组的)
代码示例
package main import ( "syscall" ) var ( kernel32 *syscall.LazyDLL = syscall.NewLazyDLL(`kernel32.dll`) proc *syscall.LazyProc = kernel32.NewProc(`SetConsoleTextAttribute`) CloseHandle *syscall.LazyProc = kernel32.NewProc(`CloseHandle`) // 给字体颜色对象赋值 FontColor Color = Color{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} ) type Color struct { black int // 黑色 blue int // 蓝色 green int // 绿色 cyan int // 青色 red int // 红色 purple int // 紫色 yellow int // 黄色 light_gray int // 淡灰色(系统默认值) gray int // 灰色 light_blue int // 亮蓝色 light_green int // 亮绿色 light_cyan int // 亮青色 light_red int // 亮红色 light_purple int // 亮紫色 light_yellow int // 亮黄色 white int // 白色 } // 输出有颜色的字体 func ColorPrint(s string, i int) { handle, _, _ := proc.Call(uintptr(syscall.Stdout), uintptr(i)) print(s) CloseHandle.Call(handle) } func main() { ColorPrint(`红色`, FontColor.red) ColorPrint(`蓝色`, FontColor.blue) ColorPrint(`白色`, FontColor.white) }
以上为个人经验,希望能给大家一个参考,也希望大家多多支持。如有错误或未考虑完全的地方,望不吝赐教。
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
暂无“Goland编辑器设置选择范围背景色的操作”评论...
更新动态
20240517
20240517
- [In-Akustik7506]ReferenceSoundEdition-GreatWomenOfSong(2014)HQCD[WAV+CUE]
- 日本EMI超级名盘TOGE-11035-36BeethovenFidelio-Furtwngler
- 宝丽金50周年2010《古典篇》3CD限定盘[低速原抓WAV+CUE]
- 华纳群星.1992-永远新一天华纳15周年金钻群星演唱会2CD【华纳】【WAV+CUE】
- 原声《功夫熊猫4 OST》[FLAC][545M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- Taylor Swift《THE TORTURED POETS DEPARTMENT- THE ANTHOLOGY》[320K/MP3][279.09MB]
- 崔健《85回顾+梦中的倾诉》2CD [WAV+CUE][771M]
- 群星《安桥试音碟》3CD[FLAC][1.1G]
- Taylor Swift《THE TORTURED POETS DEPARTMENT- THE ANTHOLOGY》][24bit 48kH][FLAC/分轨]
- 群星1995-阿诗玛·中国歌剧金曲[中唱][WAV+CUE]
- [JVC]吴文光-中国古琴:流水[FLAC分轨]
- 刘欢.2004-经典20年珍藏锦集【新索】【WAV+CUE】
- 中唱唱片群星《好歌珍藏-游子情深》2CDWAV
- CD圣经上榜天碟1995-乌仁娜-《蒙古草原之歌》[WAV+CUE].