This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- mod-version:3 | |
| local command = require "core.command" | |
| local keymap = require "core.keymap" | |
| local translate = require "core.doc.translate" | |
| command.add("core.docview", { | |
| ["doc:transpose-chars"] = function(dv) | |
| local doc = dv.doc | |
| for idx, line, col, line2, col2 in doc:get_selections(true, true) do | |
| local has_no_selection = line == line2 and col == col2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- mod-version:3 | |
| -- Indent Guide, synced with the code folding plugin (codefold.lua). | |
| -- | |
| -- In codefold mode the guides are not derived from raw whitespace but from | |
| -- the fold regions that the code folding plugin detects on the DocView | |
| -- (view.cf_regions). A vertical guide is drawn on a line, at a given indent | |
| -- level, only when that line is inside a fold region that starts at that | |
| -- level. Continuation/alignment lines (e.g. wrapped function call arguments | |
| -- aligned under an opening parenthesis) are interior lines of the region | |
| -- started by the statement header, so they only get the guides of their |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module dub; | |
| import std::io; | |
| struct Dub { | |
| String[] args; | |
| int i; | |
| int savepoint_i; | |
| } | |
| // ----- API ----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- light | |
| local style = require "core.style" | |
| local common = require "core.common" | |
| local NIGHT_MODE_INTENSITY = 30 -- [0, 1, ... 100] | |
| local function clamp(min, max, value) | |
| return math.max(min, math.min(max, value)) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- mod-version:3 | |
| local core = require "core" | |
| local command = require "core.command" | |
| local keymap = require "core.keymap" | |
| ------------------- | |
| -- Configuration -- | |
| ------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## | |
| PersistentVector | |
| 32-way persistent vector, equivalent to Clojure's PersistentVector. | |
| Public API: | |
| Instantiation: | |
| let vec = PersistentVector.empty() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --[[ | |
| -- =========== | |
| -- Usage | |
| -- =========== | |
| local F = require("frequration") | |
| -- Full list of avaliable constructors can be found in the source code. | |
| F.register_globals() | |
| -- ====================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pp = function(t) | |
| print("{ " .. table.concat(t, ", ") .. " }") | |
| end | |
| a = function() return 1, 2 end | |
| b = function() return 11, 12 end | |
| pp { a(), b(), "why?"} -- { 1, 11, "why?" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local function unzip(input_path) | |
| -- Open the archive file for reading | |
| local archive_file = io.open(input_path, "r") | |
| if not archive_file then | |
| error("Could not open file: " .. input_path) | |
| end | |
| local current_file = nil | |
| local current_content = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [16] # Version number. Do not delete. | |
| # Based on the original Lite Light theme: | |
| # https://github.com/pragtical/colors/blob/master/colors/lite-light.lua | |
| [colors] | |
| background0: F5F5F5FF | |
| background1: E0E0E0FF | |
| background2: E0E0E0FF | |
| background3: E0E0E0FF |
NewerOlder