Skip to content

Commit bbf515e

Browse files
Add border to search results and fix layout
1 parent 988befb commit bbf515e

File tree

2 files changed

+5
-141
lines changed

2 files changed

+5
-141
lines changed

lib/components/style-sheet.tsx

+1-140
Original file line numberDiff line numberDiff line change
@@ -3,149 +3,10 @@ import {StyleSheetProps} from '../hyper';
33

44
export default class StyleSheet extends React.PureComponent<StyleSheetProps> {
55
render() {
6-
const {backgroundColor, fontFamily, foregroundColor, borderColor} = this.props;
6+
const {borderColor} = this.props;
77

88
return (
99
<style jsx global>{`
10-
.xterm {
11-
font-family: ${fontFamily};
12-
font-feature-settings: 'liga' 0;
13-
position: relative;
14-
user-select: none;
15-
-ms-user-select: none;
16-
-webkit-user-select: none;
17-
}
18-
19-
.xterm.focus,
20-
.xterm:focus {
21-
outline: none;
22-
}
23-
24-
.xterm .xterm-helpers {
25-
position: absolute;
26-
top: 0;
27-
/**
28-
* The z-index of the helpers must be higher than the canvases in order for
29-
* IMEs to appear on top.
30-
*/
31-
z-index: 10;
32-
}
33-
34-
.xterm .xterm-helper-textarea {
35-
/*
36-
* HACK: to fix IE's blinking cursor
37-
* Move textarea out of the screen to the far left, so that the cursor is not visible.
38-
*/
39-
position: absolute;
40-
opacity: 0;
41-
left: -9999em;
42-
top: 0;
43-
width: 0;
44-
height: 0;
45-
z-index: -10;
46-
/** Prevent wrapping so the IME appears against the textarea at the correct position */
47-
white-space: nowrap;
48-
overflow: hidden;
49-
resize: none;
50-
}
51-
52-
.xterm .composition-view {
53-
/* TODO: Composition position got messed up somewhere */
54-
background: ${backgroundColor};
55-
color: ${foregroundColor};
56-
display: none;
57-
position: absolute;
58-
white-space: nowrap;
59-
z-index: 1;
60-
}
61-
62-
.xterm .composition-view.active {
63-
display: block;
64-
}
65-
66-
.xterm .xterm-viewport {
67-
/* On OS X this is required in order for the scroll bar to appear fully opaque */
68-
background-color: ${backgroundColor};
69-
overflow-y: scroll;
70-
cursor: default;
71-
position: absolute;
72-
right: 0;
73-
left: 0;
74-
top: 0;
75-
bottom: 0;
76-
}
77-
78-
.xterm .xterm-screen {
79-
position: relative;
80-
}
81-
82-
.xterm canvas {
83-
position: absolute;
84-
left: 0;
85-
top: 0;
86-
}
87-
88-
.xterm .xterm-scroll-area {
89-
visibility: hidden;
90-
}
91-
92-
.xterm .xterm-char-measure-element {
93-
display: inline-block;
94-
visibility: hidden;
95-
position: absolute;
96-
left: -9999em;
97-
}
98-
99-
.xterm {
100-
cursor: text;
101-
}
102-
103-
.xterm.enable-mouse-events {
104-
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
105-
cursor: default;
106-
}
107-
108-
.xterm.xterm-cursor-pointer {
109-
cursor: pointer;
110-
}
111-
112-
.xterm.xterm-cursor-crosshair {
113-
/* Column selection mode */
114-
cursor: crosshair;
115-
}
116-
117-
.xterm .xterm-accessibility,
118-
.xterm .xterm-message {
119-
position: absolute;
120-
left: 0;
121-
top: 0;
122-
bottom: 0;
123-
right: 0;
124-
z-index: 100;
125-
color: transparent;
126-
}
127-
128-
.xterm .xterm-accessibility-tree:focus [id^='xterm-active-item-'] {
129-
outline: 1px solid #f80;
130-
}
131-
132-
.xterm .live-region {
133-
position: absolute;
134-
left: -9999px;
135-
width: 1px;
136-
height: 1px;
137-
overflow: hidden;
138-
}
139-
140-
.xterm .xterm-decoration-overview-ruler {
141-
position: absolute;
142-
z-index: 10;
143-
right: 0px;
144-
top: unset;
145-
left: unset;
146-
pointer-events: none;
147-
}
148-
14910
::-webkit-scrollbar {
15011
width: 5px;
15112
}

lib/components/term.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import _SearchBox from './searchBox';
1414
import {TermProps} from '../hyper';
1515
import {ObjectTypedKeys} from '../utils/object';
1616
import {decorate} from '../utils/plugins';
17+
import 'xterm/css/xterm.css';
1718

1819
const SearchBox = decorate(_SearchBox, 'SearchBox');
1920

@@ -136,7 +137,9 @@ export default class Term extends React.PureComponent<
136137
this.searchDecorations = {
137138
activeMatchColorOverviewRuler: Color(this.props.cursorColor).hex(),
138139
matchOverviewRuler: Color(this.props.borderColor).hex(),
139-
activeMatchBackground: Color(this.props.cursorColor).hex()
140+
activeMatchBackground: Color(this.props.cursorColor).hex(),
141+
activeMatchBorder: Color(this.props.cursorColor).hex(),
142+
matchBorder: Color(this.props.cursorColor).hex()
140143
};
141144
}
142145

0 commit comments

Comments
 (0)