8000 Fix editing note (comment) line by zcsahok · Pull Request #474 · Tlf/tlf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix editing note (comment) line #474

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

Merged
merged 5 commits into from
Jun 23, 2025
Merged

Conversation

zcsahok
Copy link
Member
@zcsahok zcsahok commented Jun 18, 2025

Editing a note (or comment) line is not really possible as editing assumes and enforces QSO-line structure.

Already entering a note can lead to strange results.
image
The two ^[ symbols are the escape keys the desperate user was trying to use to close the note input window.
The first chars of the input line are covered due the longer line.

When trying to fix the note one runs into a deadlock. The only way out is to kill TLF.
image

The fix introduces specific field definition for comment lines. When switching between different types of lines the cursor is moved to a valid position.

Also fixed a minor issue: Ctrl-A/E was not updating field_index, only the cursor position.

@zcsahok
Copy link
Member Author
zcsahok commented Jun 18, 2025

Note input uses curses' own getnstr() function, so handling esc and other non-printables can't be changed.
What we can do is to clean up the user input: replace non-printables with space and trim leading/trailing whitespace.
As a result if user types just spaces (or escapes) no note will be included.

@zcsahok
Copy link
Member Author
zcsahok commented Jun 18, 2025

Looks like Ubuntu 20 support is removed:

Ubuntu 20.04 LTS runner will be removed on 2025-04-15.

https://github.com/Tlf/tlf/actions/runs/15743352324/job/44374380014?pr=474

--> handled in #475

@dl1jbe
Copy link
Member
dl1jbe commented Jun 20, 2025

So we have at least three problems:

  • No information for user how to leave note input field
  • bad handling of non-printable characters
  • incorrect handling of note edit (which sometimes lead to a deadlock)

Second and third will be fixed by the PR.

For the first one how about a helping note on the input fields top line:
e.g. "Note (leave with Enter)"

An additional idea: Can we please position the cursor to start or end of text on entering edit mode? At the moment it is positioned at start of normal input field.

@zcsahok
Copy link
Member Author
zcsahok commented Jun 20, 2025

How about this: on a new line the cursor is moved left to the rightmost non-space position. If there are chars right from the original cursor position then cursor is not touched.

Some paths going up and down between the lines:
image

@dl1jbe
Copy link
Member
dl1jbe commented Jun 21, 2025

That looks good and should do for most cases. Thanks.
+1

@dl1jbe
Copy link
Member
dl1jbe commented Jun 23, 2025

👍

@zcsahok zcsahok merged commit 5e9553a into Tlf:master Jun 23, 2025
2 checks passed
@zcsahok zcsahok deleted the fix_note_editing branch June 23, 2025 19:22
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

Successfully merging this pull request may close these issues.

2 participants
0