Skip to content

Commit 1871dc4

Browse files
fix: disable rendering when left column is non 0
## Details There was exsting logic meant to disable rendering content when the user scrolls to the right. This is because several elements would need to alter their behavior based on the column and we would need a complicated mechanism to handle hidden elements unloading causing misalignment. Rather than add all this complication for the relatively small benefit I decided that simply not rendering anything was a better approach. The logic for this was gated by: `not util.view(win).leftcol == 0` This does not work because of how the `not` gets assigned: - What I though: `not (util.view(win).leftcol == 0)` - Reality: `(not util.view(win).leftcol) == 0` This would effectively become: `false == 0`, which would never evaluate to `true`, woops. The fix is to simply use `~= 0` instead.
1 parent bea6f20 commit 1871dc4

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
## Pre-release
44

5+
### Features
6+
7+
- custom checkbox scope_highlight [#207](https://github.com/MeanderingProgrammer/render-markdown.nvim/issues/207)
8+
[2f36ac1](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/2f36ac16df20e0c6512f14e2793f7b2ba235989c)
9+
10+
### Bug Fixes
11+
12+
- skip updates when state is disabled [#208](https://github.com/MeanderingProgrammer/render-markdown.nvim/issues/208)
13+
[bea6f20](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/bea6f2078e34abdf5c2632f593651bb13205477f)
14+
515
## 7.4.0 (2024-10-16)
616

717
### Features

doc/render-markdown.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2024 October 17
1+
*render-markdown.txt* For 0.10.0 Last change: 2024 October 18
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*

lua/render-markdown/core/ui.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function M.next_state(config, win, mode)
147147
if util.get_win(win, 'diff') then
148148
return 'default'
149149
end
150-
if not util.view(win).leftcol == 0 then
150+
if util.view(win).leftcol ~= 0 then
151151
return 'default'
152152
end
153153
if not config:render(mode) then

lua/render-markdown/health.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local state = require('render-markdown.state')
44
local M = {}
55

66
---@private
7-
M.version = '7.4.2'
7+
M.version = '7.4.3'
88

99
function M.check()
1010
M.start('version')

0 commit comments

Comments
 (0)