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

Not splitting lines when word wrapped is on makes jumping difficult to pick the location because text position changes #41

Open
excetara2 opened this issue May 2, 2016 · 9 comments

Comments

@excetara2
Copy link

If you have a document that is soft word-wrapped like markdown or Latex and you issue a jump_to_word or jump_to_char it changes the word wrapping so it is really hard to visualize where you want to jump because all the text is now moved to a different location.

I noticed the problem is that it doesn't split up a line in the middle (eg. Table~\ref{tbl:chord_data_sets} will move to the next line unstead of being split across two lines). This then propagates down through the text so makes it really difficult to pick a location. Is there anyway around this besides hard wrapping each paragraph as then it works fine or turning word-wrapping off?

@excetara2
Copy link
Author

Is there a way to tel it to break long words when word wrapping instead of forcing them to the next line?

Like in word wrap plus the setting:

"WrapPlus.break_long_words"

I think this could solve this problem because it is forcing breaking these long words to the next line

@ice9js
Copy link
Owner

ice9js commented May 25, 2016

AceJump shouldn't affect any word wrapping settings in Sublime Text. So if you have it turned off, it should remain that way. If you have it on, it shouldn't change when you use AceJump.

Since I've been unable to reproduce this issue so far, it would be helpful if you could tell me what build of Sublime Text you are using and share a screen cap of the issue.

As for the wrap plus plugin, you could try just installing it and using it alongside AceJump and see if that solves the issue.

@excetara2
Copy link
Author

excetara2 commented May 25, 2016

Yeah sorry should have done a screen cap earlier to give an example. I am using build 3107 so a recent build.

This is the before:
image

This is the after with two different jumps but same thing happens no matter the front character selected Nucleus\ wraps around in the first paragraph as well as the (NMT). Here the misalignment isn't so bad but I have times where it basically makes it unusable because so much of the text ends up changing. You can start to see this at the bottom of the page once it has propagated down it gets worse and worse. I have folds I just realized but this happens with or without folds. Maybe it has to do with some latex settings with word wrap:
image

image

@ice9js
Copy link
Owner

ice9js commented Jun 1, 2016

Build 3114 came out recently, and apparently they did some tweaking to word-wrap behaviour. Would you mind trying to update and see if that fixes your issue ? I have seen some improvements on my side.

@excetara2
Copy link
Author

No it is because when writing latex I don't use word wrap and if there are things like \ref{blahblahblah-this-is-a-really-long-ref-with-no-line-breaks} then it will always wrap to the next line when using the acejump but the regular word-wrap breaks these commands so they word wrap at wherever they occur.

@excetara2
Copy link
Author

Okay I've realized it is something to do with the latex word wrap behaviour is modified because if I copy the text to a blank buffer and paste it. Then \ref{blahblahblah-this-is-a-really-long-ref-with-no-line-breaks} will be broken unless it is the length of the line. I am guessing I need to incorporate this differed behaviour into acejump for latex buffers. I will try to ask the package maintainers because I've submitted some patches to the LaTex plugin to see if they modified the behaviour.

@ice9js
Copy link
Owner

ice9js commented Jun 1, 2016

I'm guessing it has to do with the latex syntax definition. Since there is no syntax definition for the AceJump highlighting, it's all just one big comment, when you write a long, continuous expression, it will assume it's just one big word. Latex syntax would actually be able to tell the words in the expression apart, given some non-word characters like \ occur.

But that's just my guess and I'm not sure how to approach this yet as the plugin has to work independently of the language/syntax highlighting.

@excetara2
Copy link
Author

excetara2 commented Jun 1, 2016

Yeah that would make sense that it allows breaking in certain commands like \cite and \ref because this isn't the case in a normal buffer without latex syntax. I guess there is no easy way to modify the word wrap behaviour like these syntaxes do as you say?

@excetara2
Copy link
Author

I found this old posts that seems it has to do with the tMlanguage files but yes can affect other syntaxes like python:

https://forum.sublimetext.com/t/word-wrapping-in-latex-files-st-st2/1403/12

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

No branches or pull requests

2 participants