Hacker News new | comments | ask | show | jobs | submit login
Microsoft is updating Notepad (theverge.com)
139 points by cstorres 7 months ago | hide | past | web | favorite | 132 comments

On a semi-related note: You know what would really get me excited? A GPU accelerated, highly optimized text editor, that could display several gigabytes of text with several thousand columns wide rows, smooth scrolling, zooming and text-highlighting. That would be a real step up from current text editors. The only thing that comes close (that I know of) is still Vim minus the smooth scrolling and zooming. Meanwhile system default text editors often crawl to a near halt when selecting several rows which are a few thousand columns wide.

Not exactly what you're looking for (I don't see GPU acceleration being mentioned anywhere(¶)) but you might still be interested in Xi (https://github.com/google/xi-editor).

For what it's worth, there's also a terminal emulator with similar goals (GPU acceleration included): https://github.com/jwilm/alacritty

(¶) Then again, drawing the text is rarely the bottleneck of a text editor (as the sibling post's author correctly points out). It's usually the data structure to represent the text internally and syntax highlighting that have the greatest influence. (Advanced IDE features like syntax checks, linter and indexing aside.)

GPU acceleration would depend on the Xi frontend. I know that xi-win (https://github.com/google/xi-win) uses Direct2D and DirectComposition. DirectWrite is on the CPU, though, AFAIK. It would be cool to hook it up to pathfinder for a full-stack GPU editor, but I'm not sure it would make a huge difference vs CPU+glyph caching.

> DirectWrite is on the CPU, though, AFAIK.

DirectWrite rasterises glyphs on the GPU when used with Direct2D. GPU path rasterisation was Direct2D's killer feature when it was initially released with Windows 7.

You don't need GPU. You need proper algorithms. I'm using EditPad, it works pretty well with big files. I think there are many editors which work good enough. AFAIK Notepad++ can open large files.

I've had issues with Notepad++ and large files, particularly if the file doesn't have frequent line breaks.

Notepad has a hardcoded size limit. Above that it refuses to open the file. I think it's about 300mb.

For me, a large file is bigger than available RAM.

Sublime Text has been using OpenGL/DirectUI to render text since beginning. It's insane fast with its minimap and syntax highlight.

We don’t use GPU acceleration on Windows or Linux, and only on Mac to push pixel buffers to the GPU. All compositing is done in software, and we have our own library for glyph caching.

You know what could open large files? The editor in Visual FoxPro. Because the devs didn't assume to just load it all in memory and call it a day. No, load the piece you need to display, you can go get more from disk if you need it. Without an install in front of me, I'm pretty sure it was limited to 2Gb, though.

I believe memory mapping the file is the way to go.

How does an editor handle loading from disk and updating when someones inserts to the head of a file? Everything needs to be shifted.

You use a https://en.wikipedia.org/wiki/Rope_(data_structure) and not a flat string.

You only flatten the string when it's time to write to disk.

For autosave files make sure to store the changes to the rope, not the full text.

There is a comment somewhere on HN from the guy that wrote the mapping trick that Word (or WordPerfect) invented way back. They were saving changes to the file rather than flattening. I wish I could find it now.

The data structure is called a piece table, if that ids your search.

According to Wikipedia, it looks like Visual Studio Code is using this data structure.

For what is worth, Sublime Text runs on OpenGL[1].

[1]: https://i.imgur.com/u4Hovt1.png

OpenGL is only used on Mac when the screen resolution is detected as fairly high. We use OpenGL because Core Graphics is too slow to copy the pixel buffer to the screen at 60 fps. We don’t, however, composite the interface using OpenGL.

OpenGL is not used on Linux or Windows. Jon explained to me that Sublime Text 1.x (Windows only) was OpenGL, but he ran into so many bugs related to poor drivers that he backed away from OpenGL for ST2 and 3.

What do you mean by zooming? Increasing the font size?

    :nmap + :let &guifont=substitute(&guifont, '\d\+$', '\=submatch(0) + 1', '')<cr>
    :nmap - :let &guifont=substitute(&guifont, '\d\+$', '\=submatch(0) - 1', '')<cr>
    :nmap _ -
With that, you can increase the font size with normal mode +, and decrease it with - or _.

EDIT: By the way, what are you doing that requires handling text files with thousands of columns and gigabytes of text? That sounds very unusual.

Scientific data. Sometimes I forget that a .txt file I'm working with casually in Igor Pro will cause my laptop to seize violently if I accidentally open it with something else.

It's something I would get excited about - not something I absolutely need. In the past decades so much effort has gone into optimizing rendering speeds for computer games or page rendering on browsers while text editors appear to have pretty much stayed the same (rendering wise).

Well, I can understand optimizing rendering speeds for computer games because the general trend has always been wanting ever more realistic graphics.

However, it's surprising to see people want more rendering speed on their text editors, especially to the point that it would excite them. It's something I've never considered them lacking for their purpose. However, that's probably because I've (nearly) never had the need to handle text files with such characteristics (I usually use it for code and configuration files; none get even close to 1MB), and so to me the text editor is among the fastest, lightest programs I typically run.

rch mentioned scientific data. I guess it's a valid point that there are people working with huge datasets in a practical text file format, and if there are people that can work with huge images or videos on their editors, then why can't text editors do the same.

Visual Studio Code’s terminal is GPU-accelerated [0], a work in progress.

[0] https://code.visualstudio.com/blogs/2017/10/03/terminal-rend...

You do not need a GPU accelerated or highly optimised text editor.. You simply need an editor that does not load the whole file to memory, and potentially preloads some data for smooth scrolling and zooming. Operations should be done in O(1) storage as well.

Alacritty[1] + vim

1. https://github.com/jwilm/alacritty

Have you tried EmEditor? It handles gigantic files very well, supports CSV editing and more. Two major downsides are: Windows only, not free

Gvim can handle gigabytes of text easily.

VS Code? No joke.

I switched from Sublime to VS Code because it was better at handling giant log files that would kill subl

Really? I have used sublime for years for log files, Atom and other web based editors would just crash. Hard to imagine that JS would be better at handling viewing large text than C++ (which I think the core of Sublime is written in)

Edit: Benchmarks appear to back this up: https://github.com/jhallen/joes-sandbox/tree/master/editor-p...

VScode improved support for handling large files. They don’t even load the whole file in buffer. Load and syntax highlight as you scroll. Pretty smart approach.

Visual Studio Code's performance is impressive versus Atom. However, there's always room for improvement and I really hope with the Github acquisition that this next generation Atom project is incorporated: https://github.com/atom/xray

VSCode has a problem when lines have many columns, you are unable to view the end, it can copy them to the clipboard though. I have to wrap when I want to see to the end.

Having been playing with Windows 10 recently since not using it more than an hour or two at a time since Windows 2K, it was pretty amazing how much of Windows really hadn't changed, and how much old chrome there is in there.

I'm not sure if that's more due to a "don't fix what isn't broke" attitude, that Microsoft is obsessed with features rather than fixing things, or simply the sheer size of Windows.

I get the sense that changing old things in Windows is a herculean task, while adding new things is much easier.

At some point management had the inclination to essentially wipe the board and start over, and they did that by effectively overlaying a new interface on an old OS. No matter how much of a Msoft fanboy you are, the "some settings are in metro and others are in 7" thing has been clunky and dumb since Vista. They've fixed very little of that.

Since they are redesigning Notepad it seems like they are taking on these legacy things piece by piece.

10 has gotten a lot better at the Control Panel thing, most things can be done in Metro settings finally. Still find myself opening ncpa.cpl whenever I have to touch anything network related though

The Metro panel is still crap in comparison to the old one: the density of information is really low and its poor layout make it hard to use it.

Maybe not the same thing but the settings app is promoted as a faster way of doing everything compared to the control panel but I find it the opposite. The only thing is it's harder to open the control panel than it used to be

> The only thing is it's harder to open the control panel than it used to be

<trys> [WinKey] "con" [Enter]

Nope, still just as easy.

Your taskbar search must work considerably better than mine. It's a complete crapshoot what it'll decide to find if I'm not super careful and let it finish loading. Hence why I'm still a user of Classic Shell.

I observe the same. Determinism is quite important to get things done quickly. Instead, typing "expl" gives me a lottery between Internet Explorer and whatever their file manager is called.

The one that REALLY gets me is search for "Windows Update".

If I do it too quickly, it can't find the update control panel and I end up with an Edge window searching Bing for "Windows update"

I think the key is to turn off Cortana and all the internet searching stuff. If I want to search the internet, I'll use a browser.

How is it still such utter crap? It's been 6 years since the Settings app came out. The prior control panel basically was introduced in Windows 95/NT 4.0: http://toastytech.com/guis/win952.html. Six years before that is 1989, when Windows 2.1.1 came out: https://en.wikipedia.org/wiki/Windows_2.1x#/media/File:Windo.... The degree to which progress has slowed is remarkable. Especially for software that basically does the same thing the old version did (maybe even less work, given that devices today are more self-configuring).

Windows Vista brought another half-hearted control panel rework, where the settings pages were built into the control panel window instead of dialog boxes popping out of it.

Windows 10's 'Settings > System > About > System Info > Change Settings'.

Is Windows Vista's 'Control Panel > System > Change Settings'.

Is Windows 98's 'Control Panel > System'.

count the number of clicks to check/change ntp host... its an amazing maze, I think you can reach all 4 different themes of configuring date & time

My favorite part of Windows is the collection of "open file" dialogs exist. There has to be at least a dozen by this point. Windows 10 has one that was made in Vista/7 days that is actually broken. You can select the file and everything, but the ribbon has an old style and is black text on a dark background. Oh, and highlighting something won't actually highlight it.

The best is this dialog, which is the exact same layout as in Windows 3.1: http://www.intelliot.com/2008/08/windows-vista-install-font-...

The dialog in 3.1: http://notebooks.wpengine.netdna-cdn.com/wp-content/uploads/...

It likely has exactly the same layout because sometime, long ago, some program (e.g. Adobe Type Manager) extended that UI, either by patching its code or by overlaying part of the window with frameless windows containing new controls.

Backwards compatibility doesn’t only apply to APIs.

It also got used less and less. You had to really try hard to install fonts that way and why bother changing something that (a) works, and (b) only a tiny fraction of your users are ever going to see.

Adding a font no longer uses that dialog. It was fun though - an Easter egg in the time beyond Easter eggs.

Windows 10 brought back "for real" a lot of the 'desktop' flavor that was tossed out the window in Windows 8. (keeping the tradition of having every other Windows release be usable :-)).

The addition of the Linux console pushed it over the edge for me in terms of which OS I boot by default when I boot my laptop.

It's more related with "We won't touch Classic Desktops (Win32), because it's basically deprecated". They update the inbox UWP apps almost every day.

Mostly it is the realization that breaking backwards compatibility is bad for business. If corporations risk having to toss their bespoke stack over some MS internal decision, said corporations may decide to go with some alternative in the future.

Hopped back onto Windows last year after a long time away - all the keyboard shortcuts and obscure registry settings I knew from Win95 still worked. Maybe some people would see that as a bad sign, but I loved it.

It's their obsession with backwards compatibility.

It's really hard to fix old broken things when mission critical applications rely on them being broken. But relatively easy to add new features without breaking changes.

"You can now even search for words on Bing through Notepad by simply right clicking on them to get a new option"

That's what the world waited for... I am curious about the politics involved in the prioritization of this feature...

Great! I've always wanted to accidentally send my password to a search engine.

Bing is how Windows makes money now. Kinda like how Android makes money through Google search and ads.

So gotta put that bing touch points everywhere.

I dunno, that doesn't sound like a crazy feature. The purpose of Notepad is many times to look through gigantic log files. When you find the error, you can just select it and then Bing it.

Sure even if your chosen search engine is ddg or gg on firefox (i guess it opens edge maybe) . No politics here. The purpose of notepad is to edit text with no frills. I would have liked better something like unicode encoding selection, minimap or invisible character toggling. Or even better searches options for anyone (regex could be a bit too far..)

As a Mac user it seems crazy that it's an app feature. On the Mac, any app using the system text field automatically gets features like that (spellcheck, dictionary, google, text-to-speech, etc), and as I understand it, Notepad is just a basic wrapper around the Windows text control (hence the 32K limit etc)

That's the difference. Apple had an actual opportunity to restart from scratch and design it right but Microsoft never did

IIRC Notepad won't even open files that are larger than [some pretty low amount of kilobytes]. So it's definitely not being used to look through gigantic log files.

This hasn't been true for over a decade now.

I'm still using Windows 7, so maybe it was improved at some point? If so, why is "Microsoft is updating Notepad" news in the first place?

I think the line endings support is going to be the most valuable addition, that's definitely bitten me when I used to use Windows.

Parsing can be "fun", trying to figure out if text is ended with \n, \r, or both.

Unix's \n, Windows' \r\n, and older Mac's \n\r.

Deciding whether a line-end terminated when reading from a network is kinda hard...

older macs are just \r not \n\r

\r?\n regex?

So, you take a `\r` from the network. So, do you wait for a `\n` before returning the line?

You wait to peek the next byte, or EOF, and then make the choice.

Line protocols do not transmit EOF (and the problem is on each line anyway). And the next byte may only come after you write something on the socket.

I've never understood why they don't license something like notepad++ for $1 a copy, or build their own internal version. The value add creating good default tools instead of paint/notepad/calc/space-cadet is pretty huge.

Notepad++ UI is really far from what you would expect for a Windows built in application. It would basically need to be rewritten. Then there's the professional translation, etc, etc.

I think the ship on built in apps has sailed. Everybody expects to open a web browser or app store to get anything of any use now. Heck, they even stuck ads in Minesweeper.

It made more sense when downloading software was slow or you might not even have an internet connection. I'm sure many Mac owners enjoyed playing Chess before going out and buying some software.

I am excited about this update since I am stuck using notepad a lot on systems at work where I cannot install applications without a change order and getting something like notepad++ approved is basically a non-starter.

There's portable versions of Notepad++, that run right out of a folder, if your antivirus isn't especially draconian, anyway.

Just use WordPad.

Notepad++ has its fans but it falls between two stools.

It is a bit overblown for editing your /etc/hosts file and a bit underweight as an IDE.

People get stuck using Notepad++ and never give themselves the opportunity to invest that time in a tool that best suits development. This could be a grown up IDE, vi(m) or Wordpress's admin editor.

Being lightweight is all well and good if you have a 486/DX33 running Windows 3.11 but most computers have Pentium chips inside them now.

One thing that will probably remain just as useless with Windows Notepad 2018 is use case number one - editing your /etc/hosts file. What else is Notepad really for?

In the rebooted edition of the classic text editor they will still make /etc/hosts only save if you are an administrator, or 'root' user as it is on more conventional operating systems. This is fine and good for security but it does not let you just type in the 'admin' password after you have opened the file and made your changes. With Vista they got the UAC mostly right but not for Notepad and /etc/hosts.

They also hide the /etc/hosts file in some subdirectory that only a young person could possibly remember the file path for. It is not in the conventional place that is expected. c:\wwindows\system32 is as far as I can remember. Then, when you have found the magic folder, it requires a change of the file type in the file dialog window before you can see it, and that is presuming you have file extensions enabled. There is a confusing hosts.isam file in the same folder. Who knows how you explain to your grandma over the phone how to add some IP address to her hosts file so she can see your development site.

Really the line endings problem should have been fixed a long time ago, actually with Windows 95 as it was apparent even that far back that users might want to open files created on systems that were not 'Wintel' (as it was known then as everything else used different processors).

With Windows 2000 - no winsock.dll needed - they should have made efforts to make /etc/hosts editable that bit more easily. That would have sorted out 90% of real world use of Notepad.

Unix philosophy should apply to Notepad - do just one thing - and the Windows Write product should have been where to go for fancy line numbers and such like. That could have made a neat and basic Notepad++ style product with a print view and raw text mode like what early versions of Word had.

Notepad++ is great for handling config files and other miscellaneous files. I seldom use it to write code other than one-off Python scripts - that's VSCode's job. But it's pretty great for inspecting and making light edits. It also has lightweight capabilities for regex search/replace, diffing, and other batch capabilities. And multiple tabs are great.

If you map Notepad, Vim, Emacs, and heavyweight IDE's on a spectrum, I use Notepad++ as a replacement for Notepad and the simpler half of Vim/Emacs, and I use VSCode for the heavier half of Vim/Emacs and typical web dev, and I use heavyweight IDE's for heavyweight dev work (C#/Java/C++ mostly).

> Who knows how you explain to your grandma over the phone how to add some IP address to her hosts file so she can see your development site.

These days with how easy it is to load a container into a publicly accessible site, I feel like that's a solved problem in most cases?

I use Notepad2 as a direct replacement for Notepad - it's a single binary that's a few hundred Kb in size, supports syntax highlighting (with customisation) for most major languages, regex search and replace, rectangular select, coding-friendly text tools (change case, toggle comments, indenting etc), code folding, and handles different encodings and line endings.

If I need anything more then I'll use VS Code, but for single file viewing and editing it's perfect for me.

> Who knows how you explain to your grandma over the phone how to add some IP address to her hosts file so she can see your development site.

If you need your gradma to edit her host file, you are doing something wrong.

Get a $3.99 domain during development, and point it to the IP you need. Problem solved.

Notepad++ loads more or less instantly so there is little point to going down the scale.

The #1 useful feature is just multiple tabs. Sure, syntax highlighting is also great for reading files and simple edits, but need not be part of windows.

It's not just the building part. If it ships with Windows, Microsoft needs to support it for a very long time.

Of course. That's why Windows 10 ships with a voice assistant and ads in the start menu, but no decent text editor. /s

I see zero value with good built-in applications. There are plenty of free applications out there and it's very easy to install them. May be package them and promote via Store for even easier installation experience.

Plenty of people work in environments where they can't install additional apps. On these machines it would a godsend to have a decent editor built in

As soneone who has to deal with systems like that at work all the time, I feel that point can't be hammered home enough.

Everytime you read about some sysadmin person that still uses plain old vi because "it's everywhere" or who actually prefers more unreadable syntax in shell scripts because the nice(r) alternative wouldn't be POSIX compliant, it's basically the same effect. Except that on Windows, you're usually screwed, because there's absolutely no useful tool that does the job you want and ships with the OS (as opposed to some no-pixie-dust tool that's been around for decades and has a bit of a steeper learning curve).

Tangentially related, but I've had jobs in the past where I had to build all-too-complex systems in VBA because of the needs of the business and having my environment too restricted.

I realize this isn't ideal...ever...but sometimes the needs of our department--our immediate needs--didn't align with the time require to navigate the massive corporate and IT bureaucracy.

"but sometimes the needs of our department--our immediate needs--didn't align with the time require to navigate the massive corporate and IT bureaucracy."

I battle this every day. Our systems are so locked down for "security" that we in R&D can't do our job without hacking around IT. Thank God they are not very good so there are plenty of loopholes for circumventing the "security" measures.

They own VSCode too.

And Atom

Ha! That definitely took me a second...

The sale has not happened yet.

It is supposed to be light-weight and simple for users. Of course they used that excuse to let it stagnate so long it didn't support things like Ctrl+S for years.

oh god, their plan might be identical to that for their Windows 10 Solitaire

you either pay a monthly subscription or you get ads


Is that the reason why Windows updates keep removing the win7 games from my system?

Because you can get notepad++ on your own, if you want a fancy text editor from Microsoft just get VSCode.

Or Atom

Or this almost unknown gem which I used extensively in my ancient OS/2 days and later under Windows xp.


They did. It is called vscode.

This sounds like useful updates and I'm glad they kept it small and simple.

I use Notepad many times a day, frequently on end-user machines as a quicky binary file viewer.

Enter shell:sendto in the address bar or run dialog, then add a new shortcut in there for Notepad. Then right-click a mysterious misbehaving file (like a PDF with a DOCX extension) and Send To, Notepad.

Today though I was doing a bunch of RegEdit work with several remote registries and was really wishing for a multi-tab Registry editor. Hope that app gets an update some day.

Thanks but as a windows user I prefer any other editor. My favorite is notepad++

I usually have a half dozen windows of Sublime Text open, but I still occasionally launch Notepad to hold some temporary throwaway text, even though there's no need to.

For some reason I just like having something different open for that "scratch data" that also is visibly differentiated in my taskbar.

same here, even with my light emacs running I still have the reflex to Win+R notepad RET and paste..

then I run M-x doctor to talk about it because I'm conflicted

While I welcome the line endings support, and text zoom makes sense for accessibility, by far my favorite feature of Notepad is that it loads in milliseconds. If new "features" like Bing integration push that startup time into the deciseconds, I hope they will also make Notepad an optional Windows component because installing it will be pointless.

I used to code in Notepad. For years. My god.

I use Notepad as a quick journal throughout the day, I appreciate its simplicity.

But it really stinks they still don't have a basic "auto-recover" connected to it. When your computer crashes or loses power, an unsaved notepad will NOT be recovered like a Windows document, or Sublime, or Notepad++ file would.

I miss proper undo history. One undo is major reason I'm avoiding it.

Because notepad is meant to be... a notepad, not a full blown text editor.

A physical notepad doesn't get erased once I drop it. Sublime behaves much closer to the analogy than notepad in this regard (I can just scribble stuff down, forget about it for a month, and when I rediscover it I can still decide how to file it)

Do you mean "not a full-blown word processor"?

There's a short but somewhat interesting post about notepad's maintenance here: https://blogs.msdn.microsoft.com/oldnewthing/20180521-00/?p=...

> You can now even search for words on Bing through Notepad by simply right clicking on them to get a new option.

That's great I suppose, for people who will use it. My bet is that this is the biggest driver of the update to notepad.

A bit tangentially related, but on macOS people might be interested to learn that TextEdit [0] is open source [1]. It'd be interesting to see Microsoft open sourcing a bunch of their core applications.

[0] https://en.wikipedia.org/wiki/TextEdit

[1] https://developer.apple.com/library/archive/samplecode/TextE...

There's much fuss about having a default text editor on Windows that can edit \n line endings, but WordPad already ships with all versions and can do just that.

I'll skip it thanks. Notepad, and EDIT.COM, work well for what they're meant to do - be basic text editors on the Windows/MS-DOS platform.

The new version just supports a few new features, like non-Windows line endings. It's otherwise exactly the same simple text editor it always was, except now it's not useless when you happen to get something with Unix line endings.

If you want to talk about them adding a bunch of user tracking features to it, you may have a proper complaint.

I mean, I respect that concept; but just for my lifestyle, if someone is sending me .txt files with non-DOS/Windows line-endings, I'm talking to the wrong people.

edit.com was amazing for its time! Super intuitive UI, drop down menus,"natural" (for a windows user) text selection via shift-arrows... All of this in pure text, in a console, a gazillion years ago...

It still works for basic notetaking and prewriting in Win7 - both native and (even better) in DOSBox.

The Sets feature linked in the article sounds more interesting. https://www.theverge.com/2018/6/27/17510344/microsoft-window...

I use Notepad daily. Linked directly from my Win10 taskbar, I use it to take small notes (duh), hold temporary information I can't retain in my brain, strip formatting when copy+pasting and view-source actions where Notepad++ is overkill.

I’d call it a successful update even if they handle new lines well.

I really don’t know how windows works. Their cmd can’t still resize fluently like the Mac one does.

I can see Mac was the OS liked by devs. Somethings are really well done. It’s the small things that matter some times.

On a related note - I've started having gitattributes files to * text=auto eol=lf, ie just LF everywhere. Works fine for us

Is there any possible reason in 2018 to keep CRLFs? Even bat files work with LFs

> Microsoft is also finally adding in ctrl+backspace support

#1 feature right there.

This is also one of the reasons that MacOS keyboard UX is objectively better than Windows UX. Seeing this keyboard shortcuts like this not supported in an application in MacOS would be surprising.

Wonder if Notepad still just wraps the standard edit-control after these changes.

I imagine the latter would have pretty strict backwards compatibility requirements.

Notepad was probably the only remaining part of the operating system that didn't spy on it's users to send personal information back to Microsoft and it's advertisers.

I'm sure that will now change with the latest updates. I mean why shouldn't a basic text editor send user data to the internet.

I have been using Notepad 3 for a while, and it works great in the meantime.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact