mirror of https://github.com/microsoft/edit
Add copyright headers to all files
This commit is contained in:
parent
0c14eb58fb
commit
d17cf66c7c
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::hint::black_box;
|
use std::hint::black_box;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
|
|
|
||||||
3
build.rs
3
build.rs
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
if std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default() == "windows" {
|
if std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default() == "windows" {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Provides a transparent error type for edit.
|
//! Provides a transparent error type for edit.
|
||||||
|
|
||||||
use std::{io, result};
|
use std::{io, result};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#![allow(clippy::missing_safety_doc, clippy::mut_from_ref)]
|
#![allow(clippy::missing_safety_doc, clippy::mut_from_ref)]
|
||||||
|
|
||||||
use std::alloc::{AllocError, Allocator, Layout};
|
use std::alloc::{AllocError, Allocator, Layout};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Arena allocators. Small and fast.
|
//! Arena allocators. Small and fast.
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#![allow(clippy::mut_from_ref)]
|
#![allow(clippy::mut_from_ref)]
|
||||||
|
|
||||||
use std::alloc::{AllocError, Allocator, Layout};
|
use std::alloc::{AllocError, Allocator, Layout};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::ops::{Bound, Deref, DerefMut, RangeBounds};
|
use std::ops::{Bound, Deref, DerefMut, RangeBounds};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Base64 facilities.
|
//! Base64 facilities.
|
||||||
|
|
||||||
use crate::arena::ArenaString;
|
use crate::arena::ArenaString;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::collections::LinkedList;
|
use std::collections::LinkedList;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use edit::framebuffer::IndexedColor;
|
use edit::framebuffer::IndexedColor;
|
||||||
use edit::helpers::*;
|
use edit::helpers::*;
|
||||||
use edit::icu;
|
use edit::icu;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use edit::arena_format;
|
use edit::arena_format;
|
||||||
use edit::helpers::*;
|
use edit::helpers::*;
|
||||||
use edit::input::{kbmod, vk};
|
use edit::input::{kbmod, vk};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use edit::framebuffer::{Attributes, IndexedColor};
|
use edit::framebuffer::{Attributes, IndexedColor};
|
||||||
use edit::helpers::*;
|
use edit::helpers::*;
|
||||||
use edit::input::vk;
|
use edit::input::vk;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use edit::arena::scratch_arena;
|
use edit::arena::scratch_arena;
|
||||||
use edit::sys;
|
use edit::sys;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)]
|
#![feature(let_chains, linked_list_cursors, os_string_truncate, string_from_utf8_lossy_owned)]
|
||||||
|
|
||||||
mod documents;
|
mod documents;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::ffi::{OsStr, OsString};
|
use std::ffi::{OsStr, OsString};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
use std::ptr::{self, NonNull};
|
use std::ptr::{self, NonNull};
|
||||||
use std::slice;
|
use std::slice;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! A text buffer for a text editor.
|
//! A text buffer for a text editor.
|
||||||
//!
|
//!
|
||||||
//! Implements a Unicode-aware, layout-aware text buffer for terminals.
|
//! Implements a Unicode-aware, layout-aware text buffer for terminals.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
|
|
||||||
use crate::document::ReadableDocument;
|
use crate::document::ReadableDocument;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! [`std::cell::RefCell`], but without runtime checks in release builds.
|
//! [`std::cell::RefCell`], but without runtime checks in release builds.
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Abstractions over reading/writing arbitrary text containers.
|
//! Abstractions over reading/writing arbitrary text containers.
|
||||||
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! A shoddy framebuffer for terminal applications.
|
//! A shoddy framebuffer for terminal applications.
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
|
||||||
|
|
@ -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`).
|
//! 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`,
|
//! 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.
|
//! but I figured that this one is what lots of people may be familiar with.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Provides fast, non-cryptographic hash functions.
|
//! Provides fast, non-cryptographic hash functions.
|
||||||
|
|
||||||
/// The venerable wyhash hash function.
|
/// The venerable wyhash hash function.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Random assortment of helpers I didn't know where to put.
|
//! Random assortment of helpers I didn't know where to put.
|
||||||
|
|
||||||
use std::alloc::Allocator;
|
use std::alloc::Allocator;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Bindings to the ICU library.
|
//! Bindings to the ICU library.
|
||||||
|
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Parses VT sequences into input events.
|
//! Parses VT sequences into input events.
|
||||||
//!
|
//!
|
||||||
//! In the future this allows us to take apart the application and
|
//! In the future this allows us to take apart the application and
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#![feature(
|
#![feature(
|
||||||
allocator_api,
|
allocator_api,
|
||||||
breakpoint,
|
breakpoint,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Oklab colorspace conversions.
|
//! Oklab colorspace conversions.
|
||||||
//!
|
//!
|
||||||
//! Implements Oklab as defined at: <https://bottosson.github.io/posts/oklab/>
|
//! Implements Oklab as defined at: <https://bottosson.github.io/posts/oklab/>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Path related helpers.
|
//! Path related helpers.
|
||||||
|
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! `memchr`, but with two needles.
|
//! `memchr`, but with two needles.
|
||||||
|
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! `memchr`, but with two needles.
|
//! `memchr`, but with two needles.
|
||||||
|
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! `memchr` for arbitrary sizes (1/2/4/8 bytes).
|
//! `memchr` for arbitrary sizes (1/2/4/8 bytes).
|
||||||
//!
|
//!
|
||||||
//! Clang calls the C `memset` function only for byte-sized types (or 0 fills).
|
//! Clang calls the C `memset` function only for byte-sized types (or 0 fills).
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Provides various high-throughput utilities.
|
//! Provides various high-throughput utilities.
|
||||||
|
|
||||||
mod memchr2;
|
mod memchr2;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Platform abstractions.
|
//! Platform abstractions.
|
||||||
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Unix-specific platform code.
|
//! Unix-specific platform code.
|
||||||
//!
|
//!
|
||||||
//! Read the `windows` module for reference.
|
//! Read the `windows` module for reference.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::ffi::{CStr, OsString, c_void};
|
use std::ffi::{CStr, OsString, c_void};
|
||||||
use std::fmt::Write as _;
|
use std::fmt::Write as _;
|
||||||
use std::fs::{self, File};
|
use std::fs::{self, File};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! An immediate mode UI framework for terminals.
|
//! An immediate mode UI framework for terminals.
|
||||||
//!
|
//!
|
||||||
//! # Why immediate mode?
|
//! # Why immediate mode?
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::hint::cold_path;
|
use std::hint::cold_path;
|
||||||
|
|
||||||
use super::Utf8Chars;
|
use super::Utf8Chars;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Everything related to Unicode lives here.
|
//! Everything related to Unicode lives here.
|
||||||
|
|
||||||
mod measurement;
|
mod measurement;
|
||||||
|
|
|
||||||
|
|
@ -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
|
// 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]
|
#[rustfmt::skip]
|
||||||
const STAGE0: [u16; 544] = [
|
const STAGE0: [u16; 544] = [
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
use std::{hint, iter};
|
use std::{hint, iter};
|
||||||
|
|
||||||
/// An iterator over UTF-8 encoded characters.
|
/// An iterator over UTF-8 encoded characters.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
//! Our VT parser.
|
//! Our VT parser.
|
||||||
|
|
||||||
use std::{mem, time};
|
use std::{mem, time};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
mod rules;
|
mod rules;
|
||||||
|
|
||||||
use crate::rules::{JOIN_RULES_GRAPHEME_CLUSTER, JOIN_RULES_LINE_BREAK};
|
use crate::rules::{JOIN_RULES_GRAPHEME_CLUSTER, JOIN_RULES_LINE_BREAK};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
// Used as an indicator in our rules for ÷ ("does not join").
|
// Used as an indicator in our rules for ÷ ("does not join").
|
||||||
// Underscore is one of the few characters that are permitted as an identifier,
|
// 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.
|
// are monospace in most fonts and also visually distinct from the digits.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue