editor: Show a normalized path in header bar
- This generally keeps the path as given but simplifies it if possible.
This commit is contained in:
parent
a4b9c4f61f
commit
f8a3fc0bff
1 changed files with 3 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import contextlib
|
import contextlib
|
||||||
import functools
|
import functools
|
||||||
|
import os
|
||||||
import string
|
import string
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
@ -184,7 +185,7 @@ class Editor:
|
||||||
for style in ["monokai", "fruity", "native"]] + [None]
|
for style in ["monokai", "fruity", "native"]] + [None]
|
||||||
|
|
||||||
def __init__(self, text="", path="Untitled"):
|
def __init__(self, text="", path="Untitled"):
|
||||||
self.path = path
|
self.path = os.path.normpath(path)
|
||||||
self.set_text(text)
|
self.set_text(text)
|
||||||
self.mark = None
|
self.mark = None
|
||||||
self.clipboard = None
|
self.clipboard = None
|
||||||
|
|
@ -257,7 +258,7 @@ class Editor:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def load(self, path):
|
def load(self, path):
|
||||||
self.path = path
|
self.path = os.path.normpath(path)
|
||||||
with open(path) as file_:
|
with open(path) as file_:
|
||||||
self.set_text(file_.read())
|
self.set_text(file_.read())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue