Preserve newlines and get closest cursor on reload, fixes #390
This commit is contained in:
parent
801c7fa68c
commit
117f00337d
3 changed files with 157 additions and 134 deletions
|
|
@ -27,7 +27,6 @@ use cosmic_files::{
|
|||
};
|
||||
use cosmic_text::{Cursor, Edit, Family, Selection, SwashCache, SyntaxSystem, ViMode};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
use std::{
|
||||
any::TypeId,
|
||||
collections::HashMap,
|
||||
|
|
@ -37,6 +36,7 @@ use std::{
|
|||
sync::{Mutex, OnceLock},
|
||||
};
|
||||
use tokio::time;
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
|
||||
use config::{AppTheme, CONFIG_VERSION, Config, ConfigState};
|
||||
mod config;
|
||||
|
|
@ -871,7 +871,7 @@ impl App {
|
|||
for line in buffer.lines.iter() {
|
||||
let text = line.text();
|
||||
let mut last_whitespace = true;
|
||||
|
||||
|
||||
// Count graphemes instead of Unicode scalar values for accurate character count
|
||||
for grapheme in text.graphemes(true) {
|
||||
character_count += 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue