Add copyright headers to all files

This commit is contained in:
Leonard Hecker 2025-05-17 01:27:34 +02:00
parent 0c14eb58fb
commit d17cf66c7c
46 changed files with 138 additions and 0 deletions

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::hint::black_box;
use std::mem;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
fn main() {
#[cfg(windows)]
if std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default() == "windows" {

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Provides a transparent error type for edit.
use std::{io, result};

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(clippy::missing_safety_doc, clippy::mut_from_ref)]
use std::alloc::{AllocError, Allocator, Layout};

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Arena allocators. Small and fast.
#[cfg(debug_assertions)]

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(clippy::mut_from_ref)]
use std::alloc::{AllocError, Allocator, Layout};

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::ops::Deref;
#[cfg(debug_assertions)]

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::fmt;
use std::ops::{Bound, Deref, DerefMut, RangeBounds};

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Base64 facilities.
use crate::arena::ArenaString;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::collections::LinkedList;
use std::ffi::OsStr;
use std::fs::File;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use edit::framebuffer::IndexedColor;
use edit::helpers::*;
use edit::icu;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::cmp::Ordering;
use std::fs;
use std::path::PathBuf;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use edit::arena_format;
use edit::helpers::*;
use edit::input::{kbmod, vk};

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use edit::framebuffer::{Attributes, IndexedColor};
use edit::helpers::*;
use edit::input::vk;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use edit::arena::scratch_arena;
use edit::sys;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![feature(let_chains, linked_list_cursors, os_string_truncate, string_from_utf8_lossy_owned)]
mod documents;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::borrow::Cow;
use std::ffi::{OsStr, OsString};
use std::mem;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::ops::Range;
use std::ptr::{self, NonNull};
use std::slice;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! A text buffer for a text editor.
//!
//! Implements a Unicode-aware, layout-aware text buffer for terminals.

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::ops::Range;
use crate::document::ReadableDocument;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! [`std::cell::RefCell`], but without runtime checks in release builds.
#[cfg(debug_assertions)]

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Abstractions over reading/writing arbitrary text containers.
use std::ffi::OsString;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! A shoddy framebuffer for terminal applications.
use std::cell::Cell;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Fuzzy search algorithm based on the one used in VS Code (`/src/vs/base/common/fuzzyScorer.ts`).
//! Other algorithms exist, such as Sublime Text's, or the one used in `fzf`,
//! but I figured that this one is what lots of people may be familiar with.

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Provides fast, non-cryptographic hash functions.
/// The venerable wyhash hash function.

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Random assortment of helpers I didn't know where to put.
use std::alloc::Allocator;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Bindings to the ICU library.
use std::cmp::Ordering;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Parses VT sequences into input events.
//!
//! In the future this allows us to take apart the application and

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![feature(
allocator_api,
breakpoint,

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Oklab colorspace conversions.
//!
//! Implements Oklab as defined at: <https://bottosson.github.io/posts/oklab/>

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Path related helpers.
use std::ffi::OsStr;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! `memchr`, but with two needles.
use std::ptr;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! `memchr`, but with two needles.
use std::ptr;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! `memchr` for arbitrary sizes (1/2/4/8 bytes).
//!
//! Clang calls the C `memset` function only for byte-sized types (or 0 fills).

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Provides various high-throughput utilities.
mod memchr2;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Platform abstractions.
use std::fs::File;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Unix-specific platform code.
//!
//! Read the `windows` module for reference.

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::ffi::{CStr, OsString, c_void};
use std::fmt::Write as _;
use std::fs::{self, File};

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! An immediate mode UI framework for terminals.
//!
//! # Why immediate mode?

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::hint::cold_path;
use super::Utf8Chars;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Everything related to Unicode lives here.
mod measurement;

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// BEGIN: Generated by grapheme-table-gen on 2025-03-31T16:50:08Z, from Unicode 16.0.0, with --lang=rust --extended --no-ambiguous --line-breaks, 16950 bytes
#[rustfmt::skip]
const STAGE0: [u16; 544] = [

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::{hint, iter};
/// An iterator over UTF-8 encoded characters.

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Our VT parser.
use std::{mem, time};

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
mod rules;
use crate::rules::{JOIN_RULES_GRAPHEME_CLUSTER, JOIN_RULES_LINE_BREAK};

View file

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// Used as an indicator in our rules for ÷ ("does not join").
// Underscore is one of the few characters that are permitted as an identifier,
// are monospace in most fonts and also visually distinct from the digits.