wiki/include: Document border special case
Browse files at this commite5b0662f4867490daba0aa9b8a9e14f429c5df16Parent: 39339031 changed file +27 -0
docs/wiki/Configuration:-Include.mdmodified+27 -0
| @@ -241,3 +241,30 @@ include "struts.kdl" | |||
| 241 | // Struts are not merged. | 241 | // Struts are not merged. |
| 242 | // End result is only left and right struts. | 242 | // End result is only left and right struts. |
| 243 | ``` | 243 | ``` |
| 244 | + | ||
| 245 | +### Border special case | ||
| 246 | + | ||
| 247 | +There's one special case that differs between the main config and included configs. | ||
| 248 | + | ||
| 249 | +Writing `layout { border {} }` in an included config does nothing (since no properties are changed). | ||
| 250 | +However, writing the same in the main config will *enable* the border, i.e. it's equivalent to `layout { border { on; } }`. | ||
| 251 | + | ||
| 252 | +So, if you want to move your layout configuration from the main config to a separate file, remember to add `on` to the border section, for example: | ||
| 253 | + | ||
| 254 | +```kdl | ||
| 255 | +// separate.kdl | ||
| 256 | +layout { | ||
| 257 | + border { | ||
| 258 | + // Add this line: | ||
| 259 | + on | ||
| 260 | + | ||
| 261 | + width 4 | ||
| 262 | + active-color "#ffc87f" | ||
| 263 | + inactive-color "#505050" | ||
| 264 | + } | ||
| 265 | +} | ||
| 266 | +``` | ||
| 267 | + | ||
| 268 | +The reason for this special case is that this is how it historically worked: back when I added borders, we didn't have any `on` flags, so I made writing the `border {}` section enable the border, with an explicit `off` to disable it. | ||
| 269 | +It wouldn't be too problematic to change it, however the default config always had a pre-filled `layout { border { off; } }` section with a note saying that commenting out the `off` is enough to enable the border. | ||
| 270 | +Many people likely have this part of the default config embedded in their configs now, so changing how it works would just cause a lot of confusion. | ||