Re: [gnotepad-users] gnotepad 1.3
Brought to you by:
ackahn
From: Andy K. <ac...@ne...> - 2000-05-13 00:57:02
|
James, > I thought of a feature request for maintaining nonsmall websites. If I > want to make the same change to several pages, it would be nice to be > able to do a find/replace for several lines of text in all open windows, > changing several html files at once. Is there any way to do this > currently? I couldn't find a way. > > Would it be difficult to implement this? It might be. The solution that comes to mind is fairly straight-forward, but the downside is that memory usage would go up. Let me explain. Currently, gnotepad loads and unloads documents as necessary. That is, when you switch to a document, the file is read from disk and loaded into memory. When you switch away from it, it is unloaded (freed) from memory if there are no unsaved changes to it. This way, unless you have lots of unsaved files opened, memory consumption is reduced and only the current document is actually sitting in memory. For a global search/replace feature across all documents to happen, every document would have to be loaded into memory, since it's conceivable that every document would have some changes from the search/replace. Additionally, even in the current state, search/replace is rather slow on a large file because of the way GTK's text widget is implemented. If a global search/replace were executed across numerous files (here, "numerous" could mean as little as a dozen), it would take a long time to complete. Personally, there *are* better way to make changes (search/replace) across numerous files. Other editors (e.g., emacs) does a reasonable job, though at the expense of high memory usage. If it were me, I'd just use sed in a shell script, or use any other popular scripting language (e.g., perl). regards, --andy |