Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Do a full reformat when^L/^R redrawing.#107

Merged
lichray merged 1 commit intolichray:mainfromjohnsonjh:redraw-l
Feb 27, 2022
Merged

Do a full reformat when^L/^R redrawing.#107

lichray merged 1 commit intolichray:mainfromjohnsonjh:redraw-l
Feb 27, 2022

Conversation

johnsonjh
Copy link
Contributor

See issue#104 - adding a new step of "inputting four or five backspaces" to exit the command input leaves the screen in a state where^L or^R will not correct corruption until a reformat (:set nonum|set num, etc).

This is possible in other situations as well.

This ensures the screen is always reformatted and redrawn on^L or^R.

@johnsonjh
Copy link
ContributorAuthor

Not that this isn't a fix for#104 but a workaround for this and other potential issues. I've not fully looked into#104 to see what a proper fix is yet, maybe you'll beat me to it.

@lichray
Copy link
Owner

Doesn't sound too useful? A quicker workaround for#104 might be Ctrl-C.

@johnsonjh
Copy link
ContributorAuthor

johnsonjh commentedFeb 27, 2022
edited
Loading

That works only if you are still inputting the command, on the command input line. If you have exited without interrupting, such as backspacing out of the command input, the screen remains corrupted then cannot be recovered with^C/^L/^R.

This patch is more a "fix" that is compatible with my muscle memory, and Ithink it is closer to the POSIX standard.

The short description from the POSIX-derived man page states that^L should behave as follows:

"If in open mode, clear the screen and redisplay the current line. Otherwise, clear and redisplay the screen. Current line is unchanged. Current column is unchanged."

Nvi has no full open mode. Also, Nvi has never actually "cleared the screen" directly, leaving the decision up to curses, however, the standard also doesn't directly specify if the screen should actually be fullyrepainted (which I think it should, as that is what the clear implies) or justredrawn (as is, even if it was wrong).

Using^C in the situation above just printsInterrupted but doesn't change the screen contents as you can see below:

0BA5E844-8DB0-4D9F-BD86-9355F114672A

@lichray
Copy link
Owner

If that's your muscle memory, then you can simply

map ^R z^M

(See alsoz command in man nvi)

@johnsonjh
Copy link
ContributorAuthor

johnsonjh commentedFeb 27, 2022
edited
Loading

z still doesn't actually fix the screen. I'll attach a video with keystrokes visible.

@johnsonjh
Copy link
ContributorAuthor

johnsonjh commentedFeb 27, 2022
edited
Loading

NOTE: The^R at the enddoes work only because this PR is applied to this build.

MOV:https://user-images.githubusercontent.com/61629094/155870161-ddb3bdd8-a415-46de-9b0b-9cf9566291af.MOV

Hopefully this is helpful.

@lichray
Copy link
Owner

z<carriage-return> is the full form, that's why there is an extra^M at the end of the mapping. So when typing, it'sz<enter> rather thanz<esc>.

2022-02-26.22-11-34.mp4

I think the only problem is that it will move the current line to the top...

@lichraylichray merged commit16748b8 intolichray:mainFeb 27, 2022
@johnsonjh
Copy link
ContributorAuthor

Ah, yes, right you are. But moving the screen is still a problem.

This is something I'd most likely never have noticed outside of the context of#104 ... I'll take a look into that tomorrow, unless you beat me to it, as it's getting late here on the east coast.

But, I see you merged, so thanks very much for the quick response on these. Nvi2 is the most awesome nvi yet.

lichray reacted with laugh emoji

@johnsonjhjohnsonjh deleted the redraw-l branchFebruary 27, 2022 06:19
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@johnsonjh@lichray

[8]ページ先頭

©2009-2025 Movatter.jp