Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于“从代码块中跨行选择代码会将行号一并选中”的问题 #462

Closed
Creling opened this issue Dec 5, 2019 · 9 comments

Comments

@Creling
Copy link

Creling commented Dec 5, 2019

如题,当跨行选择代码时会将行号一并选中,给复制粘贴带来麻烦,这不太符合一般预期:

图片

非常奇怪的是,在作者博客中并不存在这个问题,是因为Maupassant-hexo的版本问题吗?请问作者博客使用的哪个版本呢?

图片

@Creling
Copy link
Author

Creling commented Dec 7, 2019

经过测试,感觉是hexo的问题,已在hexo提交issue如下:
hexojs/hexo#3913

@weearc
Copy link

weearc commented Dec 7, 2019

hexo
这个是我在自己博客尝试的,没有出现上述情况。可能是版本旧的缘故。
hexo2
另外根据分析,右侧代码框为整体的一个子元素,按理说是不会复制到行号的。可能是主题相关位置代码变动导致的。
相关版本号:

> hexo --version                                                                                                             
hexo-cli: 2.0.0
os: Linux 5.2.21-1-WEEARC linux x64
node: 11.14.0
v8: 7.0.276.38-node.18
uv: 1.27.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 67
nghttp2: 1.37.0
napi: 4
llhttp: 1.1.1
http_parser: 2.8.0
openssl: 1.1.1b
cldr: 34.0
icu: 63.1
tz: 2018e
unicode: 11.0

@Creling
Copy link
Author

Creling commented Dec 7, 2019

这个可能和hexo的版本有关。
我目前在用hexo@4.0,不仅仅是maupassant,哪怕是默认的主题landscope也存在这样的问题。

另外根据分析,右侧代码框为整体的一个子元素,按理说是不会复制到行号的。可能是主题相关位置代码

这个可以参照 hexojs/hexo#3913 (comment) 的分析,Hexo@4.0中的代码框不是左边一大块右边一大块了,变成一行一行的小块了,所以说没办法避开左边的行号。

@weearc
Copy link

weearc commented Dec 7, 2019

这个可能和hexo的版本有关。
我目前在用hexo@4.0,不仅仅是maupassant,哪怕是默认的主题landscope也存在这样的问题。

这个可以参照 hexojs/hexo#3913 (comment) 的分析,Hexo@4.0中的代码框不是左边一大块右边一大块了,变成一行一行的小块了,所以说没办法避开左边的行号。

所以可以换回2.0 3.0版本,也是一个解决办法23333

@Creling
Copy link
Author

Creling commented Dec 8, 2019

所以可以换回2.0 3.0版本,也是一个解决办法23333

我太难了2333

@tufu9441
Copy link
Owner

之前没发现过,最近更新到4.1.1之后确实存在这个问题了,并且代码框每个距离超长的行下面都会多出一个滚动条,十分蛋疼。

@tufu9441
Copy link
Owner

@Creling 我看了你提的Issue hexojs/hexo#3913 ,你在自己修改代码后恢复正常了吗?改的是哪里

@Creling
Copy link
Author

Creling commented Dec 13, 2019

gutter

    .gutter {
        background-color: inherit;
        font-family: Menlo, Consolas, monospace;
        border:      none;
        padding:     0;
        margin:      0;
        cursor:      text;
        user-select: none
    }

给gutter单独设立样式块,最后加一个 user-select: none即可

不过在最新的hexo中已经修复了这个问题,即使不做这个修改也可以正常使用。

@tufu9441
Copy link
Owner

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants