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

improve heuristic for when to refresh line in the REPL #17868

Merged
merged 4 commits into from
Aug 10, 2016

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Aug 6, 2016

Comparing pasting the same long function in the REPL before PR (above) and after PR (below): https://media.giphy.com/media/3o6Ztmlq9XLVMTqDgA/giphy.gif. The before PR version was going quite a while after I turned of the recording. Still not perfect, but better.

cc @vtjnash @Keno

Sort of fixes [no auto close] #15787

@kshyatt kshyatt added the REPL Julia's REPL (Read Eval Print Loop) label Aug 6, 2016
((position(s.input_buffer) + sizeof(s.p.prompt) + sizeof(str) - 1) < width(terminal(s)))
edit_insert(buf, str)
if !('\n' in str) && eof(buf) &&
((line_size(s) + sizeof(s.p.prompt) + sizeof(str) - 1) < width(terminal(s)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sizeof(s.p.prompt) only applies to the first line. the other lines use s.indent

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case someone somewhere has s.indent != strwidth(s.p.prompt)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, updated.

@KristofferC
Copy link
Member Author

Any further comments here? @vtjnash for the last commit with s.indent?

@KristofferC KristofferC merged commit f84b94c into master Aug 10, 2016
@KristofferC KristofferC deleted the kc/repl_refresh branch August 10, 2016 11:10
tkelman pushed a commit that referenced this pull request Aug 11, 2016
* improve heuristic for when to refresh line

* fix trailing whitespace...

* use indent when not on first line

* remove unused argument and change local var to not share name with function

(cherry picked from commit f84b94c)
mfasi pushed a commit to mfasi/julia that referenced this pull request Sep 5, 2016
* improve heuristic for when to refresh line

* fix trailing whitespace...

* use indent when not on first line

* remove unused argument and change local var to not share name with function
@coveralls
Copy link

Coverage Status

Coverage remained the same at ?% when pulling b21fa02 on kc/repl_refresh into ed125e9 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants