Skip to content

Commit

Permalink
Bugfix: Indent line guides not rendering correctly (onivim#354)
Browse files Browse the repository at this point in the history
* Get per-buffer indentation settings

* Fix

* Remove logging
  • Loading branch information
bryphe authored Jun 25, 2019
1 parent 1543e99 commit 6391365
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/editor/Store/IndentationStoreConnector.re
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,20 @@ let start = () => {
defaultInsertSpaces,
);

IndentationSettings.create(
~mode=guess.mode,
~size=guess.size,
~tabSize=
let size =
switch (guess.mode) {
| Tabs =>
Configuration.getValue(
c => c.editorTabSize,
state.configuration,
),
)
| Spaces => guess.size
};

IndentationSettings.create(
~mode=guess.mode,
~size,
~tabSize=size,
(),
);
} else {
Expand Down
6 changes: 5 additions & 1 deletion src/editor/UI/EditorSurface.re
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ let createElement =
let fontWidth = state.editorFont.measuredWidth;

let iFontHeight = int_of_float(fontHeight +. 0.5);
let indentation = IndentationSettings.default;
let indentation =
switch (Buffer.getIndentation(buffer)) {
| Some(v) => v
| None => IndentationSettings.default
};

let topVisibleLine = Editor.getTopVisibleLine(editor, metrics);
let bottomVisibleLine = Editor.getBottomVisibleLine(editor, metrics);
Expand Down

0 comments on commit 6391365

Please sign in to comment.