mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-22 00:19:24 +03:00
Append wrap guide to editor element
This prevents unneeded horizontal scrollbars when the wrap guide exceeds the buffer size and the buffer doesn't have any 80 character or greater lines
This commit is contained in:
parent
f95e67d8cd
commit
5301b29649
@ -17,10 +17,10 @@ describe "WrapGuide", ->
|
||||
describe "@initialize", ->
|
||||
it "appends a wrap guide to all existing and new editors", ->
|
||||
expect(rootView.panes.find('.pane').length).toBe 1
|
||||
expect(rootView.panes.find('.lines > .wrap-guide').length).toBe 1
|
||||
expect(rootView.panes.find('.editor > .wrap-guide').length).toBe 1
|
||||
editor.splitRight()
|
||||
expect(rootView.find('.pane').length).toBe 2
|
||||
expect(rootView.panes.find('.lines > .wrap-guide').length).toBe 2
|
||||
expect(rootView.panes.find('.editor > .wrap-guide').length).toBe 2
|
||||
|
||||
describe "@updateGuide", ->
|
||||
it "positions the guide at the configured column", ->
|
||||
|
@ -12,8 +12,8 @@ class WrapGuide extends View
|
||||
@appendToEditorPane(rootView, editor)
|
||||
|
||||
@appendToEditorPane: (rootView, editor) ->
|
||||
if lines = editor.pane()?.find('.lines')
|
||||
lines.append(new WrapGuide(rootView, editor))
|
||||
if parent = editor.pane()?.find('.editor')
|
||||
parent.append(new WrapGuide(rootView, editor))
|
||||
|
||||
@content: ->
|
||||
@div class: 'wrap-guide'
|
||||
|
Loading…
Reference in New Issue
Block a user