-
Notifications
You must be signed in to change notification settings - Fork 5
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
CursorRuler changes behavior of "Wrap Paragraph at Ruler" #3
Comments
I could not replicate this bug in ST2 or ST3. The "Wrap Paragraph at Ruler" command as well as all the other wrap commands in the Edit > Wrap menu work fine for me with CursorRuler enabled. Are you saying this bug only occurs when CursorRuler is enabled ? Have you tried disabling it and seeing if the bug goes away or persists ? There shouldn't be any code within CursorRuler that would edit the contents of a view buffer. |
Interesting! I'll provide more information, then. The version of Sublime Text 3 I'm using is "Dev Channel, 3052" on Mac OS 10.7.4. Here's a video demonstration of the bug: http://cl.ly/1b021S3W3T0h There are 3 parts:
|
Thank you for the video demonstration ! I followed the steps that you have shown but was still unable to reproduce the effect you're getting. I would suggest doing a clean install of ST3 with Package Control and trying this experiment again. I just did that myself using the following settings in my user preferences for the sake of this experiment: { This worked for me. Does this work for you ? |
You're welcome! If I use settings you just shared, I cannot reproduce the bug. However, if I revert back to the defaults (used in the video and shown below), the bug returns. // Columns in which to display vertical rulers
"rulers": [],
// Disables horizontal scrolling if enabled.
// May be set to true, false, or "auto", where it will be disabled for
// source code, and otherwise enabled.
"word_wrap": "auto",
// Set to a value other than 0 to force wrapping at that column rather than the
// window width
"wrap_width": 0, |
Ah, interesting !!! I was finally able to reproduce the errant behavior just by using both Since CursorRuler is essentially a hack of the In theory, the way to get around this would be to bind the menu options and shortcut keys that use the I did a quick search and found a thread on running multiple commands in tandem: http://www.sublimetext.com/forum/viewtopic.php?f=5&t=8677&start=0 It's currently an imperfect solution because if CursorRuler was disabled before the wrapping attempt was made then it would be toggled on as the wrapping happens and therefore interfere with it before being toggled off again. I may update I will of course try to implement this theoretical solution in the next CursorRuler release ! |
=============================== - General code improvement. - The CursorRuler settings are now accessible from the "Preferences" -> "Package Settings" menu. - Fix for #2: Custom user settings were not being picked up. - Fix for #3: Default line wrapping was behaving unexpectedly. Created a new command called `CursorRuler: Wrap Lines` for doing line wrapping properly. - Started using Package Control messages. - Updated readme: Made more use of GitHub Flavored Markdown. - Updated readme: Noted that one of the minor bugs is ST2-only.
I just made a new release which implements a slightly refined version of the workaround I offered. Hopefully it works for you ! |
Also, note that the "Wrap Paragraph at Ruler" menu item still uses the normal wrapping command. It seems that there isn't a way to override ST's default menu items. |
When CursorRuler is enabled, it appears to change the behavior of the "Wrap Paragraph at Ruler" (
wrapLines
) command. When the command is invoked, instead of wrapping at a fixed width (ex. 80 characters), it wraps at the cursor's current location.To work around this bug, I'm overriding the default key binding to include a
width
argument. For example:The text was updated successfully, but these errors were encountered: