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

Auto-wrapping long lines #32

Open
girtsf opened this issue May 1, 2017 · 2 comments
Open

Auto-wrapping long lines #32

girtsf opened this issue May 1, 2017 · 2 comments
Assignees

Comments

@girtsf
Copy link

girtsf commented May 1, 2017

It's probably a quite tricky thing to implement, but it would be nice if there was an option to autowrap long (e.g., > 79 chars) lines. Some sort of heuristics could be used to figure out where to break the lines, e.g., first try breaking at "=". Then if either of parts is still too long, break farthest down the line that puts the line (w/ added ...) under the line limit.

@davidvarga davidvarga self-assigned this May 2, 2017
@davidvarga davidvarga added this to the Version v1.3 milestone May 2, 2017
@davidvarga
Copy link
Owner

I will think about this one also. In the current structure it is really difficult to implement such a thinkg (this project started to provide really basic and limited formatting capabilities, and then as the requirement list was growing, I had to attach new things to the existing structure as I never had enough time to re-build it completely.) Originally I wanted to discontinue the project as I was expecting R2017 to be shipped with auto-format feature, but as it found out that this feature still does not exists (and seems not to be planned for R2018) I decided that I will do a java based reimplementation because I had problems coming from ML version-differences and I also expect a performance jump. Long story short: I will investigate the possibility to add this feature in the last M-based release. It I feel it realyl cumbersome, I will try to keep this in mind when doing the architecture for the java-based version :)

@davidvarga davidvarga removed this from the Version v1.3 milestone Jun 6, 2017
@Adlch
Copy link

Adlch commented Jan 11, 2018

Sounds like a very nice feature to add.
I accidentally saw an implement of Matlab for a similar feature, they use it for the function "publish". I didn't understand how exactly it works, but it resides inside matlabroot\toolbox\matlab\codetools\private\evalmxdom.m . The relevant piece there is:

% For consistency, set the published output to 80 columns, regardless of
% the current Command Window width.
originalEightyColumns = feature('EightyColumns');
resetEightyColumnsObj = onCleanup(...
@()feature('EightyColumns',originalEightyColumns) );
feature('EightyColumns',1)

If someone would investigate it and can add it to that tool, it will be cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants