@electerm/electerm-react 2.3.118 → 2.3.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -120,9 +120,9 @@ export default class TerminalCmdSuggestions extends Component {
|
|
|
120
120
|
|
|
121
121
|
// Use bottom position if close to bottom edge
|
|
122
122
|
if (reverse) {
|
|
123
|
-
position.bottom = h - top + cellHeight
|
|
123
|
+
position.bottom = h - top + cellHeight * 1.5
|
|
124
124
|
} else {
|
|
125
|
-
position.top = top
|
|
125
|
+
position.top = top + cellHeight
|
|
126
126
|
}
|
|
127
127
|
this.setState({
|
|
128
128
|
showSuggestions: true,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
CopyOutlined
|
|
8
8
|
} from '@ant-design/icons'
|
|
9
9
|
import { copy } from '../../common/clipboard'
|
|
10
|
+
import { escapeRegExp } from 'lodash-es'
|
|
10
11
|
|
|
11
12
|
export default function SimpleEditor (props) {
|
|
12
13
|
const [searchKeyword, setSearchKeyword] = useState('')
|
|
@@ -72,7 +73,8 @@ export default function SimpleEditor (props) {
|
|
|
72
73
|
|
|
73
74
|
const matches = []
|
|
74
75
|
const text = props.value || ''
|
|
75
|
-
const
|
|
76
|
+
const escapedKeyword = escapeRegExp(searchKeyword)
|
|
77
|
+
const regex = new RegExp(escapedKeyword, 'gi')
|
|
76
78
|
let match
|
|
77
79
|
|
|
78
80
|
while ((match = regex.exec(text)) !== null) {
|