| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -21,6 +21,7 @@ | |
|
|
||
| from __future__ import annotations | ||
| import os | ||
| import time | ||
|
|
||
| # Categories of actions: | ||
| # killing | ||
| Expand All | @@ -31,6 +32,7 @@ | |
| # finishing | ||
| # [completion] | ||
|
|
||
| from .trace import trace | ||
|
|
||
| # types | ||
| if False: | ||
| Expand Down Expand Up | @@ -471,19 +473,24 @@ def do(self) -> None: | |
|
|
||
|
|
||
| class paste_mode(Command): | ||
|
|
||
| def do(self) -> None: | ||
| self.reader.paste_mode = not self.reader.paste_mode | ||
| self.reader.dirty = True | ||
|
|
||
|
|
||
| class enable_bracketed_paste(Command): | ||
| def do(self) -> None: | ||
| self.reader.paste_mode = True | ||
| self.reader.in_bracketed_paste = True | ||
|
|
||
| class disable_bracketed_paste(Command): | ||
| def do(self) -> None: | ||
| self.reader.paste_mode = False | ||
| self.reader.in_bracketed_paste = False | ||
| self.reader.dirty = True | ||
| class perform_bracketed_paste(Command): | ||
| def do(self) -> None: | ||
| done = "\x1b[201~" | ||
|
Comment thread
ambv marked this conversation as resolved.
|
||
| data = "" | ||
| start = time.time() | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityLeftover from testing?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThe trace below shows time. I can move the import up.
Sorry, something went wrong.
pablogsal reacted with thumbs up emoji
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThen use perf_counter please
Sorry, something went wrong.
All reactions
|
||
| while done not in data: | ||
| self.reader.console.wait(100) | ||
| ev = self.reader.console.getpending() | ||
| data += ev.data | ||
| trace( | ||
| "bracketed pasting of {l} chars done in {s:.2f}s", | ||
| l=len(data), | ||
| s=time.time() - start, | ||
| ) | ||
| self.reader.insert(data.replace(done, "")) | ||
| self.reader.last_refresh_cache.invalidated = True | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.