Commit d2fa673b authored by Yuan Zhixiang's avatar Yuan Zhixiang
Browse files

Revert "添加仿断点样式,默认关闭"

parent f6c14934
......@@ -224,7 +224,6 @@ function get_oj_solution_id(){
get_oj_solution_id()
const feature_show_new_vars = ref(false)
const feature_breakpoint_style = ref(false)
provide('app', {
loading,
......@@ -245,8 +244,7 @@ provide('app', {
highlight_lines,
click_line,
edit_mode,
feature_show_new_vars,
feature_breakpoint_style
feature_show_new_vars
})
</script>
......
......@@ -3,7 +3,7 @@ import { computed, inject } from 'vue';
const props = defineProps(['line', 'code'])
const { current_line, next_line, click_line, highlight_lines, feature_breakpoint_style } = inject('app')
const { current_line, next_line, click_line, highlight_lines } = inject('app')
const line = computed(() => { // 行号
return props.line
......@@ -27,23 +27,12 @@ const is_next = computed(() => { // 是下一行
return line.value == next_line.value
})
const css_code_background = computed(() => { // 对应的style
if(feature_breakpoint_style.value){
return 'white'
}
if (Object.values(highlight_lines.value).includes(line.value)) {
return '#FFDAD6'
} else {
return 'white'
}
})
const breakpoint = computed(() => {
// 
if (Object.values(highlight_lines.value).includes(line.value)) {
return ''
} else {
return ' '
}
})
function click() {
click_line(line.value)
}
......@@ -53,7 +42,6 @@ function click() {
<template>
<div>
<pre :class="{ blue: is_current, 'light-blue': is_next }">{{ mark }} </pre>
<pre class="breakpoint" v-show="feature_breakpoint_style">{{ breakpoint }} </pre>
<pre :class="{ blue: is_current }" class="code" @click="click">{{ code }}</pre>
</div>
</template>
......@@ -88,8 +76,4 @@ pre {
filter: brightness(0.8);
transition-duration: 200ms;
}
.breakpoint{
color: red;
}
</style>
\ No newline at end of file
......@@ -2,7 +2,7 @@
import { computed, inject } from 'vue';
const { stdin_input, feature_show_new_vars, feature_breakpoint_style } = inject('app')
const { stdin_input, feature_show_new_vars } = inject('app')
const command = computed(()=>{
if(stdin_input.value.length <= 1){
......@@ -15,16 +15,12 @@ const command = computed(()=>{
function click(){
const cmd = command.value
if(cmd == '?'){
stdin_input.value = 'available commands:\n/show_new_vars\n/breakpoint_style'
stdin_input.value = 'available commands:\n/show_new_vars'
}
else if(cmd == 'show_new_vars'){
feature_show_new_vars.value = !feature_show_new_vars.value
stdin_input.value = 'feature_show_new_vars: ' + feature_show_new_vars.value
}
else if(cmd == 'breakpoint_style'){
feature_breakpoint_style.value = !feature_breakpoint_style.value
stdin_input.value = 'feature_breakpoint_style: ' + feature_breakpoint_style.value
}
else{
stdin_input.value = 'unknown command\nuse /?'
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment