Skip to content

Commit

Permalink
v9.29.3
Browse files Browse the repository at this point in the history
[SFTP]优化FTP文件关联功能。
[SFTP]修复在Windows端,因反斜扛因素,无法找开程序问题。
[TextTerminal]优化文字选择边界。

[SFTP] Optimize the FTP file association function.
[SFTP] Fixed the issue of not being able to open the program due to the reverse slash character on the Windows side.
[TextTerminal] Optimize the text selection boundary.
  • Loading branch information
getwingm committed Oct 25, 2023
1 parent f228711 commit 88aa716
Show file tree
Hide file tree
Showing 13 changed files with 261 additions and 152 deletions.
2 changes: 2 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*本仓库没有包含任何第三方库和kxver模块的源码或库文件,kxver模块主要是用于版本控制,特别是与旗舰版的相关的功能如数据加密,它是团队的唯一资金来源,也是产品健康维护和升级的重要保证,在没有解决资金来源之前,并不计划开放该模块。*
***
<p align="center">
<img src="doc/woterm.png" width="64" alt="WoTerm - Another Remote Access Assistant">
<h2 style="text-align: center;">跨平台/小内存/多协议/多功能/云同步</h2>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*This repository does not contain any third-party libraries or source code for the kxver module. The kxver module is primarily used for version control, particularly for features related to the ultimate version such as data encryption. It is the team's sole source of funding and an important guarantee for the health maintenance and upgrade of the product.Until the funding source is resolved, there are no plans to open the source code for this module.*
***
<p align="center">
<img src="doc/woterm.png" width="64" alt="WoTerm - Another Remote Access Assistant">
<h2 style="text-align: center;">Cross platform / small memory / multi-protocol / multi-function / cloud sync</h2>
Expand Down
2 changes: 1 addition & 1 deletion kxterm/qkxscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class QKxScreen : public QObject
void clearScreen();
void resize(int rows, int cols);
inline int rows() { return m_rows; }
inline int columens() { return m_columns; }
inline int columns() { return m_columns; }
TermLine lineAt(int y) const;
TermCursor cursor() const;
bool visibleCursor() const;
Expand Down
74 changes: 67 additions & 7 deletions kxterm/qkxview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void QKxView::setSelection(const QMap<QPoint, QPoint> &sels)

void QKxView::selectWord(const QPoint& pt)
{
int cols = m_screen->columens();
int cols = m_screen->columns();
int x = pt.x();
int y = pt.y();
const TermLine& line = lineAt(pt.y());
Expand Down Expand Up @@ -166,7 +166,7 @@ void QKxView::selectWord(const QPoint& pt)
void QKxView::selectLine(int y)
{
int rows = lineCount();
int cols = m_screen->columens();
int cols = m_screen->columns();
const TermLine& line = lineAt(y);
if(line.cs.isEmpty()) {
setSelection(QPoint(0, y), QPoint(cols, y));
Expand Down Expand Up @@ -331,7 +331,7 @@ QList<TermLine> QKxView::selectedLines()
bool QKxView::find(const QString &key, bool match, bool regular)
{
QList<QPoint> pos;
pos.reserve(m_screen->columens());
pos.reserve(m_screen->columns());
m_findText = key;
m_findLength = 0;
if(key.isEmpty()) {
Expand Down Expand Up @@ -360,6 +360,21 @@ bool QKxView::find(const QString &key, bool match, bool regular)
QPoint pt2 = pos.at(cnt - 1 + idx);
m_findKey = intFromPoint(pt1);
m_findLength = cnt;
if(pt1.y() != pt2.y()) {
QMap<QPoint, QPoint> sels;
for(int i = idx; i <= cnt-1+idx; i++) {
QPoint pt = pos.at(i);
if(pt1.y() != pt.y()) {
sels.insert(pt1, pt2);
pt1 = pt2 = pt;
}else{
pt2 = pt;
}
}
sels.insert(pt1, pt2);
setSelection(sels);
return true;
}
setSelection(pt1, pt2);
return true;
}
Expand All @@ -375,7 +390,7 @@ bool QKxView::find(const QString &key, bool match, bool regular)
bool QKxView::findPrev(bool match, bool regular)
{
QList<QPoint> pos;
pos.reserve(m_screen->columens());
pos.reserve(m_screen->columns());
if(m_findText.isEmpty()) {
return true;
}
Expand All @@ -402,6 +417,21 @@ bool QKxView::findPrev(bool match, bool regular)
QPoint pt2 = pos.at(cnt - 1 + idx);
m_findKey = intFromPoint(pt1);
m_findLength = cnt;
if(pt1.y() != pt2.y()) {
QMap<QPoint, QPoint> sels;
for(int i = idx; i <= cnt-1+idx; i++) {
QPoint pt = pos.at(i);
if(pt1.y() != pt.y()) {
sels.insert(pt1, pt2);
pt1 = pt2 = pt;
}else{
pt2 = pt;
}
}
sels.insert(pt1, pt2);
setSelection(sels);
return true;
}
setSelection(pt1, pt2);
return true;
}
Expand All @@ -417,7 +447,7 @@ bool QKxView::findPrev(bool match, bool regular)
bool QKxView::findNext(bool match, bool regular)
{
QList<QPoint> pos;
pos.reserve(m_screen->columens());
pos.reserve(m_screen->columns());
if(m_findText.isEmpty()) {
return true;
}
Expand All @@ -444,6 +474,21 @@ bool QKxView::findNext(bool match, bool regular)
QPoint pt2 = pos.at(cnt - 1 + idx);
m_findKey = intFromPoint(pt1);
m_findLength = cnt;
if(pt1.y() != pt2.y()) {
QMap<QPoint, QPoint> sels;
for(int i = idx; i <= cnt-1+idx; i++) {
QPoint pt = pos.at(i);
if(pt1.y() != pt.y()) {
sels.insert(pt1, pt2);
pt1 = pt2 = pt;
}else{
pt2 = pt;
}
}
sels.insert(pt1, pt2);
setSelection(sels);
return true;
}
setSelection(pt1, pt2);
return true;
}
Expand All @@ -458,7 +503,7 @@ bool QKxView::findNext(bool match, bool regular)
void QKxView::findAll(bool match, bool regular)
{
QList<QPoint> pos;
pos.reserve(m_screen->columens());
pos.reserve(m_screen->columns());
clearSelection();
if(m_findText.isEmpty()) {
return;
Expand All @@ -478,7 +523,22 @@ void QKxView::findAll(bool match, bool regular)
const QStringList& caps = rgx.capturedTexts();
for(int i = 0; i < caps.length(); i++) {
int cnt = caps.at(i).length();
sels.insert(pos.at(idx), pos.at(cnt - 1 + idx));
QPoint pt1 = pos.at(idx);
QPoint pt2 = pos.at(cnt - 1 + idx);
if(pt1.y() != pt2.y()) {
for(int i = idx; i <= cnt-1+idx; i++) {
QPoint pt = pos.at(i);
if(pt1.y() != pt.y()) {
sels.insert(pt1, pt2);
pt1 = pt2 = pt;
}else{
pt2 = pt;
}
}
sels.insert(pt1, pt2);
}else{
sels.insert(pt1, pt2);
}
idx += cnt;
}
}
Expand Down
Loading

0 comments on commit 88aa716

Please sign in to comment.