diff --git a/benches/lib.rs b/benches/lib.rs index 395f10f..1131f34 100644 --- a/benches/lib.rs +++ b/benches/lib.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use std::hint::black_box; use std::mem; diff --git a/build.rs b/build.rs index e5ef535..2e52f02 100644 --- a/build.rs +++ b/build.rs @@ -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" { diff --git a/src/apperr.rs b/src/apperr.rs index bb6ee4d..b1dd6d2 100644 --- a/src/apperr.rs +++ b/src/apperr.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Provides a transparent error type for edit. use std::{io, result}; diff --git a/src/arena/debug.rs b/src/arena/debug.rs index 34209ae..4b1ae6c 100644 --- a/src/arena/debug.rs +++ b/src/arena/debug.rs @@ -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}; diff --git a/src/arena/mod.rs b/src/arena/mod.rs index ac43fb9..a7099c7 100644 --- a/src/arena/mod.rs +++ b/src/arena/mod.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Arena allocators. Small and fast. #[cfg(debug_assertions)] diff --git a/src/arena/release.rs b/src/arena/release.rs index 8edcc8d..dec572c 100644 --- a/src/arena/release.rs +++ b/src/arena/release.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + #![allow(clippy::mut_from_ref)] use std::alloc::{AllocError, Allocator, Layout}; diff --git a/src/arena/scratch.rs b/src/arena/scratch.rs index c359a05..a719db4 100644 --- a/src/arena/scratch.rs +++ b/src/arena/scratch.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use std::ops::Deref; #[cfg(debug_assertions)] diff --git a/src/arena/string.rs b/src/arena/string.rs index c7e2ebc..ff70ec1 100644 --- a/src/arena/string.rs +++ b/src/arena/string.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use std::fmt; use std::ops::{Bound, Deref, DerefMut, RangeBounds}; diff --git a/src/base64.rs b/src/base64.rs index e1f4de1..bce13c6 100644 --- a/src/base64.rs +++ b/src/base64.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Base64 facilities. use crate::arena::ArenaString; diff --git a/src/bin/edit/documents.rs b/src/bin/edit/documents.rs index 1ca5693..349f4f3 100644 --- a/src/bin/edit/documents.rs +++ b/src/bin/edit/documents.rs @@ -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; diff --git a/src/bin/edit/draw_editor.rs b/src/bin/edit/draw_editor.rs index ecf8fd4..bdab25a 100644 --- a/src/bin/edit/draw_editor.rs +++ b/src/bin/edit/draw_editor.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use edit::framebuffer::IndexedColor; use edit::helpers::*; use edit::icu; diff --git a/src/bin/edit/draw_filepicker.rs b/src/bin/edit/draw_filepicker.rs index 6e51450..5bb30b4 100644 --- a/src/bin/edit/draw_filepicker.rs +++ b/src/bin/edit/draw_filepicker.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use std::cmp::Ordering; use std::fs; use std::path::PathBuf; diff --git a/src/bin/edit/draw_menubar.rs b/src/bin/edit/draw_menubar.rs index 3266b3c..95176c3 100644 --- a/src/bin/edit/draw_menubar.rs +++ b/src/bin/edit/draw_menubar.rs @@ -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}; diff --git a/src/bin/edit/draw_statusbar.rs b/src/bin/edit/draw_statusbar.rs index 4b1dcb7..ecbc5e4 100644 --- a/src/bin/edit/draw_statusbar.rs +++ b/src/bin/edit/draw_statusbar.rs @@ -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; diff --git a/src/bin/edit/localization.rs b/src/bin/edit/localization.rs index 55a7d11..115f888 100644 --- a/src/bin/edit/localization.rs +++ b/src/bin/edit/localization.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use edit::arena::scratch_arena; use edit::sys; diff --git a/src/bin/edit/main.rs b/src/bin/edit/main.rs index f2cfc26..f4442a2 100644 --- a/src/bin/edit/main.rs +++ b/src/bin/edit/main.rs @@ -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; diff --git a/src/bin/edit/state.rs b/src/bin/edit/state.rs index 88df404..df0d3b3 100644 --- a/src/bin/edit/state.rs +++ b/src/bin/edit/state.rs @@ -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; diff --git a/src/buffer/gap_buffer.rs b/src/buffer/gap_buffer.rs index 12942c7..c78e84b 100644 --- a/src/buffer/gap_buffer.rs +++ b/src/buffer/gap_buffer.rs @@ -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; diff --git a/src/buffer/mod.rs b/src/buffer/mod.rs index 2972b1a..8521285 100644 --- a/src/buffer/mod.rs +++ b/src/buffer/mod.rs @@ -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. diff --git a/src/buffer/navigation.rs b/src/buffer/navigation.rs index cac5ed2..a3c6aa8 100644 --- a/src/buffer/navigation.rs +++ b/src/buffer/navigation.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use std::ops::Range; use crate::document::ReadableDocument; diff --git a/src/cell.rs b/src/cell.rs index 64f9e3f..0e29039 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -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)] diff --git a/src/document.rs b/src/document.rs index 64b6fec..0ae9eb8 100644 --- a/src/document.rs +++ b/src/document.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Abstractions over reading/writing arbitrary text containers. use std::ffi::OsString; diff --git a/src/framebuffer.rs b/src/framebuffer.rs index a33353e..6c96e9f 100644 --- a/src/framebuffer.rs +++ b/src/framebuffer.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! A shoddy framebuffer for terminal applications. use std::cell::Cell; diff --git a/src/fuzzy.rs b/src/fuzzy.rs index 48f38ba..a449d7a 100644 --- a/src/fuzzy.rs +++ b/src/fuzzy.rs @@ -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. diff --git a/src/hash.rs b/src/hash.rs index 914d48d..0634529 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Provides fast, non-cryptographic hash functions. /// The venerable wyhash hash function. diff --git a/src/helpers.rs b/src/helpers.rs index c1f6b1b..569218d 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -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; diff --git a/src/icu.rs b/src/icu.rs index 45c8433..0829970 100644 --- a/src/icu.rs +++ b/src/icu.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Bindings to the ICU library. use std::cmp::Ordering; diff --git a/src/input.rs b/src/input.rs index 204eb2e..88a32ac 100644 --- a/src/input.rs +++ b/src/input.rs @@ -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 diff --git a/src/lib.rs b/src/lib.rs index 503c3e7..ed0b978 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + #![feature( allocator_api, breakpoint, diff --git a/src/oklab.rs b/src/oklab.rs index 9759cce..5af68bf 100644 --- a/src/oklab.rs +++ b/src/oklab.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Oklab colorspace conversions. //! //! Implements Oklab as defined at: diff --git a/src/path.rs b/src/path.rs index 1b49b2e..45ba6ac 100644 --- a/src/path.rs +++ b/src/path.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Path related helpers. use std::ffi::OsStr; diff --git a/src/simd/memchr2.rs b/src/simd/memchr2.rs index 9b8ff10..be2980e 100644 --- a/src/simd/memchr2.rs +++ b/src/simd/memchr2.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! `memchr`, but with two needles. use std::ptr; diff --git a/src/simd/memrchr2.rs b/src/simd/memrchr2.rs index c5b7bf8..26a5a55 100644 --- a/src/simd/memrchr2.rs +++ b/src/simd/memrchr2.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! `memchr`, but with two needles. use std::ptr; diff --git a/src/simd/memset.rs b/src/simd/memset.rs index 7748440..028b66b 100644 --- a/src/simd/memset.rs +++ b/src/simd/memset.rs @@ -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). diff --git a/src/simd/mod.rs b/src/simd/mod.rs index a114135..79414d8 100644 --- a/src/simd/mod.rs +++ b/src/simd/mod.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Provides various high-throughput utilities. mod memchr2; diff --git a/src/sys/mod.rs b/src/sys/mod.rs index df204a8..f5305c0 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Platform abstractions. use std::fs::File; diff --git a/src/sys/unix.rs b/src/sys/unix.rs index 5ef9b50..b32d9a9 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Unix-specific platform code. //! //! Read the `windows` module for reference. diff --git a/src/sys/windows.rs b/src/sys/windows.rs index 4a1bae5..952ca47 100644 --- a/src/sys/windows.rs +++ b/src/sys/windows.rs @@ -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}; diff --git a/src/tui.rs b/src/tui.rs index 6407ec6..fc7db5f 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! An immediate mode UI framework for terminals. //! //! # Why immediate mode? diff --git a/src/unicode/measurement.rs b/src/unicode/measurement.rs index eb1540d..7f64538 100644 --- a/src/unicode/measurement.rs +++ b/src/unicode/measurement.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use std::hint::cold_path; use super::Utf8Chars; diff --git a/src/unicode/mod.rs b/src/unicode/mod.rs index ee139ee..20cf301 100644 --- a/src/unicode/mod.rs +++ b/src/unicode/mod.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Everything related to Unicode lives here. mod measurement; diff --git a/src/unicode/tables.rs b/src/unicode/tables.rs index c90882e..dc2ffa4 100644 --- a/src/unicode/tables.rs +++ b/src/unicode/tables.rs @@ -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] = [ diff --git a/src/unicode/utf8.rs b/src/unicode/utf8.rs index 7fcefc7..7ad05dd 100644 --- a/src/unicode/utf8.rs +++ b/src/unicode/utf8.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + use std::{hint, iter}; /// An iterator over UTF-8 encoded characters. diff --git a/src/vt.rs b/src/vt.rs index 2306ce5..31701c0 100644 --- a/src/vt.rs +++ b/src/vt.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Our VT parser. use std::{mem, time}; diff --git a/tools/grapheme-table-gen/src/main.rs b/tools/grapheme-table-gen/src/main.rs index c0e0410..6e05d5a 100644 --- a/tools/grapheme-table-gen/src/main.rs +++ b/tools/grapheme-table-gen/src/main.rs @@ -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}; diff --git a/tools/grapheme-table-gen/src/rules.rs b/tools/grapheme-table-gen/src/rules.rs index 9fe7874..7ddadb3 100644 --- a/tools/grapheme-table-gen/src/rules.rs +++ b/tools/grapheme-table-gen/src/rules.rs @@ -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.