@import "syntax-variables";

// Fix that sodding highlighting in error notifications
atom-notifications{
	atom-notification.error pre > code{
		background: inherit;
	}
	
	.tty-output{
		background:  none;
		font-size:   var(--editor-font-size);
		font-family: var(--editor-font-family);
		line-height: var(--editor-line-height);
		white-space: pre;
		user-select: all;
		overflow:    auto;
	}
}

// Tab-icons for ManpageViews
.icon-manpage{
	body:not(.file-icons-coloured):not(.file-icons-colourless) &::before{
		font-family: "Octicons Regular";
		font-size: 16px;
		top: 1px;
		content: "\f007";
	}
	
	body.file-icons-coloured   &::before,
	body.file-icons-colourless &::before{
		content: "\e936";
		font-family: file-icons;
		font-size: 15px;
		top: 3px;
	}
	
	body.file-icons-coloured &::before{
		color: #66783e;
	}
}

.troff-view-pages{
	padding: 1em;
}
.troff-view-page{
	margin-bottom: 1em;
}

.troff-view{
	background: @syntax-background-color;
	color: @syntax-text-color;
	
	overflow-x: hidden;
	overflow-y: auto;
	position: absolute;
	padding: .5em 1em;
	top:    0;
	left:   0;
	right:  0;
	bottom: 0;
}
	.troff-view > pre{
		margin: 0;
		padding: 0;
		background: none;
		color: inherit;
	}

// Syntax highlighting refinements
.line > * > .syntax--roff{
	> .syntax--meta.syntax--request.syntax--roff
	> .syntax--string.syntax--other.syntax--link{
		color: @syntax-text-color;
	}
}

.theme-seti-syntax{
	.syntax--entity.syntax--name.syntax--link-text.syntax--roff{
		&, & > .syntax--punctuation.syntax--link-text{
			color: #a074c4;
		}
	}
	.syntax--meta.syntax--link-destination.syntax--roff{
		& > .syntax--punctuation.syntax--definition.syntax--string.syntax--begin,
		& > .syntax--punctuation.syntax--definition.syntax--string.syntax--end{
			color: #519aba;
		}
	}
	.syntax--ditroff{
		&.syntax--string.syntax--other      { color: #7494a3; }
		&.syntax--entity.syntax--glyph      { color: #a074c4; }
		&.syntax--keyword.syntax--function  { color: #a074c4; }
	}
}

// Hyperlinked man-page references
body:not(.disable-manref-links) .syntax--manref{
	color: @syntax-color-keyword;
	cursor: pointer;
	font-weight: bold;
	&:hover{
		text-decoration: underline;
	}
}

// ASCII control characters
.syntax--punctuation.syntax--ctrl-char.syntax--roff,
.syntax--punctuation.syntax--whitespace.syntax--form-feed.syntax--roff{
	opacity: 0.5;
	width: 2ch;
	display: inline-block;
	position: relative;
	color: transparent;
	
	&::after{
		color: #00c;
		position: absolute;
		left: 0;
		width: 100%;
		text-align: center;
	}
	
	// Placeholders
	&.syntax--start-of-text             { &::after{ content: "^B";  }}
	&.syntax--end-of-text               { &::after{ content: "^C";  }}
	&.syntax--end-of-transmission       { &::after{ content: "^D";  }}
	&.syntax--enquiry                   { &::after{ content: "^E";  }}
	&.syntax--acknowledge               { &::after{ content: "^F";  }}
	&.syntax--alarm                     { &::after{ content: "\\a"; }}
	&.syntax--form-feed                 { &::after{ content: "\\f"; }}
	&.syntax--delete                    { &::after{ content: "^?";  }}
}
