Giter Site home page Giter Site logo

eteran / nedit-ng Goto Github PK

View Code? Open in Web Editor NEW
95.0 18.0 26.0 23.5 MB

a Qt5 port of the NEdit using modern C++14

License: GNU General Public License v2.0

CMake 0.97% C 0.75% Yacc 0.33% C++ 91.80% Python 5.53% Shell 0.22% Starlark 0.34% HTML 0.03% SCSS 0.04%
nedit c-plus-plus qt editor linux

nedit-ng's Introduction

nedit-ng

Gitter Build Status License

nedit-ng is a Qt port of the Nirvana Editor (NEdit) version 5.6. It is intended to be a drop in replacement for nedit in every practical way, just as on many systems /usr/bin/vi is now a symlink to /usr/bin/vim.

Because it is a true port of the original code, it (at least for now) inherits some (but not all) of the limitations of the original. On the other hand, some aspects have been improved simply by the fact that it is now a Qt application.

Nedit-ng

Requirements:

Dependency Version Required
Qt >= 5.5
Boost (Headers Only) >= 1.35
Bison >= 3.0
CMake >= 3.0

Compiling:

$ mkdir build
$ cd build
$ cmake ..
$ make

Help Documentation

NEdit had extensive help texts, which have been carefully updated and made available online here: https://eteran.github.io/nedit-ng/

Inherited Limitations:

  • Text display is still ASCII only (for now).
  • Regex engine is the original nedit proprietary implementation. This was kept for a few reasons:
    1. NEdit's syntax is slightly non-standard, and I wanted to keep things backwards compatible for now.
    2. NEdit's syntax highligher has very carefully created regex's which result in things being highlighted in a way that I (and I assume other nedit users) have grown to appreciate. A change in regex engine would likely require a rework on the syntax highlighting algorithm.
    3. The original highligher has some insider information of the regex implementation which it uses in order to be more efficient. I could fake this information, but at the cost of efficiency.

Improvements already available:

  • Bug fixes! Yes, NEdit 5.6 unfortunately has some bugs, some of which can result in a crash. Where possible, the new code has these fixed.
  • Anti-aliased font rendering.
  • Modern look and feel.
  • Internally, counted strings are used instead of NUL terminated strings. This removes the need to have code that played games with substituting NUL characters mid-stream.
  • Use of some C++ containers means many internal size limits are no longer present.
  • Code as been reworked using modern C++ techniques using a toolkit with an active developer community, making it significantly easier for contributions to be made by the open source community.

The goal of the initial release is to be a nearly 1:1 port of the original NEdit. Now that we have achieved that goal. looking towards the future, some additional goals are:

  • Cross platform
  • Internationalization!
  • Python/LUA scripting support in addition to the built-in macro system
  • An improved preferences system
  • Extensibility though plugins
  • Sessions, meaning that you can save and restore an edit session (such as several open tabs)

nedit-ng's People

Contributors

1div0 avatar afeblot avatar anjohnson avatar cgdae avatar ericxuo avatar eteran avatar marilmanen avatar sjtringali avatar tksoh avatar yue2388253 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nedit-ng's Issues

Not all features of secondary selections work

The original nedit had a few features involving X secondary selections. Unfortunately, Qt doesn't have any real notion of secondary selections so to implement this, we'll have to use some raw X functions.

I am undecided about how important this is as it is a set of features that I have not personally used at all. Additionally, Non-X platforms simply won't have support for it. That being said, I'd like to get this set of features functional eventually if possible.

Shell macros do not work

Hi,

When running the Shell -> sort command, all the contents of the file are removed.
Same thing for Shell -> wc.
Shell -> expand makes nedit-ng to crash (the window disappears without any error message in the console). I don't know what Shell -> expand is supposed to do, but I don't think to close the window.

Shell -> Filter selection -> sort works.

Regards.

Xuo.

Nedit-ng window stuck on top right of the screen when nedit-ng is invoked with a file path to open.

Hello,

Thanks for your development of this new nedit with Qt.

I have downloaded the sources ( release 2018.5) and compile it with qt 5.6.3 on RHE6. When I launch nedit-ng with a file path as argument, the nedit-ng window is open at the upper right corner of the screen and I cannot move it. Nedit-ng window appears correctly at the center of the screen when no filecis given as argument. It works fine on Ubuntu in both cases.

Thanks.

Qt's Tab widget introduces shortcuts that interfere with application shortcuts which use Alt

When we create a tab. Qt "helpfully" create a keyboard shortcut for ALT + QKeySequence::mnemonic(text).

Unfortunately, if we have any shortcuts which use ALT, they conflict with this :-(.

I can disable these shortcuts with event filtering, but they still "exist", so Qt will still consider them as creating ambiguity. I have not yet figured out a way to work around this besides not using ALT based shortcuts... which may in the end, be the ideal solution.

Open File dialog unusably slow on moderate-latency sshfs mount

Hi,

First of all, I'd like to say thank you for doing this -- I've been using nedit for a long time, and this port to Qt looks like it'll provide some nice benefits.

One unfortunate problem that prevents me from adopting this version immediately though is that I do a lot of work editing files on remote systems (think transatlantic hops) via sshfs. With nedit-ng, and also other Qt or GTK-based software, the file open dialog is terribly, terribly slow with this setup. Big directories can take minutes to open. With original nedit/Motif, browsing through directory trees (etc.) is perfectly fast (just like doing plain "ls" is).

This seems to be because Qt does a stat() on every file in the directory -- and maybe even probes the first bytes of files? -- which isn't really necessary when the only thing we're interested in is plain text.

Anyway. I guess this is probably impossible to solve within nedit-ng, but I thought I'd throw it out there. (I also tried mounting my remote systems with NFS tunneled over SSH, which is awkward, and worked no better, JFYI.)

Revamp and improve preference manangement

The nedit preference system is confusing. There is basically two sets of preferences, one for defaults, one for the active window. This confuses new users.

I'd like to have them all in a preferences dialog and consolidated into one set of preferences like most desktop applications tend to do.

Zooming

I think it would be great if it was possible to zoom in/out like in browsers, regardless of the character size.
Bonus point to be able to revert to the default scale factor with a shortcut.

Error when compiling nedit-ng (missing file nedit-ng_fr.qm)

Hi,

I get an error while compiling the very last version of nedit-ng :

Generating qrc source nedit-ng_automoc.dir/qrc_translations_OX5LPOHFSWODBI.cpp
RCC: Error in '/automount/Softs/local/nedit-ng/build/source/translations.qrc': Cannot find file 'nedit-ng_fr.qm'
AUTORCC: error: process for nedit-ng_automoc.dir/qrc_translations_OX5LPOHFSWODBI.cpp failed:

Do you know where it could come from ? Two days ago, I could compile everything correctly.

Regards.

Xuo.

More modern default color theme

NEdit's grey color scheme has not aged well when compared and contrasted with modern desktops and applications. I'd like a default dark theme.

Internationalization

Using Qt makes translation possible. If there is anyone who is able to provide translations, they will be welcome!

nedit-ng crashes when using find

adding a patch in separate comment.
needed to remove the "n" check from Search::HistoryByIndex
this was always causing null pointer by the second iteration.
+++++++++++++++
First thanks for porting this. I am a long time user. Built the original on solaris, HPUX, Irix, and linux back in the late 90's.
Recently while cutting and pasting a url form nedit to firefox (59) I found the cut and paste to firefox no longer works. I can cut and paste to anything else except firefox. Not sure why? So this prompted me to try your Qt version. Voila I can cut and paste again. Not sure what firefox did that makes it incompatible with the old nedit. The old nedit works fine with any version of firefox prior to version 59.
I ran into some runtime problems with nedit-ng. I haven't worked in cpp code in a long time so pretty rusty.

platform OpenSuse leap 42.3
compiled using:
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER="/usr/bin/g++-5" ..

App starts up fine.
I get a core dump due to the Q_ASSERT(entry) at line 717 of Search.cpp
If I switch to Q_CHECK_PTR(entry);
I get the following error:

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

If I change the code to
HistoryEntry *entry = HistoryByIndex(1);

then nedit-ng seems to work as expected (it doesn't crash, search history is available during session).

-- Jim

Window size does not display on resize

Running 2018.4 on Ubuntu 18.04 (under Gnome) and when I resize the window it does not display the size of the window as I do so. Works just fine for plain nedit, and the Gnome terminal does it as well. Kind of annoying really as you can't tell how big the window (in terms of characters) you are typing into actually is. It's the only thing stopping me uninstalling nedit and switching to nedit-ng completely.

vim-modeline support?

I think it would be very useful to support vim style modelines, such as:

/* vim: set noet ts=4 sw=4: */

Sometimes closing a tab will set the focus incorrectly

There are circumstances where closing a tab will set the focus to what looks like "nowhere" (it is clearly somewhere, but it isn't obvious).

once the user clicked in the document window or even just hits tab/array keys, it resolves itself. But it should default to the next available tab always.

Remove variable width font support

I know that removing a feature seems like a negative, but frankly, this is a code editor. And the code to implement support for variable width fonts makes things complex, messy, and less efficient when rendering.

Remove Undo/Redo memory limits

These limits are entirely artificial, so we can just remove them. it will make the code simpler and more efficient to do so.

nedit-ng should be able to read the .nedit/* startup files.

Hi,

I have some configurations in the .nedit/nedit.rc file and some macros in the .nedit/autoload.nm.
nedit-ng should be able to read these files to avoid re-creating all the configurations that have allready been used for years.

Regards.

Xuo.

word selection - line selection are lost when pointer is moving

  • When I double click on a word, this one is correctly selected, but if I move the pointer, the selection isn't extended word by word. In fact, not more selection.

  • When I triple click on a line, the selection is correctly apply to the full line, but if I move the mouse, the selection mode is go back to character selection. I lost the line mode selection.

  • Different behavior from the motif nedit is, we can't be able to start a selection when the pointer is above the line number area. This is not so easy.

Advanced options UI

nedit has a few "hidden" settings, that are only accessible via X resources. We should expose them via an advanced settings dialog. Especially since X resource support is phased out as a means of configuring nedit-ng.

Use more standard dialogs

Nedit in several spots used slightly different strings that what you get from Qt's standard dialogs. To implement this as precisely as I wanted, this meant using slightly more complex code in order to use custom captioned buttons in some QMessageBox's. This is not optimal in that it is more complex than necessary, and also, the standard strings often get translated "for free". So I'd like to convert as many as is reasonable to just use standard boxes, so long as they convey the same meaning to the user.

TextBuffer should use size_t or int64_t for length and indexing

Currently, we are artificially limiting how large a file we can open by using int as the basic data type for tracking the length of the text buffers. We should use something more robust for 64-bit. size_t is the prime candidate, but if we have a reason to preserve the signed-ness of things, we can use int64_t as well

Support a block style cursor

Many people prefer a block style cursor similar to those found in console-based editors, we should support this.

The same number of characters is not displayed the same way on 2 lines

Hi,

This is not easy to explain. If I could add a picture would be great.
Here is what I've wrote (to debug my macros) :
. input [12:0] e( input [12:0] e),
. input dd( input dd),

You can see that the "e(" and the "dd(" are not aligned while they should. I know the wiki editor does not display correctly what I write but this is the idea.
In other words, when I set the mouse pointer on the "e" or on the "dd", nedit-ng tells me I'm on the character number 24. It is true but the letters are not correctly vertically aligned.

Could this bug come from the fonts I'm using (Courier bold,10,-1,5,75,0,0,0,0,0) ?

Regards.

Xuo.

How to use the Show Matching (..) feature ?

Hi,

When I was using the native nedit version, I could use the Show Matching => Range / Syntax Based feature.
It could highlight for example, the "begin/end" statement in a Verilog file.
I don't remember how I configured it to work that way but now with the native nedit or nedit-ng I can't make it work.
Do you have an idea ?

Regards.

Xuo.

Using the -geometry command parameter makes nedit-ng to fail opening a file.

Hi,

The command I run :
nc-ng -geometry +100+100 .tcshrc

What I get :
capture d ecran_2018-04-12_22-15-58

There is no problem without the -geometry option.

This option can be run on the command line :
/home/eric 106 # nc-ng -help
Usage: nc [-read] [-create]
[-line n | +n] [-do command] [-lm languagemode]
[-svrname name] [-svrcmd command]
[-ask] [-noask] [-timeout seconds]
[-geometry geometry | -g geometry] [-icon | -iconic]
[-tabbed] [-untabbed] [-group] [-wait]
[-V | -version] [-h|-help]
[--] [file...]

Any idea ?

Regards.

Xuo.

make error in intepret.cpp in CentOS 7

I am building under Centos 7 and got syntax error in the make stage:

/home/mchienlocal/Downloads/nedit-ng-master/GSL/include/gsl/gsl_byte:105:1: error: expression \u2018(l = ((gsl::byte)(((unsigned char)l) | ((unsigned char)r))))\u2019 is not a constant-expression
}

I have attached my make log file (Line 552), appreciate
make_error.txt
if anyone can point out where I got wrong..

Crash in nedit-ng under some circumstances

There is a bug in parseString, which causes a crash under some circumstances. It is rare but reliably reproducible.

It is proving hard to debug, but is caught by ASAN pretty well.

nc-ng fails to start.

Hi,

Here is the error message I get when trying to run nc-ng (everything works fine with nedit-ng) :

# /mnt/Softs/local/nedit-ng/build/nc-ng
nc: The server process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.

Any idea ?

Regards.

Xuo.

Implement a Save All feature

I often do multi-file editing and there is no good solution in nedit for saving all documents quickly. The best I usually can do is to close nedit, and confirm the chain of dialog's that come.

Multiple theme support

Right now, you can theme nedit by changing the style and window colors. This is very effective, but I think users would like to have a list of themes available to them which they can pick and choose which they like quickly.

Modal dialogs as in NEdit

In NEdit (and Geany, and Gedit, etc) all dialogs are "modal", meaning that you can interact with the main window while the dialogs are open.
This is usually very convenient. For instance, you can search some string, do some editing, and continue searching. Also, you can operate a change-test-debug cycle on a macro without closing the "Macro Commands" dialog.
Besides, at least some of my macros are broken because they expect the user to interact with the main window (while the macro is halted), and then close a dialog to indicate that the macro should continue, and perhaps, also to give some input to the macro (a string, row-line, etc) which the user could not decide before the start of the macro.
I think that is a "feature" of NEdit, but is missing in nedit-ng.
Other minor issue are that new dialogs should get the focus, and that, where possible, <enter> should be equivaent to the default button.

Augment config syntax to support external script files

Right now the scripts are stored directly in the configuration file. We should support some syntax to tell the configuration system to load from a file instead.

This will allow easier editing and support for other scripting languages.

nedit-ng does not open files located inside a directory whose name contains accents.

Hi,

nedit-ng can't open a file located inside (for example) : /home/xuo/Téléchargements
nc-ng kodi.log
capture d ecran_2017-12-29_14-56-38

If I copy the file in /home/xuo, then I've got no problem.
I think the issue comes from the fact that "Téléchargements" contains letters with accents.
Some informations :
/home/xuo/Téléchargements 217 # printenv | grep LANG
LANGUAGE=fr_FR.UTF-8:fr
LANG=fr_FR.UTF-8

Regards.

Xuo.

Add the ability to remap shortcuts

This may end up being very complex to do well, but I think it's a worthy goal. I personally love nedit's keyboard bindings, but if we want to be the best editor possible, we should be able to accommodate other people's preferences.

Python/Lua scripting

The nedit macro language has served it well over the years, but we can do better with a more robust, more complete language like python or lua. We will benefit from the fact that it won't have to supply as many (any?) string manipulation functions as these will come for free with the runtime these languages have.

Simplify font management

Related to issue #1. Having multiple fonts for different styles in the same language is once again needlessly complex. Every other code editor I've ever used simply uses a single fixed width font and allows the user to specify things like BG color, FG color, bold, italic, underline, etc... And that's generally how user's (I expect) tend to use nedit as well, by simply using the same font for all.

Simplifying this will make font management a lot more streamlined and easier to manage.

Some words can't be translated.

Hi,

I have attached the picture of something I don't understand.

capture d ecran_2018-05-15_20-52-49

I don't see where the 'cancel' word has not been translated. I wonder if in the file DocumentWidget.cpp, the lines :
msgbox.addButton(QMessageBox::Cancel);
shouldn't be replaced by :
msgbox.addButton(tr(QMessageBox::Cancel));
or something like that.

Regards.

Xuo.

Remove the REPLACE_SCOPE code

The original nedit has an optional alternative search/replace dialog that can be enabled with a compile time flag. I think that for 2.0, it should be removed for a few reasons:

  1. very few users even know the flag is there
  2. supporting this toggle adds complexity
  3. we can develop a new find/replace system that is generally superior

Accents in files should be supported (Unicode support)

Hi,

When I want to write a text file in french, accentuated letters are not supported (this was already the case with the native nedit).
Ex : I want to write 'é' or 'à'.
I get what is displayed in the attached file.
Is there any solution for this issue ?

Regards.

Xuo.

accents

Crash when initializing an array in a macro file loaded from autoload.nm

On nedit-ng 27e11d4,

with the following autoload.nm:

load_macro_file("/......../nedit-ng/other.nm")

and the following other.nm:

# without the comment, it works fine
$an_array[0] = "value"

I get a Segmentation fault in:

0   nedit-ng                      	0x00000001090a4699 ContinueMacroEx(std::__1::shared_ptr<MacroContext>&, DataValue*, QString*) + 169 (interpret.cpp:496)
1   nedit-ng                      	0x00000001090a43fa ExecuteMacroEx(DocumentWidget*, std::__1::shared_ptr<Program> const&, gsl::span<DataValue, -1l>, DataValue*, std::__1::shared_ptr<MacroContext>&, QString*) + 1530 (interpret.cpp:470)
2   nedit-ng                      	0x0000000108fbe076 DocumentWidget::runMacroEx(std::__1::shared_ptr<Program> const&) + 774 (DocumentWidget.cpp:5248)
3   nedit-ng                      	0x0000000108fd9683 readCheckMacroStringEx(QWidget*, QString const&, DocumentWidget*, QString const&, int*) + 1491 (macro.cpp:2198)
4   nedit-ng                      	0x0000000108fbf1b3 DocumentWidget::ReadMacroFileEx(QString const&, bool) + 83 (DocumentWidget.cpp:5201)
5   nedit-ng                      	0x0000000108fb9c47 DocumentWidget::ReadMacroInitFileEx() + 55
6   nedit-ng                      	0x0000000109035687 main + 2807 (nedit.cpp:395)

Move macro parsing to a separate process

I'd like the make macro processing an independent process, where interaction with the current buffer or window would be done via RPC. This has a few advantages:

  1. If for some reason it crashes, we won't lose all of our work
  2. If it is hung, it is trivial to kill the process
  3. isolates the code into an independently manageable project
  4. allows drop in replacements with ease (I'd like to have lua or python as options, see issue #2 )

The contents of the windows shift on the right when selected.

Hi,

Here is a behaviour which is new (or I didn't noticed it but I don't think so).
When I select some text in the nedit-ng window and my mouse goes on the left, then the window's contents shift of the right.
Then, it's a nightmare to get the original window's view.
I don't know where that behaviour comes from , nedit-ng or Qt, but this is (from my point of view) really boring.
Is there a way to prevent that behaviour ?
Bad behaviour :

screenshot_bad

Good behaviour :

screenshot_good

Regards.

xuo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.