diff --git a/src/forge/DevOps/About.jsx b/src/forge/DevOps/About.jsx index 31ced2204..e23a82c3e 100644 --- a/src/forge/DevOps/About.jsx +++ b/src/forge/DevOps/About.jsx @@ -171,10 +171,10 @@ function About(props, ref) {
+
diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js
index d050116f4..c6de96388 100644
--- a/src/forge/Merge/merge_form.js
+++ b/src/forge/Merge/merge_form.js
@@ -167,8 +167,8 @@ class MergeForm extends Component {
this.setState({
isSpin: false,
});
- const { pull_request_id } = result.data;
- this.props.history.push(`/${owner}/${projectsId}/pulls/${pull_request_id}`);
+ const { pull_request_number } = result.data;
+ this.props.history.push(`/${owner}/${projectsId}/pulls/${pull_request_number}`);
const { getDetail } = this.props;
getDetail && getDetail();
} else {
diff --git a/src/forge/Newfile/index.css b/src/forge/Newfile/index.css
index 746febe55..0bda4711a 100644
--- a/src/forge/Newfile/index.css
+++ b/src/forge/Newfile/index.css
@@ -1,3 +1,11 @@
+.editorBorderBox .CodeMirror
+{
+ height: unset;
+}
+.editorBorderBox .CodeMirror .CodeMirror-scroll{
+ min-height: 300px;
+}
+
.setInputAddon{
width: 350px;
margin-right: 20px;
@@ -9,12 +17,16 @@
border-right: none!important;
}
.editorBorder .editorBorderBox{
- border:1px solid #eee;
+ border:1px solid #d0d0d0;
border-radius: 2px;
+ border-bottom: none;
}
.editorBorder .editorBorderSubmitBox{
padding:20px 0px!important;
}
+.editorBorderSubmitBox{
+ border-top: 1px solid #d0d0d0;
+}
.userScrew{
margin:20px 0px;
border:1px solid #f4f4f4;
diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js
index 13d2ec466..d4446e3f2 100644
--- a/src/forge/Newfile/m_editor.js
+++ b/src/forge/Newfile/m_editor.js
@@ -1,6 +1,9 @@
import React, { Component } from "react";
-import Editor from "react-monaco-editor";
-// import {UnControlled as CodeMirror} from 'react-codemirror2'
+import {UnControlled as CodeMirror} from 'react-codemirror2';
+import 'codemirror/addon/selection/active-line.js';
+import 'codemirror/mode/javascript/javascript.js';
+import 'codemirror/mode/clike/clike';
+import 'codemirror/mode/css/css';
import UserSubmitComponent from "./UserSubmitComponent";
@@ -12,6 +15,7 @@ class m_editor extends Component {
super(props);
this.state = {
editorValue: this.props.content,
+ changeValue:this.props.content,
prevHeight:0
};
}
@@ -22,18 +26,18 @@ class m_editor extends Component {
})
}
}
- changeEditor = (editorValue) => {
+ changeEditor = (editorValue,data) => {
this.setState({
- editorValue,
+ changeValue:editorValue.getValue(),
});
};
render() {
- const { editorValue } = this.state;
- const { readOnly, editorType, language , currentBranch , descName } = this.props;
+ const { editorValue , changeValue } = this.state;
+ const { readOnly, editorType, currentBranch , descName } = this.props;
const editor_options = {
lineNumbers: "on",
- wordWrap: true, //强制换行
+ lineWrapping: true, //强制换行
selectOnLineNumbers: true,
lineHeight: 24,
renderLineHighlight: "line",
@@ -46,84 +50,29 @@ class m_editor extends Component {
automaticLayout: true, // 自适应布局
overviewRulerBorder: false, // 不要滚动条的边框
scrollBeyondLastLine: false, // 取消代码后面一大段空白
+ styleActiveLine:true,//光标代码高亮
minimap: {
// 不要小地图
enabled: false,
},
};
-
- const handleEditorMount = (editor, monaco) => {
- editor.onDidChangeModelDecorations(() => {
- requestAnimationFrame(updateEditorHeight); // folding
- });
-
- const updateEditorHeight = () => {
- const editorElement = editor.getDomNode();
-
- if (!editorElement) {
- return;
- }
-
- const padding = 40;
-
- const lineHeight = editor.getOption(
- monaco.editor.EditorOption.lineHeight
- );
-
- const lineCount = editor.getModel().getLineCount() || 1;
- let height =
- editor.getTopForLineNumber(lineCount + 1) +
- lineHeight +
- padding ;
-
- if(height<400){height = 400;}
-
- if (this.state.prevHeight !== height) {
- this.setState({
- prevHeight:height
- })
- // setPrevHeight(height);
- editorElement.style.height = `${height}px`;
- editor.layout();
- }
- };
-
- updateEditorHeight(); // typing
- };
-
-
return (
展示你擅长、关注、感兴趣的专业范围,通过你参与项目、收藏项目、关注项目、复刻项目等数据来统计。